commit 25990832cf5ca5390d6cd3b03a2c1b8b2a761204
parent 534d2ab62c86693be1a09342b4208082f5e373b9
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 27 Oct 2026 12:18:14 -0400
Merge lane/docs-cleanup: finished plans summarised into plans/archive by goal, STATE.md compacted, two stale AGENTS.md facts
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
125 files changed, 2877 insertions(+), 30408 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md
@@ -360,7 +360,7 @@ whole-directory move), is `legacy` — held by every guard, text included — un
Seven things that are not optional:
- **Never symlink a whole channel dir.** Channel listing filters `isDirectory()` on
- `channelsDir` entries (`channels.ts:246,363`), so a symlinked `<slug>/` vanishes from
+ `channelsDir` entries (`channels.ts:295,419`), so a symlinked `<slug>/` vanishes from
the corpus. Only `media` may be a link (and a legacy channel's `data/`, until it is
migrated).
- **An unmounted drive is not an empty channel.** Every enumerator swallows ENOENT on
@@ -464,4 +464,4 @@ Everything else is in [PUBLISH.md](PUBLISH.md), "The source mirror (homepage)".
Long-running work on the local-AI derived corpus is tracked in [PLAN.md](PLAN.md).
Before doing any phase work, read `plans/STATE.md` (current status + decisions) and
`plans/FACTS.md` (verified codebase facts — trust these over re-deriving them).
-The phase in flight has a detailed plan at `plans/phase-N-*.md`.
+The phase in flight, when there is one, has a detailed plan at `plans/phase-N-*.md`; finished plans are summarised in `plans/archive/`.
diff --git a/PLAN.md b/PLAN.md
@@ -679,15 +679,15 @@ The Claude Code lane needs the `claude` CLI installed and authenticated on the h
## Beyond the AI track: releases
The phases above are the AI track. Later work is planned and recorded one release per file under `plans/`
-(releases 5–16: `plans/release-5.md` … `plans/release-16.md`). From release 17:
+(releases 5–16; the finished ones are summarised in [`plans/archive/`](plans/archive/releases.md), the ones code still cites — 8, 13, 14, 15 — stay in `plans/`). From release 17:
-| release | what | file | status (2026-10-09) |
+| release | what | file | status (2026-10-27) |
|---|---|---|---|
-| 17 | the media tier: a channel's big files on another drive, its text always on the corpus disk | [`plans/release-17.md`](plans/release-17.md) | complete, LIVE 2026-10-02 |
-| 18 | publishing as queueable stages: one index, per-site bundles, serial builds, deploys checked live, the publish lane | [`plans/release-18.md`](plans/release-18.md) | complete on `r18/integration` (`main` merged in, `4cffda3f`); fast-forward + rollout owed |
-| 19 | agents run the archive: ops/CLI/MCP (Track A), machine safety and tooling (Track B), OPERATING.md and the docs (Track C) | [`plans/release-19.md`](plans/release-19.md) | in flight |
-| 20 | the data model and the index: recorded dates, Twitch ids, the caption-track bug closed | [`plans/release-20.md`](plans/release-20.md) | planned, after 19 |
-| 21 | playable archives: local media attached to held videos (clips cut locally), per-video torrents played in the page, a home seeder of last resort behind a VPN; pilot TISM on jeralyzer-private | [`plans/release-21.md`](plans/release-21.md) | planned 2026-10-09 |
-| 22 | one article, two shapes: slides from the same report.json (authoring fields + a derived default), a reader switch Article / Slides / Overview, the isometric overview pairing sections with slides, `slides.html`/`slides.pdf` exports | [`plans/release-22.md`](plans/release-22.md) | planned 2026-10-09 |
-
-Work that landed on `main` without a plan of its own: [`plans/landed-2026-10.md`](plans/landed-2026-10.md).
+| 17 | the media tier: a channel's big files on another drive, its text always on the corpus disk | [`plans/release-17.md`](plans/release-17.md) | LIVE 2026-10-02 |
+| 18 | publishing as queueable stages: one index, per-site bundles, serial builds, deploys checked live, the publish lane | [`plans/release-18.md`](plans/release-18.md) | LIVE 2026-10-09 |
+| 19 | agents run the archive: ops/CLI/MCP (Track A), machine safety and tooling (Track B), OPERATING.md and the docs (Track C) | [archived](plans/archive/releases.md) | LIVE 2026-10-10 |
+| 20 | the data model and the index: recorded dates, Twitch ids, the caption-track bug closed | [archived](plans/archive/releases.md) | LIVE 2026-10-10 |
+| 21 | playable archives: local media attached to held videos (clips cut locally), per-video torrents played in the page, a home seeder of last resort behind a VPN; pilot TISM on jeralyzer-private | [archived](plans/archive/releases.md) | shipped with 19–20 |
+| 22 | one article, two shapes: slides from the same report.json (authoring fields + a derived default), a reader switch Article / Slides / Overview, the isometric overview pairing sections with slides, `slides.html`/`slides.pdf` exports | [archived](plans/archive/releases.md) | shipped with 19–20 |
+
+Releases 23–38 (all merged to `main` by 2026-10-20) and the `lane/*` merges since are recorded in [`plans/archive/releases.md`](plans/archive/releases.md), [`plans/archive/report-video.md`](plans/archive/report-video.md) and the plans code still cites (e.g. [`plans/release-27.md`](plans/release-27.md), [`plans/pacing-guard.md`](plans/pacing-guard.md), [`plans/live-capture.md`](plans/live-capture.md), [`plans/umtool-redesign.md`](plans/umtool-redesign.md)); what each changed for users is in the CHANGELOGs. Work that landed without a plan of its own (2026-10-05 → 10-09) is in the same archive.
diff --git a/plans/FACTS.md b/plans/FACTS.md
@@ -3610,7 +3610,7 @@ still read `true/false/false/false` through `isGateHeld`.
The whole-phase anchors. The slice-1.4 entry above stays as the detail on where a lane's
pause lives; this is everything else a session needs before touching dispatch. Branch
`one-core/phase-1`, `7f294df` → `81a663f` plus a docs commit, 36 commits, unmerged, off Phase 0's `af2a360`. The
-record with every divergence is `plans/one-core-phase-1.md`.
+record with every divergence is `plans/archive/acquisition-and-pipeline.md` (entry `one-core-phase-1.md`).
**The model in one sentence:** the LANE is the dispatch noun (a queue key, a policy tree, a
runner, a pause, a console), the OPERATION is the work noun (a registry entry with a state
@@ -3834,7 +3834,7 @@ writes `data/<id>/source-media.mp4` plus `metadata.info.json` when absent so
through to "unknown invocation", exit 2, and no pointer ever landed.
The full trace, and why five of the plan's hypotheses — H1's mechanism included — were all
-killed by it, is in `plans/deflake-e2e.md`'s "4, as shipped".
+killed by it, is in `plans/archive/acquisition-and-pipeline.md` (entry `deflake-e2e.md`)'s "4, as shipped".
### The `editor/content` symlink still blocks e2e in the primary checkout
@@ -6600,7 +6600,7 @@ Line numbers are `plans/FACTS.md` lines at `e172749b`, before this record's in-p
- **YouTube's 429s are its subtitle (timedtext) fetch, per video.** Measured 2026-10-01 on the
live corpus: all 78 HTTP 429 lines in 24 h of job logs were `Unable to download video subtitles
for 'en': HTTP Error 429`; none on the watch page, player API, m3u8 or a listing; the backoff
- read `fails: 80`. The 2026-09-25 postmortem (`plans/youtube-lane-pacing.md`) found the same.
+ read `fails: 80`. The 2026-09-25 postmortem (`plans/archive/acquisition-and-pipeline.md` (entry `youtube-lane-pacing.md`)) found the same.
- **`subs_rate_limit`** is a `DownloadFailureClass` (`lib/availability.ts`): `classifyDownloadFailure`
returns it when a subtitle-429 line is present and every `ERROR:` line is a subtitle line (no
soft block, no bot check) — `isSubtitleRateLimitOnly` / `hasSubtitleRateLimit`. It is set on a
@@ -6906,7 +6906,7 @@ Line numbers are `plans/FACTS.md` lines at `e172749b`, before this record's in-p
Next is 16.2.3 (`export/node_modules/next/package.json`). The plan and every slice record are in
[`brand-and-themes.md`](brand-and-themes.md) "As shipped"; the release is
-[`release-10.md`](release-10.md).
+[`release-10.md`](archive/releases.md).
- **A force-static GET route handler is copied to its EXACT path under `output: "export"`.**
`next/dist/export/index.js:712` marks an app route handler, and `:728-736` copies its prerendered
@@ -7598,8 +7598,8 @@ out. O3's facts are the section just above ("O3 — runner lows"). Anchors are a
## Release 12 — the source mirror (verified 2026-09-28, `main` @ `ffdeb2cd`)
-Slices Q (`4855f70b`) and R (`ffdeb2cd`): [`release-12.md`](release-12.md), the plan
-[`source-mirror.md`](source-mirror.md), the operator-facing doc `PUBLISH.md` "The source mirror
+Slices Q (`4855f70b`) and R (`ffdeb2cd`): [`release-12.md`](archive/releases.md), the plan
+[`source-mirror.md`](archive/sites-and-publishing.md), the operator-facing doc `PUBLISH.md` "The source mirror
(homepage)". Anchors are at `ffdeb2cd`.
### The step (`common/publish/source.ts`)
@@ -7851,7 +7851,7 @@ Slices Q (`4855f70b`) and R (`ffdeb2cd`): [`release-12.md`](release-12.md), the
## The stats cache key (verified 2026-09-28, branch `fix/stats-cache-key`)
-The record is [`stats-cache-key.md`](stats-cache-key.md). Anchors are at the branch tip. Two notes
+The record is [`stats-cache-key.md`](archive/acquisition-and-pipeline.md). Anchors are at the branch tip. Two notes
on anchors elsewhere in this file:
- The branch added lines to `buildIndex.ts`: anchors above this section that point past `:66`
moved by +1, and past `:559` by +6. They are not rewritten in place.
@@ -8408,7 +8408,7 @@ source mirror (homepage)". Anchors are at the branch.
## A move holds the channel's writers and mirrors its copy (verified 2026-10-01, branch `r16/move-holds-writers`)
-The record is [`release-16.md`](release-16.md), "Slice RM, as shipped". Anchors are at the branch tip.
+The record is [`release-16.md`](archive/releases.md), "Slice RM, as shipped". Anchors are at the branch tip.
This section amends "A channel's media may be on another drive" (above): **a move is now serialized
against the channel's own writers by refusal at the job's start as well as at enqueue**, and the copy
phase deletes from the destination.
@@ -9018,7 +9018,7 @@ Build stats jobs carry a "Superseded by release 18" line pointing here.
## Main's October work, outside release 18 (verified 2026-10-09, `4cffda3f`)
-The record is [`landed-2026-10.md`](landed-2026-10.md). Every anchor below was read at `4cffda3f`.
+The record is [`landed-2026-10.md`](archive/releases.md). Every anchor below was read at `4cffda3f`.
### `pnpm ops transcribe` — one local file through the editor's workers
@@ -10825,7 +10825,7 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri
qr false, transition 0.5, transitionStyle "fadeblack", loudness {target: -16}) instead of `transition: 0`, and
`provenance.channel` from metadata `channel` (else `uploader`) whenever it was empty. An EMPTY siteOrigin
is a "dead QR origin" flag / blocking decision only when a QR the cut draws is built from it (`report.mjs`
- `deadOriginQrsOf` → `lint.mjs` `originQrsOf`; lane siteorigin-check, `plans/siteorigin-check.md` — it replaced
+ `deadOriginQrsOf` → `lint.mjs` `originQrsOf`; lane siteorigin-check, `plans/archive/report-video.md` (entry `siteorigin-check.md`) — it replaced
`originUnused`). Nothing in lint/build refuses an unknown render key (verified: `lintManifest(…, {validators:
true})` on a seeded site-less manifest gives no render error).
- **`/api/report/clips`** POST: `routeCaller(authorization, agentToken())` (`umtool/lib/annotations/agentAuth.mjs`) —
diff --git a/plans/README.md b/plans/README.md
@@ -13,6 +13,7 @@ re-deriving anything. Seven kinds of artifact, with deliberately different lifet
| `<topic>.md` design docs | Live until the design is fully shipped | A model that spans phases and outlives any one of them: [`unified-operations-model.md`](unified-operations-model.md) (how media-derived work is dispatched — the backend half) and [`editor-operations-ia.md`](editor-operations-ia.md) (what the editor's screens are about — the UI half, nine slices, complete). Read the matching one before touching a dispatcher or a page. |
| `release-N.md` | Written at a release's start; its record grows per slice | One release: rulings, slices, the "as shipped" records, the rollout. Indexed at the end of `../PLAN.md`. |
| `landed-<yyyy-mm>.md` | Written once | Work that reached `main` without a plan of its own: merges and what they landed. |
+| `archive/<goal>.md` | One entry added when a plan finishes | A short entry per finished plan or record (title, commit range, the `git show` that reads it), grouped by goal: [`releases`](archive/releases.md), [`report-video`](archive/report-video.md), [`editor-ia`](archive/editor-ia.md), [`acquisition-and-pipeline`](archive/acquisition-and-pipeline.md), [`sites-and-publishing`](archive/sites-and-publishing.md). |
`FACTS.md` is the most valuable file here. It holds exactly the material that is expensive to
establish and cheap to get wrong — the original draft of this plan contained several
@@ -44,5 +45,6 @@ against a tree that no longer exists. Keep it to what `PLAN.md` deliberately omi
files, exact edits, the order to make them in, and how to verify. Everything general belongs
in `PLAN.md`; everything verified belongs in `FACTS.md`.
-Archive rather than delete on merge — `git mv plans/phase-N-*.md plans/done/` — so the
-reasoning behind a shipped phase stays findable.
+On merge, add an entry for the plan to the matching `archive/<goal>.md` and remove the file — its full text
+stays in git, and the entry names the commit that reads it. **Keep a plan in place while code or a live doc
+cites it by path** (grep for `plans/<name>` first): moving it would leave those comments pointing nowhere.
diff --git a/plans/STATE.md b/plans/STATE.md
@@ -3,7 +3,24 @@
The working memory for the local-AI derived-corpus work. Rewritten at the end of every
session, before context is cleared. See [`README.md`](README.md) for the protocol.
-**Now (2026-10-14): release 28 is LIVE** (plan and record: [`release-28.md`](release-28.md)). `main` `d5cd1f3d` —
+**Now (2026-10-27): `main` is `290a94c1`.** Releases 29–38 merged 2026-10-15 → 10-20 (records:
+[`archive/releases.md`](archive/releases.md), [`archive/report-video.md`](archive/report-video.md), and the lane
+plans code still cites — [`release-35/clip-finder.md`](release-35/clip-finder.md),
+[`release-37/archive-sources.md`](release-37/archive-sources.md), [`release-38/x-search.md`](release-38/x-search.md)).
+- **Since 2026-10-21 work lands without a release number**: one `lane/<name>` branch per change, merged to `main`
+ (`git log --merges --first-parent main`). Among them: cookie-refresh alerts, the video knobs (core + UI), deck
+ counts and the finale layout, live capture (`record-live`, `import-media`), clip marks, the live preview, the
+ pacing guard (no burst on any site), Play the cut, umtool on a phone, the brand intro, interrupted jobs resuming
+ on boot, segment reuse and the keyed chunked final encode. Their plans, where one was written, are
+ [`cookie-refresh-alerts.md`](cookie-refresh-alerts.md), [`video-knobs-core.md`](video-knobs-core.md),
+ [`video-knobs-ui.md`](video-knobs-ui.md), [`deck-counts.md`](deck-counts.md), [`live-capture.md`](live-capture.md),
+ [`clip-marks.md`](clip-marks.md), [`live-preview.md`](live-preview.md), [`pacing-guard.md`](pacing-guard.md).
+- **umtool's redesign** keeps its own status in [`umtool-redesign.md`](umtool-redesign.md).
+- **The AI-track and one-core tables below** were last moved on 2026-10-14 and are unchanged since.
+- Session snapshots from 2026-08-12 to 2026-10-09 (each "Previously" block and the "What landed" logs) are in
+ [`archive/state-history.md`](archive/state-history.md).
+
+**Previously (2026-10-14): release 28 is LIVE** (plan and record: [`release-28.md`](archive/releases.md)). `main` `d5cd1f3d` —
release 28, the umtool redesign's P0–P2a and P1 (another session, `plans/umtool-redesign.md`), and the smoke's five
fixes. Editor `DvXDCIMNKavzU_JtCAe9H`, umtool `Gb3L57w_cAltRuB6L0HHE`, homepage and source mirror published.
- **In release 28:** the media drafts (cut, on-screen, teaser, flips, threads, YouTube text) on one framework with
@@ -13,2164 +30,6 @@ fixes. Editor `DvXDCIMNKavzU_JtCAe9H`, umtool `Gb3L57w_cAltRuB6L0HHE`, homepage
- **Owed to the operator:** the bench bar on `/bench` (M8 waits for it); four uncomposable article citations (H4,
in the record); the smoke's three draft articles, keep or delete.
-**Previously (2026-10-09): release 18 is complete on `r18/integration`, and `main` is merged into it (`4cffda3f`, 94
-commits ahead of `main` `e921f82f`, 0 behind: a fast-forward).** The merge brought main's ~70 commits since 2026-10-06
-(umtool articles + notes, `ops transcribe` with word timings, fetch-windows, metadata refresh, channel
-create/rename/delete over ops; record: [`landed-2026-10.md`](landed-2026-10.md)); the changelogs keep both sides, r18
-first. Nothing of release 18 is live.
-- **Owed, in order:** fast-forward `main` to `r18/integration` from a session that is not worktree-isolated (the
- primary clean first); the rollout per `~/reports/release-18/RUNBOOK.html` (editor rebuild + restart, Publish now,
- jeralyzer preview, hub tombstones, step 5b `r18-eva-sites.sh` + production deploys of hasanalyzer and bonnellyzer,
- policies, the lane on; the script guard sha updated to the merge); then pruning — the five `r18-*` slice worktrees
- and their branches, `render-local-sources`; the ~170 merged branches and the stale worktrees (`diet-series`,
- `export-gumroad-tip`, `r13-phase-5`) are listed for the operator to approve, never deleted unasked.
-- **The five working sessions** (Super Hasanalyzer, Super Jeralyzer, Super Jasolyzer, candace owens corpus analysis,
- unified media aggregation) are doing corpus and content work and hold no unmerged code. The tooling gaps they
- reported are releases 19–20.
-- **Releases 19–20 are in flight on three tracks** (index: `PLAN.md`, "Beyond the AI track: releases"): Track A
- [`release-19.md`](release-19.md) A1–A9 (agents run the archive: ops, CLI, MCP) then
- [`release-20.md`](release-20.md) (data model); Track B release 19 B1–B6 (machine safety and tooling); Track C docs
- and plans (OPERATING.md and `archilyzer docs cli`, doc fixes, homepage docs, FACTS). Integration branch
- `r19/integration`, branched from `4cffda3f`.
-- **The `en` → 0 cues caption bug (filed 2026-10-01) is CLOSED** by `200a3105` (en-orig first, empty tracks fall
- through, cue-block VTTs parse, a one-shot index re-read); verified against the tree and an index fixture by release
- 20 D3 (2026-10-10; FACTS, "The caption-track rule"). Left open: the stats cache does not see that pass's re-reads.
-- **Release 20 D2 (Twitch ids) is HELD for an operator ruling**: built and kept on `r20/twitch-ids`, reverted on
- `r20/d2-r20`; the two options are in `release-20.md` ("Slice D2 — held").
-
-**Previously (2026-10-06): release 18 — publishing as queueable stages — is complete on `r18/integration`** (record:
-[`release-18.md`](release-18.md): slices S1 the stage contract, stamps, lock, bundles and CLI; S2 deploy hardening; S3
-the status, the queue and the publish lane; S4 the surfaces; S5 the image half; S6 the records — each reviewed, merged
-`--no-ff`; `main` `edadc712` merged in first). **Not on `main` yet, and nothing of it is live.**
-- **Owed, in order** (the plan's steps 5–6): fast-forward `main` to `r18/integration` from a session that is not
- worktree-isolated (an empty `status --short` in the primary first; if `main` moved, merge it into the integration
- branch and re-gate instead); remove the idle `r18-*` worktrees (keep `r18-integration` until the rollout is done);
- then the rollout: ONE editor rebuild + restart (adapt `~/reports/release-17/scripts/r17-*.sh`), Publish now with
- every policy off (= the index update alone; `/` answers under 5 s throughout), a jeralyzer build → preview deploy →
- live-check verdict, the hub with its tombstone probes (open question 1 for real), production deploys site by site,
- then policies (`build` for all six; `preview` where wanted; `production` for none until a week of lane runs reads
- clean) and the lane on (`checkEveryMinutes` 10, `refreshEveryMinutes` 360); `archilyzer doctor`; build
- `runtime-vulkan` and `runtime-cuda` once.
-- **The Eva tags leak (found 2026-10-06):** `eva-topic` is published on hasanalyzer (1, hasanabi) and bonnellyzer
- (3, omnibased) — the three Eva rules fire on every channel but Eva's own. Ruled: they exist on Anilyzer only (and
- a future VTuber site). Fixed in code on `tags/site-scope` (a tag's `sites`, merged here); the DATA change is
- owed once the new code is live: `~/reports/release-18/scripts/r18-eva-sites.sh` (scopes the three to anilyzer,
- updates the index, rebuilds the three sites), then production deploys of hasanalyzer and bonnellyzer.
-- **What changes for the operator:** /sites → **Publish** replaces "Build all sites" and the hub/homepage sections
- (Publish now, Build all stale, a row per target with index | built | deployed | live chips); **Build stats dataset is
- gone** (the index update builds the stats); `/operations/publish` is the lane; a site's **Publish policy** is on its
- form; `pnpm ops publish {"verb": …}`; `archilyzer publish …` (PUBLISH.md). Every stage is a child process under one
- publish lock, so a build no longer starves the editor.
-
-**Previously (2026-10-02, 03:20): `main` is `a6155bf2` (+ plans commits) — release 17, the media tier, is complete
-and LIVE: the editor on `:3001` (`Dt4zuo5uJcPKZ9fKk0L-f`, restarted 02:51 after the migration) and umtool on
-`:3050` (02:40, `UMTOOL_MEDIA_DIR` set to a folder on the Platter).** Record: [`release-17.md`](release-17.md)
-(slices D0, T1, T2, T3, U1, U2, XP, RL, each with its review; the Rollout section). The operator's runbook is
-`~/reports/release-17/RUNBOOK.html`; its scripts are `~/reports/release-17/scripts/`.
-- **The migration ran (02:40–02:51, editor stopped):** ten channels moved to the media tier (realcandaceo,
- omnimirror, leaflit-rumble, cornbreadman, shondo-vods, friday-night-tights, piratesoftware, kirsche,
- nuxanor-kick, HasanAbiVODs3). **12:19–12:34 (2026-10-02, editor stopped): the big three too** — rekietalaw,
- the-quartering-rumble and omnibased migrated in 860 s; nothing on the retired layout remains; `/home`
- 77 GB → 43 GB free. The auto-subs purge (channel page → Cleanup → "Superseded auto-captions", shown only when the
- bucket is non-empty) applies to 24 HasanAbiVODs3 videos and none of omnibased: the plan's 7.6 GB counted
- every `en-orig.vtt`, most of which are their video's only transcript and are never purged. `--reclaim` (the platter's text copies) later.
-- **The saved-video store move (209 GB → the Platter) is DEFERRED:** started 11:45 offline through
- `relocateSavedVideos`, stopped at 6.8 GB because the platter wrote at 2 MB/s (a 1 GiB `dd` on the idle
- drive: 4.7 MB/s; reads 55 MB/s). The operator cleared the marker (12:58); the store is "In place" again
- and its writers are free. Move it again from the Storage card when the drive writes at a sane rate; the
- 7.4 GB partial copy under `<platter>/saved-videos` is reused. The operator floated "text on the
- platter as a per-channel option" as a release valve for SSD space — not built; a candidate slice. `transcripts/channels` is a paused Syncthing folder: unpausing now
- syncs the migrated text to the peers.
-- **Live proof:** a migrated video page in 0.2 s, its audio and transcript stream through the links (206),
- the dashboard answered in 1.4–2.1 s during three simultaneous report regenerations (D0), `/storage` says
- "legacy (3 to migrate)", umtool's `move-out --all` moved ten `out/` trees (12.3 GB) to the Platter.
-- **Owed to the operator (release 17):** X posts private — create the private site (Sites → New, Audience:
- Private, every channel), set "Where X posts appear: Private" on `/settings`, rebuild + deploy hasanalyzer,
- anilyzer and jeralyzer, REBUILD + DEPLOY THE HUB (it serves X posts today), decide on old Cloudflare
- deployments, re-register the MCP against the private build; the saved-video store move when the platter writes properly; watch the download
- lane page (YouTube's backoff was at 6 failures at 03:18, no hold; "Clear hold" is the way out of a hold).
-- **Rulings this release:** an implementer's commits carry its own model's `Co-Authored-By` (never rewritten
- to another model's); never write the refused identifier suffix as text in a record; never run a whole e2e
- suite while other agents work (an OOM kill at 22:41 took the desktop session and a transcriber).
-
-**Previously (2026-10-01, 00:10): `main` is `271db070` — releases 14, 15 and 16 (CK the "Search in" row, DX the
-setup on the homepage's AI and MCP doc), release 13's three slices that had never landed (W3 the
-build image, W1 the editor lows, W2 the export/docs lows, each brought to `main` by a reviewed
-merge), and the report-video on-screen deck from the parallel session (`plans/onscreen-deck.md`).**
-Records: [`release-16.md`](release-16.md), [`release-13.md`](release-13.md) (its Rollout is now
-written), [`release-14.md`](release-14.md), [`release-15.md`](release-15.md). The operator's runbook is
-`~/reports/release-15/RUNBOOK.html` (its banner carries the current two lines).
-- **Live (2026-10-01, 01:31) — everything:** the editor on `:3001` (`3Wc3BdFQWKuLx9PbNZvmB`), umtool on
- `:3050` (`LRRG_c7H8GRM6ZpHbqvt0`, the deck), the index and stats, the homepage from `2cf43a69`
- (mirror `6b34c2aa`, 2,029 commits; 20/20), the hub (6 sites) and the six sites (Search in, the
- `@Archilyzer` link, the Use-with-AI link to the homepage doc, the sixth chart colour) — the
- operator ran `r15-umtool-restart.sh` and `r15-deploy-all.sh` at 00:26–01:31. `realcandaceo` is
- still held by its own interrupted media move (the operator's Resume).
-- **Release 16 is complete and LIVE on `:3001` (2026-10-01 12:54, `Xfavvt2XajdNzOvvn0NtL`):** FK
- (`a44dc38d`, forms keep what was typed), RM (`ae23a695`, a move refuses over a running job, holds
- the channel's writers, mirrors its copy; Reconcile and resume), XL (`a07bfa21`, the Connect window
- is the operator's own browser without automation signals; the fetchers use the operator's Firefox
- login via `social.x.cookieSource`). The posts deck (`458f4fcd`) is live on umtool (restarted 11:13).
- `realcandaceo`'s move completed 2026-10-01 (five stale scratch files removed from the destination
- copy by hand, then Resume) — the case RM now handles itself.
-- **Owed:** the build-only Build all through the rebuilt build image, when the machine is idle; the
- operator's by-hand check of the X section (Check, then Connect or the browser login). Follow-up filed: `export-search.spec`'s "Deleted"
- checkbox locator matches a result card's "Select … for AI" box by substring (`exact: true`).
-- **Settings changed by hand through `writeSettings` (2026-09-30):** the X social link is
- `x.com/Archilyzer`; `storage.health.budgetMs` 20000 and `probeTimeoutMs` 10000 (the 3 s default held
- six Platter channels while renders churned the disk — the operator's ruling was to tune, not to
- change the detector).
-- **Rules changed:** the homepage build gate is `build:nodata`, never `run build` (its `prebuild`
- indexes whatever `transcripts/` is visible — a three-minute stray index build against the real
- corpus happened during W2's catch-up; identical code, two records, stopped).
-- **Ruled and built (2026-09-30):** the source's history under `/source/git/` by stagit (SG;
- Sendforge was out: JS for history, no sub-path); the drive-health timings as
- `settings.storage.health` (DT).
-- **Follow-ups the reviews named:** the editor's and export's build traces list dot-directories
- (cosmetic while `standalone` is off); `REQUIRED_TOKENS` lacks `--chart-other` (the e2e pins it);
- `export`'s `WorkspaceView` `splitOn` has a one-paint flash from a localStorage restore;
- "Load more results" never resumes a leaf that settled at its cap (`runQueryTree`'s `setHitLimit`
- reaches running leaves only; on `main` too — release 16 CK re-review R-I1; wants a spec).
- - `/changelog/` overflows a 390 px phone: long inline code in a released entry
- (`export/CHANGELOG.md:103`, the 133-character `export/app/ask/{useAskChat,…}` list) cannot wrap. Wrap `<code>` in the changelog renderer, then drop
- the `test.fail` in `export/e2e/responsive.spec.ts` (release 16 DX).
- - The JSX entity/whitespace hazard sweep: 22 texts in 19 files run a word into the element before
- them (FACTS, "Use with AI is the homepage's AI and MCP doc"; release 16 DX).
-
-**Previously (2026-09-28, night): the stats cache key fix — built, reviewed (SHIP AFTER FIXES, then SHIP
-on re-review; every touch-up done), not merged.** (Merged `10cefd15` the same evening; the recount rolled out with
-release 15, the homepage at 77,547 transcripts on 2026-09-30.) The branch is `fix/stats-cache-key`, and [`stats-cache-key.md`](stats-cache-key.md)
-holds the record, the review and the rollout. FACTS has "The stats cache key".
-- **What it fixes:** the homepage showed Jasolyzer as 0 transcripts, 0 channels, 0 hours while it
- served 1,889 videos. Instance-wide it showed 49,798 transcripts of about 77,000.
-- **The cause:** `statsByPath` was keyed on the metadata mtime alone. It is now keyed on the index's
- own record as well, and a transcript always has a date.
-- **Added by the review:**
- - a guard against clearing a newer cache (`ARCHILYZER_STATS_ALLOW_DOWNGRADE`);
- - an unmounted drive's stats are kept, and a cache clear with one refuses;
- - "not indexed yet" and "not indexable" are counted apart.
-- **Owed after the merge:** the rollout in the record, in its order. First, rebuild and restart
- :3001 (until then, never press "Build stats dataset"). Then index, then one full stats pass of
- 10–30 min, then the homepage, the hub and the sites. The homepage deploy waits on release 12's
- step 0: it runs the source publish.
-- **Merge note:** `homepage/social-visible` merged `main` (`10cefd15`) at `4d11542c`; the one
- conflict, `homepage/CHANGELOG.md`'s `[Unreleased]`, kept both sides.
-- **CLOSED by release 15 slice IG (branch `r15/index-hold`, [`release-15.md`](release-15.md)):
- the index build no longer treats an unmounted drive as an empty channel.** It holds the channel:
- not rescanned, its index records and shared pages kept, and the `Diff:` line says
- ` Held: N channel(s), K video(s) kept.` A full rebuild with a channel held refuses unless
- `ARCHILYZER_INDEX_ALLOW_HELD=1`. FACTS has "The index build's hold". Until that branch is merged
- and rolled out, the rollout's step 3 `Diff:` check stays the safeguard: thousands removed means
- a drive was missing.
-
-**Previously (2026-09-28, evening): release 12 — the source mirror — is merged to `main` and NOT rolled
-out.** [`release-12.md`](release-12.md) holds Q's and R's records, their reviews, "Merged" and
-"Rollout". The operator's runbook is `~/reports/release-12/RUNBOOK.html`, with its scripts in
-`~/reports/release-12/scripts/`. The plan is [`source-mirror.md`](source-mirror.md).
-- **What merged:**
- - **Q** (`4855f70b`, and the changelog fix `e6c5d2e3`) fixes the hardcoded umtool paths.
- - **R** (`ffdeb2cd`) adds `archilyzer source publish`:
- - a fresh bare clone of `main` is rewritten by git-filter-repo with the operator's scrub rules,
- then repacked for git's dumb HTTP;
- - an audit gate refuses a denied literal anywhere;
- - the raw tree at `/source/tree/` and the tarball are published beside the mirror, and the
- `/source/` page shows them;
- - a refusal withdraws the source from `public/` and `out/`;
- - `deployHomepage` refuses any `out/` it cannot vouch for.
-- **The operator's side is prepared:**
- - `~/.config/archilyzer/` holds a scrub file (3 rules) and a denylist (3 literals: the user name,
- the host name, an email address). NEVER print them;
- - `git-filter-repo` 2.47.0 is installed with pipx;
- - `source publish --check` exits 0. With `main` at `ffdeb2cd` it would publish `8188e02a7d04`:
- 2,473 files, 69.8 MB. The parent's first check, on `e56101fdee5d`, gave `20c367613f75`.
-- **Owed, in order** (release-12.md "Rollout"):
- 0. The operator completes the denylist (real name, handles), then runs `source publish --check`.
- **No deploy of any kind before this: a Pages preview is public and permanent until it is
- deleted.**
- 1. The song link, before any umtool restart.
- 2. Rebuild and restart :3001 with `~/.local/bin` on PATH. It runs 0.10.0 (`BUILD_ID`
- `vWCJb87ktCy5akih_pM9X`), which has no source step, no withdrawal and no deploy check.
- 3. A FRESH `archilyzer build homepage` in the primary. The current `out/` predates `/source`, so
- the deploy check refuses it.
- 4. The preview `--preview source` and its live checks.
- 5. Production.
- 6–7. What to do if the edge refuses the clone, and if anything private ever ships: delete that
- deployment.
- 8. The cut (`release cut editor …`: 2 bullets; export has none) and the worktrees.
-- **Baselines now:** common **2,149**, homepage unit **7**, homepage e2e **36**; editor unit 85,
- `test:scripts` 185 + 1 and mcp 269 are unchanged.
-
-**Previously (2026-09-28, afternoon): release 11 is LIVE as 0.10.0, and Jasolyzer is launched.** The
-rollout ran 12:11–14:05 ([`release-11.md`](release-11.md), "Rollout, as done", every deploy and job
-id): the cut (editor `24c8352e`, export `bf6904e8`), ONE :3001 restart (`BUILD_ID`
-`vWCJb87ktCy5akih_pM9X`, on `main` `e6c5d2e3`), a Settings save (two ran; the second byte-identical — `buildPipeline.mode` dropped, the
-x.com icon `currentColor`), and the six sites by name + the hub + the homepage (the homepage through
-`pnpm ops build-homepage {"deploy":true}` — O4's live proof). **Jasolyzer**
-(https://jasolyzer.pages.dev; `piratesoftware`, 1,889 videos; archives and transcript downloads
-off; vermilion; a draft description the operator may reword) is the sixth site in every footer, the
-hub and the homepage. **The LM chat-only tier is closed as moot** (Legal Mindset's filter has
-`includeLivestreams: true`).
-- **The external drive stalled the rollout** (11:35–12:57): an SMR disk (`sdb`, JMicron JMS578 UAS)
- under a 10 GB remux timed out, reset and froze :3001 — all four libuv workers blocked in its
- ext4 reads. No data errors. **Open, for a later slice:** one stalled drive freezes the whole
- editor. **Operator options:** `echo 180 | sudo tee /sys/block/sdb/device/timeout` (not persistent)
- and the durable `options usb-storage quirks=152d:a578:u` (a replug; do it with the lanes paused).
-- **Release 12 belongs to a parallel session** (the source mirror, [`source-mirror.md`](source-mirror.md);
- slice Q merged at `4855f70b`, slice R next). **This session's bundles are release 13**
- ([`release-13.md`](release-13.md)): W1 editor lows, W2 export/docs lows, W3 the build image (with
- W3b: container Build all was broken on `main` — `.next` symlink + the image's baked `public/` —
- and a wrong-site guard now sits before every site deploy), all reviewed SHIP; then one-core
- Phase 5 (P0, the plan doc `one-core-phase-5.md`, awaits the operator's OK and five rulings).
-- **Worktrees:** the seven `r11-*` stay until release 12's are gone (index-based ports).
-
-**Previously (2026-09-28, morning): release 11 is merged to `main` in full and NOT rolled out.** The
-overnight of 2026-09-28 ([`release-11.md`](release-11.md): every slice's record, then "Integration,
-as merged", then "Rollout"). `main` = `eb28a341` + three integration `plans:` commits
-(FACTS `eeff74c3`, `brand-and-themes.md` `3643c974`, then this STATE and the record); no code
-changed at integration. Nothing was deployed, cut, pushed or restarted; :3001 still runs `BUILD_ID`
-`S07zTu3MKTjHJa9eDM1GF` (2026-09-26 21:46).
-- **The slices, in merge order:**
- - **O4 — the homepage builds and deploys from `/sites`** (`baaa4b47`): a Homepage section after
- Hub (Build homepage / Deploy after build / Deploy homepage, a preview branch box), jobs
- `build-homepage` / `deploy-homepage` / `build-deploy-homepage`,
- `/api/ops/build-homepage|deploy-homepage` and `pnpm ops build-homepage|deploy-homepage`;
- `JobLane` survives Strict Mode.
- - **O3 — runner lows** (`c1d4790a`): an `error` recheck keeps a video "Missing?" (5 real videos flip
- at the next build: jeralyzer 4, rekietalyzer 1); a failed forced source download keeps the
- subtitle pass's status and fails the job with yt-dlp's line (`sourceFetchFailure`); a bucket's
- retry keeps its log (`cookies-mode.spec:241` deterministic); the cut-release lows L3 + L4.
- - **O6-A — one-core Phase 4 slice 3, checkpoint A** (`cb9d02b2`): `archilyzer doctor`, `run
- <operation>`, `mcp`, every bin a subcommand, `pnpm archilyzer`; `common/lib/ports.mjs` and
- `common/lib/envVars.ts` → generated `ENVIRONMENT.md`; `PUBLISH.md` absorbs the two deploy docs;
- the build mode is a label (then dropped outright: O6c, below).
- - **O1 — hub lows** (`6cd3a9fe`): `/ask` waits for the hub's list, says when there are no
- archives, shows a scope line; a member's missing live chat on its chip with a live-chat Retry;
- `normalizeSocialSvg` themes a single-colour icon (the x.com fix); `mcp/README.md`'s `fetch_clip`
- env lines. Three DRAFT copy lines (ruled 2026-09-28: shipped as written, O1c).
- - **O2 — homepage and brand lows** (`139a648e`): a custom hex fitted per base (`perBaseColor`),
- `--chart-6` (a rust, Vermilion's family, validated), the mark's forced-colours outline, the
- homepage e2e on a synthetic summary.
- - **O5 — umtool brand fonts** (`15d5d646`): the rail / ledger / scroll / chart in IBM Plex Sans
- under the brand, fitted by the face's own advances; IBM Plex Mono Bold vendored; an unbranded
- render byte-identical (334 files).
- - **O2b — follow-ups** (`69e7f59e`, + changelog nits `59d2f877`): the hub's added archives fitted
- per base; `<clipPath>` passed over like `<mask>`; `no-data.spec`.
- - **O6-B — checkpoint B** (`eb28a341`): every test-only env var `E2E_`-prefixed and declared in its
- playwright config; the harnesses read `ports.mjs`. **One-core Phase 4 is done** (the optional
- SETUP/PLAN.md consolidations aside).
- - **O6c — the build-mode stub dropped** (2026-09-28 morning, on the operator's ruling; branch
- `r11/phase-4-s3` tip after `5b6a66ec`): `buildPipeline.mode`, the `/sites` toggle and the
- Settings select are gone; an old `settings.json` with `mode` loads and drops it on the next
- save; Build all still uses containers whenever `docker version` answers.
-- **Gates on the merged tree** (`eb28a341`; every number in the record): tsc clean; common 2,112,
- editor unit 85, `test:scripts` 185 + 1 skip, mcp 269, homepage unit 2; the three generated-doc
- checks exit 0; editor, export site + hub, homepage and umtool builds ok; e2e export 206, `e2e:hub`
- 33, `e2e:2origin` 3, homepage 31 with 0 skipped (no `homepage/public` data), umtool 175 + 2 failed +
- 45 skipped (the known `mix.spec` pair; alone ×3 36/36), editor full 652 + 1 failed + 12 skipped of
- 665 in 39.5 min (`transcript-source.spec.ts:76`, a flake new to the records: alone ×3 9/9).
- Verdict: **FLAKES-ONLY**, no regression. The primary's `export/public` was byte-identical at every
- checkpoint.
-- **What the operator owes, in order** (`release-11.md`, "Rollout"; the parent's runbook
- `~/reports/overnight-2026-09-28/MORNING.html` has the scripts):
- 1. ~~**The copy rulings**~~ **Ruled 2026-09-28 (the operator: "ship the drafts as written but I
- don't like this regex bracket link thing").** The four lines in
- `export/app/ask/hubScopeCopy.ts` ship as written. Follow-up O1c (`a4ffa959`, `r11/hub-lows`)
- removed the DRAFT markers and replaced the [bracket] + regex link with `` copy`…${link("…")}…` ``.
- No reader-visible change, so no bullet. Record: `release-11.md`, "Operator rulings and
- follow-up O1c".
- 2. **The operator questions the records raise:**
- - ~~Should Build all honour `buildPipeline.mode` (today a label; O6)?~~ **Ruled 2026-09-28:
- dropped** ("just drop it for now rather than keep the stub"). Follow-up O6c removed the mode,
- the `/sites` toggle and the Settings select; an old `settings.json` with `mode` still loads.
- Build all uses containers whenever `docker version` answers, as before.
- - ~~Is `--chart-6`'s rust near `--state-gone` acceptable (O2)?~~ **Ruled 2026-09-28: accepted;
- Vermilion keeps slot 6.**
- - ~~Settle the five 410'd Rumble videos with a "Full-check unexpected" on `rekietalaw-rumble`
- and `the-quartering-rumble` (O3)?~~ **Done 2026-09-28 13:32Z** (the operator: "full check the
- rumble channels"; run by the parent on :3001 through `platform:rumble`): all five read
- deleted, 0 errors, so they publish as Deleted at the next build, not "Missing?" (jeralyzer's
- and rekietalyzer's counts do not rise by 4 and 1). Record: `release-11.md`, "Operator
- actions (2026-09-28 morning)".
- 3. **A release cut** (`archilyzer release cut all next --commit`; editor 8 and export 9 pending
- bullets — export's is public on every `/changelog`).
- 4. **The :3001 restart** on the new `main` (it brings O4's Homepage section and routes, O3's
- retry-bucket and cut-form fixes, O6's copy and the digest replay that keeps `ids` — restart
- before retrying any `archilyzer run digest` job — and O2's sidebar outline).
- 5. **One settings write** after the restart (any Save): it re-normalizes the stored social icons, so
- the x.com icon loses its `fill="white"`.
- 6. **The deploys:** the five sites by name, then the hub, then the homepage — the homepage through
- the new `/sites` → Homepage section (Build homepage, then Deploy homepage), which is O4's live
- proof.
- 7. **Re-upload the YouTube picture, watermark and banner** (`~/reports/archilyzer-media/brand/`),
- still owed since release 10.
- 8. Optional: rebuild + restart umtool on :3050. Its app changed only in `lib/tools.mjs` (the
- shared tool probe) and two test-only variable names; O5's render changes already reach it from
- disk (the live :3050 spawns `report-to-video/*`), and an unbranded render is byte-identical.
-- **Release 14 (2026-09-28): HP merged (`bfa1ff3c`, final review SHIP); T1 and H1/H2 built on
- `r14/two-grounds-headers`, not merged** — `plans/export-header-first-search.md`, record in
- `release-14.md`. S1 (a clear screen until the first Search) is next, and S2 is a candidate.
- - **HP** (merged): the homepage's header carries the social row and one theme toggle at every
- width, through the shared `SocialLinks`; its wordmark's text drops first on a very small
- screen; Changelog is in the footer; the cards wear the site's wordmark; a social icon is
- checked by an allowlist on save and at render; `featured` on a social link.
- - **`r14/two-grounds-headers`** (built, `0f358ee7` + the records):
- - the final review's Lows (F1, F3, F4, F5, F8);
- - F8 opts every cwd-derived path op in the three Next apps out of Turbopack's tracing, with
- the guard widened to `scripts/next-build-trace.test.mjs`;
- - the charts' foreground separators are withdrawn for a 2 px gap in the surface's colour,
- the shared charts included;
- - **T1:** two grounds, Light and Dark, in every app; a stored Sepia reads as Light before
- paint and is rewritten; each site wears its own accent, and the accent picker is gone;
- - **H1/H2:** every site's header and the hub's carry the social row and the toggle as one
- group; an Archilyzer link to the homepage's new `#instances` replaces the sites dropdown
- and the hub link; Changelog is in the footer; the wordmark's text drops exactly when it
- does not fit, for any title; the inline nav starts at `lg`.
- - **Reviewed SHIP AFTER FIXES; the fixes are in:**
- - stacked areas in the shared charts keep their coloured edge, with the surface gap on
- stacked bars only (H1);
- - the growth chart measures thickness at right angles before it takes a gap, so no band is
- covered; the gaps now read as dashes, and folding the small sites into "Other" or small
- multiples is the operator's call (M1);
- - the hub URL texts say what the setting does now (M2);
- - the Lows (L1, L2, L5, L6, L9, L10); L3 and L7 are left, and L4 needed nothing.
- - **Owed:** the parent's merge, then the rollout in `release-14.md` ("## Rollout"): the editor,
- then the homepage (with `#instances`) before any site, then the hub, then the six sites.
- - **The narrow header, as ruled after the review, is built** (`447ded9a`). Below 520 px every
- header shows the name and only the links marked **Keep in header on small screens** (none
- marked → none); from 520 px it shows every link, up to four.
- - **Re-reviewed SHIP; its findings are in** (`1a2e3342`, `4ea1c495`, `11a33f7a`):
- - below the switch the export bar's two gaps are 8 px (ruled 2026-09-29): every real title
- shows in full at 360 px under touch with one marked link (Rekietalyzer at exactly 360);
- - the wordmark's reservation is a minimum width, so wider-rendering text is never clipped;
- - the switch is `32.5rem`, so it moves with the reader's text size, and the homepage's
- wordmark fit is keyed by the wide row's count from it;
- - a marked link keeps its configured place (ruled as built).
- - **The operator's settings:** the link to keep in the header is marked in Settings BEFORE any
- build; the parent does this when the branch lands (`release-14.md`, "## Rollout",
- precondition 5).
-- **Next candidates:** one-core Phase 5 (projects join the core, `plans/one-core.md`); the Diagnostics
- cards keeping their retry log (O3's found-and-left); `ChartView.tsx`'s five-slot cycle reaching
- `--chart-6` (O2); O5's two wording lows in `svg-faces.mjs` / the README (kerning is not
- conservative; `FALLBACK_EM` has exceptions); the LM chat-only tier config; the `Dockerfile.build`
- image refresh; `transcript-source.spec.ts:76`'s stale-snapshot race (FACTS, "What the integration
- gate found"); removing the seven `r11-*` worktrees, this one included once `main` carries its tip
- (it re-sorts the port blocks; `diet-series` stays).
-
-**Release 10 is fully rolled out as 0.9.4 (2026-09-28, 00:53).** The blocks below this one are
-the history, newest first from "Accent swap and mark contrast rolled out".
-- **Slice MR** (the mark ring on dark) merged `2b10f31b`; **0.9.4** cut as editor `2a6f6884` +
- export `ee9d41fa` (record: `release-10.md`, "Slice MR, as shipped").
-- **Deployed from `ee9d41fa`** (`~/reports/release-10/tmp/r10-*.log`): the five sites by name
- (jeralyzer `df279ac1`, anilyzer `e367536d`, bonnellyzer `41e9b1aa`, hasanalyzer `a48342b6`,
- rekietalyzer `05444c21`), then the hub `10d6946f`, then the homepage `7ca70923`.
-- **Verified live:** `--mark-ring` on every surface; `/changelog` shows 0.9.4.
-- **Owed by the operator:**
- - the :3001 editor restart (the favicon and the sidebar mark's ring; :3001 still runs the
- post-brand build of 2026-09-26 21:47, `BUILD_ID` `S07zTu3MKTjHJa9eDM1GF`);
- - re-uploading the YouTube picture, watermark and banner (`~/reports/archilyzer-media/brand/`).
-- **Next:** release 11, the overnight of 2026-09-28 ([`release-11.md`](release-11.md)).
-
-**Previously (2026-09-26, afternoon): release 10 is merged to `main` in full and NOT rolled out.** It is
-the brand (S0–S3: the Found-line mark and base × accent reader themes; its own final commit
-`bb6f378f`, then cut as editor + export 0.9.0 at 01:37, `0e0d8f59` + `31798769`), plus brand S4 and
-the lows L1 + L2. Those three merged 2026-09-26 12:52 on the operator's word, before the rollout,
-and the integration pass gated them together. Record: [`release-10.md`](release-10.md) (the L2
-and L1 records, then "Integration (S4 + L1 + L2), as merged"); the brand's plan and per-slice
-records, S4's included: [`brand-and-themes.md`](brand-and-themes.md).
-
-**Hub link hidden again (2026-09-26 night, operator: "Hide the hub again for now"):** `9217eaaa`
-`homepage/app/page.tsx` `HUB_LINK_ENABLED = false` (the release 9 C3 flip reversed); the hub stays
-deployed and reachable by URL, the sites' header backlink points at the homepage (not the hub) so
-nothing else changes. Homepage e2e 27/27; redeployed to production from the primary (see the line
-below this block's homepage entry).
-
-**Merged to main (2026-09-26), NOT rolled out:**
-- **Slice P, cut a release from the CLI — merged `2edaf4f8`** (`cli/cut-release` @ `e23782e8`, reviewed SHIP
- after fixes; common 2,015, scripts 174 + 1, e2e list 53/53). One writer `common/controller/cutRelease.ts`;
- the `/sites` form is an adapter (its version box also takes `next`/`next-minor`);
- `archilyzer release show|cut <editor|export|all> <X.Y.Z|next|next-minor> [--commit] [--date]` locally with
- no editor running (`all` cuts both or neither; a real calendar date; a version newer than the latest
- heading); `pnpm ops cut-release --json '{"workspace","version","commit"}'` → `/api/ops/cut-release`
- (exists only on an editor built from this main). No package.json bump, no tag — the heading is the
- version. Proved read-only from the primary: `release show` → editor 0.9.0 + 9 pending, export 0.9.0 +
- 4 pending, next-minor 0.10.0. The runbook's step 0 is now that command. Plan:
- [`cut-release-cli.md`](cut-release-cli.md).
-- **Slice O, the Ko-fi mark on every site — merged `6a5167a7`** (`export/kofi-mark` @ `ec08bc7e`, reviewed
- SHIP; export e2e 204/204, hub 24/24). The official `kofi_symbol.svg`, byte-identical at
- `export/public/kofi-symbol.svg`, is the LAST item of the footer's social row on every site and the hub
- (accessible name "Ko-fi", no copy, official colours, offline-cached like the icons); the hub's bare
- text link is gone. SUPERSEDES the 2026-09-25 "hub + homepage only" ruling on the operator's word
- (2026-09-26: "show kofi in the social section on all sites"). Homepage untouched. Live only after
- every site + the hub rebuild (runbook steps 5–6). Plan: [`kofi-mark-on-sites.md`](kofi-mark-on-sites.md).
- **Reversed by `export/drop-kofi`** (Ko-fi dropped for now, 2026-09-26; record in `release-10.md`).
-- **Slice N, the whole-recording fetch downloads anyway + metadata history — merged `6a1678a0`**
- (`editor/full-fetch-media` @ `115f9656`, reviewed SHIP after fixes; full editor e2e 641/2/12 of 655,
- both failures classified: `tags.spec:220` load flake 3/3 alone, `cookies-mode.spec:241` a pre-existing
- log-unmount in `DownloadStage.tsx`, low). `forceMedia` on `downloadOneManaged`: Persist source video,
- `fetch_clip` `full: true` and Persist kept now fetch + persist the source on a captions-only channel
- even with a transcript on disk (Whisper transcript untouched, no audio beside one; YouTube subs are
- re-fetched as on any re-download). Every `metadata.info.json` rewrite appends a normalized diff to
- `metadata.history.json` (cap 200), shown on the video page. NEEDS the :3001 restart (runbook step 1);
- live proof after it: `full: true` on `teamrcn/dbnS-cBgStY` → a file in `saved-videos/`, and a
- history entry. Plan: [`full-fetch-forces-media.md`](full-fetch-forces-media.md).
-- **Slice M, `fetch_clip`, merged after the integration pass and ALREADY IN EFFECT:** `mcp/fetch-clip`
- @ `fa44984a` → `main` `64f26a71`. The MCP gains ONE tool that asks the live editor's
- `POST /api/media/fetch-window` for a cited moment's media (a window ≤ 15 min, or `full: true` for
- the whole recording into the saved-video store); the ask/sweep plans send media through it and
- never a hand-run yt-dlp. Live-proved 2026-09-26 evening against :3001 (YouTube window fetched then
- cached; Rumble embed id → slug dir; full recording fetched then cached); `archilyzer` re-registered
- with `ARCHILYZER_EDITOR_URL` + `WORKER_TOKEN`. Nothing to restart. The `/ask` fresh-session proof
- is DONE too (19:15Z, a Kirsche clip through `fetch_clip` with `source: remote:…anilyzer…`, 47 s). Two editor-side lows found by the proof (record, "Slice M — fetch_clip, merged and
- proved live"): full mode is a silent no-op on a captions-only channel whose video already has a
- transcript; full mode rewrites `metadata.info.json`. Plan: [`mcp-fetch-clip.md`](mcp-fetch-clip.md).
-- **The merges**, in the planned order: S4 `dcb04f61` (`brand/media` @ `333d2826`) → L2 `41ddc382`
- (`r10/runner-lows` @ `14e96739`) → L1 `5c0a6ef9` (`r10/hub-lows` @ `b6b47ec1`). The code merged
- clean; the conflicts were `plans/release-10.md` (the record sections, all kept) and one
- `editor/CHANGELOG.md` `[Unreleased]` join (S4's bullet and L2's four in one section above
- `[0.9.0]`).
-- **Integration tip:** `brand/found-line` = `main` `4ac32a2e` + the integration `plans:` commits
- (FACTS `9e3047e3`, then this STATE and the record). `4ac32a2e` is `5c0a6ef9` plus the plans-only
- `plans/mcp-fetch-clip.md`, committed to `main` during the pass; the integration commits were
- rebased onto it. No code changed at integration. The parent fast-forwards `main` to the tip, and
- the runbook's `FINAL` is that tip.
-- **What is in it:**
- - **S4, Archilyzer Media:** `common/lib/brandMedia.ts` (the lockup with its letters as glyph
- outlines); `common/bin/brand-media.ts` (the YouTube assets, already generated in
- `~/reports/archilyzer-media/brand/`, with `INDEX.html` there; upload any time); umtool
- report-to-video's opt-in `render.brand: "archilyzer-media"` with vendored OFL fonts (a manifest
- without it renders byte-identical, 334 files checked); and the brand choice in umtool's
- new-project form.
- - **L1, hub:** subs 404 = an empty manifest, one retry, never fails an archive; `/ask` honours
- the scope chips (none in scope: disabled + one line); the official instances in the homepage's
- order and colours; the playwright config and the compose scripts never write through
- `export/public` links (`common/bin/_publicFile.ts`; the FACTS workarounds are retired).
- - **L2, runner:** YouTube's "try again later" soft block backs off (batch, runner, scan, a
- prefetch early exit; the availability check stops); `verifyBeforeClean` never judges an
- unprobed suspect; the boot pass waits at most 60 s for the storage pass; `/jobs` shows
- `cancelReason`; the safeRevalidate warning is counted.
-- **Gates on the merged tree** (`5c0a6ef9`; every number in the record):
- - tsc clean;
- - common 1,954, editor unit 85, `test:scripts` 173 + 1 skip (the report-to-video tests
- included), mcp 219;
- - editor, export site + hub, homepage and umtool builds ok, the icon checks green;
- - e2e: export 204, `e2e:hub` 24, `e2e:2origin` 3 (the `export/public` links left in place: the
- primary's `export/public` and a `sw.js` sentinel byte-identical throughout), homepage 27;
- - umtool 175 + 2 failed + 45 skipped (the known order-dependent `mix.spec` pair; alone 6/6);
- - editor full 634 + 6 failed + 12 skipped in 54.6 min, under the live editor's load. All six are
- flakes (fixture EEXIST, the pulse timing tripwire, two sync-deep stamp races, a 7 s task timer,
- the diarization snapshot poll); alone ×3: 18/18. No integration regression.
-- **Next action: the operator re-cuts the editor + export `[Unreleased]` notes, then the rollout
- per `~/reports/release-10/RUNBOOK.html`** (`make-runbook.py` beside it; the scripts in
- `scripts/`). Both changelogs have a new `[Unreleased]` above the 0.9.0 cut. Export's (L1's three
- hub bullets) is public on every site's `/changelog` from the next site build; the editor's holds
- S4's and L2's. Cut on `/sites` → Release notes with "Commit changelog" unticked whenever the
- primary's tree is dirty (it refuses one; at the 0.9.0 cut an untracked
- `settings.json.pre-priority-*` made it so, and the tree was clean at this pass), then commit both
- files by hand.
- Then, per the runbook:
- 1. restart :3001 on the new `main` (one editor restart; md5 before / pre-restart / after-boot;
- smoke);
- 2. optionally, rebuild and restart umtool on :3050 with `r10-umtool.sh`, for the form's brand
- choice;
- 3. set each site's accent and wordmark lead;
- 4. preview Anilyzer;
- 5. deploy the five sites by name, then the hub, then the homepage.
-- **Jeralyzer already serves the brand, in Signal.** A build-deploy on the live editor built
- Jeralyzer from `main` @ `386ac995` and deployed it to production (job `01M3F36N7SCKGC5JV27EBDFYPN`,
- 2026-09-26 10:51–11:06, no agent recorded). That tree was the brand plus the 0.9.0 notes, before
- S4/L1/L2. Its accent is unset, so it wears Signal until the runbook's step 4 (every site by name) rebuilds
- it in Brass.
- The same build left the primary's `export/public` as a Jeralyzer site compose (no hub `sw.js`,
- `hub-sites.json` or `hub-summary.json`).
-- **umtool is no longer untouched.** Its report-to-video scripts changed on disk, and the live :3050
- already spawns them (it still runs release 8's build, `a9YAe_dwhuM6DiCPzIwMD`). That is safe: a
- render that does not opt in is byte-identical. Its app changed only for the new-project form's
- brand choice, which appears after the optional `r10-umtool.sh` rebuild and restart.
-- **Copy rulings still owed by the operator:** *(RULED 2026-09-28: all four hub copy lines ship as
- written, each now carrying its link in the line (the tagged template `copy` with `link()` replaced the
- [bracket] regex);
- `/ask` shows the scope line. Release 11 follow-up O1c, merged `e1ef1923`.)*
- - `NO_ARCHIVES_IN_SCOPE` (`export/app/ask/hubScopeCopy.ts`). The draft is "No archives selected.
- Choose some on the [hub's front page] to ask.", with the bracketed words a link to `/`. It
- ships as drafted unless changed.
- - Whether `/ask` shows a "Searching N of M archives" scope line.
-- **New lows (not started):** *(ALL CLOSED 2026-09-28 by release 11, merged to `main` and not yet
- rolled out: the icon by O1 — `normalizeSocialSvg` themes a single-colour icon, applied at the next
- settings write; slice N's forced download and `cookies-mode.spec:241` by O3; `/ask` on a
- zero-archive hub and the chip's missing live chat by O1 (DRAFT copy); `resolveMaybeMissingState` by
- O3; umtool's rail/ledger/chart font and the bold IBM Plex Mono by O5. See `release-11.md`.)*
- - the operator's x.com social icon is invisible on the light footer (1.11:1): its `<path>` carries
- `fill="white"` and `normalizeSocialSvg` defaults only the root fill — fix by re-pasting the icon
- without the path fill in `settings.json` (found by slice O's screenshots);
- - slice N: a forced source download that fails on a video with a transcript marks the download
- failed, the fetch job still ends `done` with no file, and a `source-media.*.part` can linger;
- - `cookies-mode.spec.ts:241` intermittent under load: `NeedsCookiesList` returns null when its bucket
- empties and unmounts the retry's run log (`DownloadStage.tsx:442`) — keep the card mounted while a
- run lives, as `SourceVideoSection` does;
- - `/ask` waits forever ("Loading transcripts…") on a hub with zero archives;
- - the chip doesn't show a member's missing live chat (it needs a subs-only Retry);
- - `resolveMaybeMissingState` reads an `error` probe newer than the scan as `available`
- (display only: the published presence badge);
- - umtool's rail, ledger and chart text stays Fira Sans under the brand;
- - no bold IBM Plex Mono is vendored (the HyperFrames band's `fontBold`).
-- **Worktrees that can go:** `brand-mark`, `brand-themes`, `brand-media`, `r10-hub-lows` and
- `r10-runner-lows` are all merged. `brand-found-line` can go once `main` carries its tip. Removing
- any of them re-sorts the port blocks (`diet-series` moves up).
-
-**Accent swap and mark contrast rolled out (2026-09-27, 15:21):**
-- **Accent swap.** On the operator's word ("matches the subjects' branding") **hasanalyzer = violet** and **bonnellyzer = blue**, set through the site form; the md5 check shows only those two `site.json` files changed. The mapping is now:
-
- | Site | Accent |
- |---|---|
- | jeralyzer | brass |
- | hasanalyzer | violet |
- | anilyzer | sakura |
- | bonnellyzer | blue |
- | rekietalyzer | green |
- | jasolyzer | vermilion |
-
-- **Slice MC** (mark contrast) merged `7f64e507`. The mark's dim lines now reach 3:1 against their tile: child `#6b5d47`, Archilyzer `#586977`, and every lit value stays at least 2:1 above them. The rules are pinned in `common/lib/brand.ts`. The chart passes the validator for adjacent pairs in both orders.
-- **Release 0.9.3** cut: editor `cca3b7df`, export `5267f454`.
-- **Deployed** by `r10-sites.sh` plus `r10-home.sh` from `5267f454`:
- - the five sites (jeralyzer `f6ec1484`, anilyzer `dc65b57b`, and so on);
- - the hub `9c5e0b0c`;
- - the homepage `716ab0d6`.
-- **Verified live:** each site's `data-accent`, the header dim `#6b5d47`, the icons' dims, the parent `#586977` on the hub and homepage, and the homepage stripes and summary on the swapped accents.
-- **Owed by the operator:**
- - the regenerated YouTube picture, watermark and banner need re-uploading (`~/reports/archilyzer-media/brand/`);
- - the editor's own favicon updates at its next restart.
-- **Open, the operator's call:** on the dark base the ink tile still merges into the ink page. A hairline ring or a lighter tile on dark would fix it.
-
-**Release 10 rolled out (2026-09-27, 02:28):**
-- **Accents and wordmark leads** were set through the live editor's site form; the md5 check shows exactly the six `site.json` files changed:
-
- | Site | Accent | Lead |
- |---|---|---|
- | jeralyzer | brass | Jer |
- | hasanalyzer | blue | Hasan |
- | anilyzer | sakura | Ani |
- | bonnellyzer | violet | Bonnell |
- | rekietalyzer | green | Rekieta |
- | jasolyzer | vermilion | Jaso |
-
- Rekietalyzer moved from vermilion to green because no five-accent set passes the dataviz validator on all pairs; see `release-10.md`, "Slice AC".
-- **Slice AC** (accent colours) merged at `edf8dabc`, then **0.9.2** was cut (editor `9bb0a012`, export `d9edb240`).
-- **Deploys:** `r10-sites.sh` ran from `d9edb240` (01:55–02:27), then `r10-home.sh`:
- - jeralyzer `52254b28`, anilyzer `8417624e`, bonnellyzer `db2b1820`, hasanalyzer `ca2d5073`, rekietalyzer: see the log;
- - the hub `92aad41e`, whose `hub-summary.json` covers 5 instances;
- - the homepage `1eb1f60d`.
-- **Verified live:** every site has its `data-accent` and split wordmark, the hint is `text-brand`, and no page links to Ko-fi. The homepage cards use `var(--swatch-<id>)`, the chart uses `--chart-1..5`, and both summaries carry `accentId`.
-- **The editor was not restarted, on the operator's word.** :3001 has run a post-brand build since 2026-09-26 21:47 (`BUILD_ID` `S07zTu3MKTjHJa9eDM1GF`, main ≈ `9801a034`).
-- **Skipped:** the runbook's Anilyzer preview / phone check, on the operator's choice to deploy all five directly.
-- **Still optional:** `r10-umtool.sh`.
-- **New lows:** *(both CLOSED 2026-09-28 by release 11 O2, not yet rolled out: `--chart-6`, a
- validated rust in Vermilion's family; a custom hex fitted per base through `perBaseColor`.)*
- - A sixth published site's chart colour would nearly duplicate Anilyzer's magenta. Fix this before Jasolyzer gets a `siteUrl`.
- - A custom hex is not fitted per base on the homepage cards.
-
-**Deployed 2026-09-26 23:58 (release 10, partial rollout):** Ko-fi dropped for now (merged
-`a54014e5`); release **0.9.1** cut (editor `98d4bf6f`, export `bc1b0a03`, `archilyzer release cut all
-next --commit`); the hub (ops job `01M3GF6SKBJFGH4R7YY3TRMBZE`, deploy `0cda9466`) and the homepage
-(`r10-home.sh`, deploy `665b9faf`) redeployed from `bc1b0a03`. Both are verified live: no Ko-fi link,
-`/kofi-symbol.svg` 404, `data-accent="signal"`, and the homepage `/changelog` shows 0.9.1.
-**Still owed** (runbook, in order):
-- the :3001 editor restart;
-- each site's accent + wordmark lead, set in the site form;
-- the Anilyzer preview;
-- the five sites. Jeralyzer is live on the brand in Signal until then.
-
-**Live on :3001 — unchanged since 2026-09-25, 19:40:** `0213f6c8` (release 9 slice F + hub C1),
-`BUILD_ID` `P0VMdKX7gbdsaiS5GvorF`; umtool's build untouched (`a9YAe_dwhuM6DiCPzIwMD`; its
-report-to-video scripts on disk are `main`'s, above). Live sites:
-- https://archilyzer-hub.pages.dev — C1 + C1b + C2 (archilyzer theme, "Official Instances" with
- the homepage's figures, scope chips, per-archive state, "N of M archives answered", archive named
- on every card, bare Ko-fi footer link), deploy `6ef7f472` (20:50);
-- https://archilyzer.pages.dev — **release 10's build** (the brand, in Signal) from `main`
- `555bc454`, deploy `857e0092` (2026-09-26 17:19). It was deployed early, on the operator's word, by
- the runbook's own `r10-home.sh`, so **the homepage half of the runbook's step 5 is done**. Its
- `/changelog` shows export's `[Unreleased]` until the re-cut and a redeploy. There is no UI deploy
- yet: [`homepage-deploy-from-ui.md`](homepage-deploy-from-ui.md);
-- https://jeralyzer.pages.dev — **the brand, in Signal**, deploy `35593886` (2026-09-26 11:06, above);
-- the other four official sites at release 8's slices Z + E (17:45 / 18:10 deploys); they carry no
- Ko-fi, and with Ko-fi dropped (`export/drop-kofi`) release 10's rebuild will not add it.
-
-**The release 10 candidates of 2026-09-25 evening are all done** (L1 and L2 above). Next after
-release 10's rollout: the homepage deploy from `/sites` ([`homepage-deploy-from-ui.md`](homepage-deploy-from-ui.md),
-one small slice), Phase 4 slice 3 (`plans/one-core.md`), the LM chat-only tier config, the
-`Dockerfile.build` image refresh, and the new lows above.
-
-**The 2026-09-25 evening plan is complete** (steps A–C: release 9 F + C1 live on :3001; C1b, C2, C3
-on the hub and the homepage). The operator's rulings (C2's federated search as proposed; a bare Ko-fi
-link on the homepage and hub footers only — superseded 2026-09-26 by slice O, the mark on every site,
-and then **Ko-fi dropped for now** (2026-09-26, `export/drop-kofi`: no Ko-fi link or asset on any
-site, the hub or the homepage); the Paramount Tactical filter clear) are recorded in
-`release-9.md`. Paramount Tactical downloads in full at lane pace since the operator cleared its
-`Quartering` include filter (19:35). See the
-[release-9 rollout record](release-9.md#rollout-2026-09-25-evening--0213f6c8-live-on-3001-third-restart-of-the-day).
-
-See the
-[release-8 rollout record](release-8.md#rollout-2026-09-25-late-afternoon--0e72ef73-live-on-3001-second-restart-of-the-day).
-
-**Last updated:** 2026-09-25 (late afternoon). **Release 8 is live, the day's second restart.**
-- Release 8 (`bb3dbb4c` → `0e72ef73`) has two slices, each Opus-reviewed: SHIP AFTER FIXES, then
- SHIP.
- - **V, video titles** (`one-core/r8-video-titles` → `faa92c51`), the operator's 13:40 ask. The
- channel video list shows and searches titles: index → scan store → `metadata.info.json`,
- memoized per channel by the `data/` mtime after the review measured Rumble lists at 5 s per
- render. The video page shows scan-store metadata for an undownloaded video.
- - **S, one shared auto-queue state** (`one-core/r8-state-share` → `0e72ef73`). This is the root
- cause of the 13:33 `state.json` revert, which recurred at ~14:18: four lanes booted
- concurrently and each held a private copy. The in-flight read is now cached, and a manual
- Sync/scan 429 cooldown writes through the live object.
- - Record: [`release-8.md`](release-8.md).
-- Gate on `0e72ef73`: tsc 0, common 1,810, editor unit 75, scripts 161 + 1 skip, `next build`
- ok, the union of both slices' specs 86/86. No numbers changed.
-- Rollout. md5 80 → 80, with one explained difference: `paramount-tactical/config.json`, the
- operator's `downloadFilter.include: "Quartering"` plus a `lastFullDownloadAt` stamp. The
- deferral and `fails: 13` survived the restart. Smoke `SMOKE_FAIL=1` with both flags explained:
- a moving jobs list, and a correct deferral where the old check expected `[]`. Titles are proved
- live on `/channels/paramount-tactical/videos`.
-- **Second-restart proof:** no `legal-mindset` re-scan on either of today's boots.
-- **Paramount Tactical.** The boot-dispatched metadata scan ran at about 10/min with 0 429s. It
- was cancelled at 377/1,382 on the operator's ask, and its store kept the 377. download-missing
- then settled **376** non-matching videos by the filter with no request and is downloading the
- rest. `pnpm ops keep-videos` ran live for the first time: 1 match (`NV1QqS9NOiU`), marked.
-- **The owed `teamrcn` sync ran** and moved exactly `lastSyncedAt` + `lastFullSweepAt`, but it
- reads `failed`: `Invariant: static generation store missing in revalidatePath`. A QUEUED job's
- own `revalidatePath` runs outside any request.
-- Operator questions answered today: the 429s are not concurrent downloads, and
- `downloadFilter.include` has a UI (release 7).
-
-**Open:**
-- **the queued-job `revalidatePath` fix**, small. A `safeRevalidate` in the editor, or drop the
- job-body revalidations for `requestChannelSnapshot`. Until then, an ops job that queues reads
- `failed` after doing its work. The running download-missing `01M3CY7FHQNMTA376HA724BKK7` is
- expected to end that way;
-- **the keep-videos re-run** after download-missing finishes (dry run first, `match:
- "TheQuartering|Quartering"`). Optionally, the rest of the Paramount Tactical scan (~1,000) for
- list titles;
-- the `/jobs` stall label misreads a slow scan (`STUCK · POSSIBLY-STALLED` at 10/min); stale
- `queued` metas after a restart; the smoke's deferred check should become "well-formed";
-- S's optional merge nit (merge `until` and `fails` separately); V's memo nits and L3;
-- the evening pacing watch: `grep -h 'deferred 6h' transcripts/.jobs/*.log`;
-- the 410 re-read (release 7 step 11), not observed;
-- candidate: YouTube `--sleep-requests` in `common/ytdlp/platformArgs.mjs`, not applied;
-- worktrees to remove: `one-core-r8-{video-titles,state-share}`, `one-core-r7-{pacing,cli,keep}`,
- `one-core-r5-{exports,rumble}`, `one-core-r6-followups`, `one-core-phase-4-s1`;
-- `thequartering-X`'s transcripts manifest goes live at the next jeralyzer build + deploy.
-
-**Next:** the `revalidatePath` fix (a small slice), then Phase 4 slice 3: config + docs,
-`doctor`, `run`, `mcp`, and `PUBLISH.md`.
-
-**Last updated:** 2026-09-25 (afternoon). **Release 7 is live, with release 6 riding along.**
-- Release 7 (`0032ed8a` → `bb3dbb4c`), three slices, each Opus-reviewed: **Y** pacing
- (`one-core/r7-pacing` → `2497d20b`): a rate-limited video is deferred 6 h (`videoDeferrals`,
- persisted beside `platformBackoff`) so the lane moves on after the cooldown; an identical
- metadata-scan error refreshes its `at` once a cooldown old. **C** the CLI (`one-core/r7-cli` →
- `3049be43`): `common/bin/archilyzer.ts`, named publish entry points, export's `build` = the CLI
- (`build:nodata` / `prebuild` gone), docker scripts on the CLI, hub build + deploy (`/sites`,
- `pnpm ops`, CLI), `build|deploy homepage`, the posts-only 404 fixed in the composer. **K**
- `pnpm ops keep-videos` (`one-core/r7-keep` → `ac2c4aee`), the operator's mid-rollout ask. Plus
- `211d4666`, a test-only guard (below). Record: [`release-7.md`](release-7.md).
-- Final suites on `3049be43`: editor 626 passed / 5 failed / 12 skipped (53.1 min, machine in
- swap) — four load timeouts and one REAL isolation bug: `ops-api.spec.ts` deploy-hub started a
- deploy job of the hub a 2origin run had left in `export/out` (nothing reached Cloudflare), fixed
- `211d4666`; the five specs on `bb3dbb4c`: 55/55. Export 192/192, hub 8/8, 2origin 3/3.
-- Rollout: install no-op; numbers 1,353 paths / 3,859 lines (corpus growth); md5 80 → 80
- identical across the restart; smoke `SMOKE_FAIL=0`; a Rekietalyzer `skipData` build through
- `pnpm ops` (27 s, no `prebuild`, no data phase). The old server had already run C's new
- `build site` script live at 13:00 (a Rekietalyzer build-deploy, 81 files).
-- **Pacing proved live within 10 minutes of boot:** the old build had looped 12× on
- `paramount-tactical-videos/_60iFE_FBPQ`; the new runner's first 429 logged `… (attempt 13).
- _60iFE_FBPQ deferred 6h; next video after cooldown.`
-- Operator questions answered: the 429s are NOT concurrent downloads (one serialized
- `platform:youtube` queue, 0 overlaps in 36 h; all 26 are subtitle fetches, multiplied by the old
- re-pick loop); `downloadFilter.include` has a UI (Configure form).
-
-**Open:**
-- the owed `teamrcn` sync (step 10) and the Paramount Tactical metadata scan, queued behind the
- youtube cooldown; then `pnpm ops keep-videos {"slug":"paramount-tactical","match":"TheQuartering"}`
- (dry run first) — the channel was renamed from `paramount-tactical-videos` at ~13:29;
-- the evening watch: `grep -h 'deferred 6h' transcripts/.jobs/*.log`; the scan-error refresh
- proof needs a second restart within 24 h;
-- the 410 re-read (step 11), not observed today;
-- candidate: YouTube `--sleep-requests` in `common/ytdlp/platformArgs.mjs` — not applied;
-- worktrees to remove (`one-core-r7-{pacing,cli,keep}`, `one-core-r5-*`, `one-core-r6-followups`,
- `one-core-phase-4-s1`);
-- `thequartering-X`'s transcripts manifest goes live at the next jeralyzer build + deploy.
-
-**Next:** Phase 4 slice 3 (config + docs, `doctor`, `run`, `mcp`; `PUBLISH.md` absorbing
-`DEPLOY_DOCKER.md` + `DEPLOY_CLOUDFLARE.md`, and the two stale `archilyzer.pages.dev` hub hints C
-left: `SettingsForm.tsx:48`, the `homepage.ts:31` comment).
-
-**Last updated:** 2026-09-25 (early morning). **Release 5 is live; release 6 is merged.**
-- Release 5 (`f4da04a9` → `93dcb532`): slice R (`one-core/r5-rumble` → `3adaea9b`): one yt-dlp arg
- builder with a platform table (Rumble: `--impersonate chrome --sleep-requests 1` on every spawn), a
- 429 mid-sweep is "incomplete" (paged walk + platform cooldown, never a listing, never a stamp), a
- bare 403 backs the platform off. Slice X (`one-core/r5-exports` → `93dcb532`): `transcriptDownloads`
- (absent = on) on `site.json` AND `homepage.json`, gating the three per-video export controls on
- the export site; the site and hub forms carry the checkbox. Final suites on `93dcb532`: editor
- 628/628 (no flake), export 192/192, hub 8/8. Record: [`release-5.md`](release-5.md).
-- Rollout: ONE restart; smoke green; boot rewrote nothing; proof sync of `rekietalaw-rumble` and
- the first complete `the-quartering-rumble` sweep in 44 days (8,045 listed, was 7,866, paced past
- page 300 with no 429; the job finished 01:50 with 97 videos archived, 0 errors, both stamps set;
- its 4 maybe-missing checks are upstream 410s that read `error` until the follow-ups' 410→deleted
- fix is rolled out); exports off on the five published sites (form → build-index → build-deploy
- each, verified at the public URLs; Anilyzer's owed production deploy rode along, now at spec 4).
-- Release 6 (overnight, operator-approved): follow-ups (410 → deleted, umtool gets the platform args
- through ONE table in `common/ytdlp/platformArgs.mjs`, atomic remote-transcript write, stale comment,
- measure-nav routes) and Phase 4 slice 1 (`buildDeployCore.ts` → `common/publish/build.ts`, aws-sdk
- deps to common; the move only — entry points, docker scripts and build:hub wait for the CLI slice).
- Record: [`release-6.md`](release-6.md). 188 orphan `*.tmp-*` files deleted (filtered).
-- Found and filed, not fixed: [`youtube-lane-pacing.md`](youtube-lane-pacing.md) — the evening's
- three YouTube cooldowns were ONE Short retried 12× from the head of the queue; the fix is a 6-hour
- per-video quarantine (small slice, recommended next), plus `metadataScanStore.ts:249-252` (scan
- error timestamp never refreshes → 142 members-only videos re-scanned every runner start).
-
-**Next:** Phase 4 slice 2 (`common/bin/archilyzer.ts` + the rest of spec item 1), the pacing slice,
-then the release-6 rollout (one restart) with the pacing fix riding along if it is ready.
-
-**Last updated:** 2026-09-24 (evening). **Release 4 is on `main` @ `e172749b`, and one-core
-Phase 3 is COMPLETE. Phase 4 is next.** The prelude was plans only: `4130aca1` (the rollout
-record) and `bbad0977` (the owed sync sweep). The three plan files `77f63356`, `42caf3cc` and
-`cc89abfa` were filed during the release. Three worktrees were cut off `4130aca1` and merged
-in this order:
-- `one-core/phase-3-p` → `77a32de2`;
-- `one-core/phase-3-w` → `ddad13f4`, which merged P and re-gated as `44dd843f`;
-- `one-core/phase-3-s3b` → `e172749b`.
-
-Release record:
-[`one-core-phase-3.md`](one-core-phase-3.md#release-2026-09-24-evening--rollout-prelude-slice-p-slice-w-slice-3b),
-with the P, W and 3b "as shipped" sections above it. What is still open is in
-[`one-core-phase-3.md`](one-core-phase-3.md#next--phase-4). Anchors are in
-[`FACTS.md`](FACTS.md#one-core-phase-3-release-4--slices-p-w-3b-verified-2026-09-24-main--e172749b).
-Previous: release 3, slices 3a and 4b, on `main` @ `ef88ac4d`
-([record](one-core-phase-3.md#release-2026-09-24--rollout-slice-3a-slice-4b)), live on :3001
-as `9ab10d77`.
-
-- **Slice P: /channels rack polish.**
- - One layer ladder (`channels/components/rackLayout.ts`: popover > thead > group header >
- identity, plus the deck). Channel rows no longer paint over a group's station buttons.
- - Four audit fixes: pinned group controls, an Advanced panel that scrolls into view, the
- section rule as an inset shadow, and the region as `isolate`.
- - The Transcribe station counts `downloadedNoTranscript` + `downloadedAutoSubsOnly`, minus
- exclusions, for every handling, and queues exactly those ids as two bucket jobs.
- - No number moved (`phase3-view-numbers.ts`, diff empty).
-- **Slice W: one write idiom.**
- - `writeFileAtomic` / `copyFileAtomic` sit under `writeJsonAtomic`, with one per-path chain
- and one unique temp name.
- - 26 sites were folded (19 JSON, 7 text/binary), and both per-module-copy write counters
- are deleted. A failed write no longer leaves a temp file behind.
- - No byte moved (`phase3-writers-numbers.ts`: 315 samples equal the old idiom's bytes, diff
- empty).
-- **Slice 3b: the video page's chore cards, one module each.**
- - `VideoPanel.tsx` went from 1,839 to 455 lines, the assembly only. It now draws 15 modules
- under `videos/[id]/components/cards/`, pinned by `lib/videoChoreCards.ts` and its test.
- - The stage half needed nothing: the flow work had already made `computeStageStatuses` /
- `computeChannelFlow` the one fold.
- - Labels are identical (126 entries, same md5).
-
-**Gates.**
-- On `e172749b`, re-run for the record: editor unit 72/72.
-- On 3b's merged tip `2e322e37`, whose tree equals `e172749b`'s: tsc clean, common 1738,
- scripts 156 + 1 skip, both builds green, the 19 video-page specs 108/108.
-- On W's merged tip `44dd843f`: mcp 219, the 20 writer specs 140/140.
-
-Full e2e on `e172749b`: editor **624 passed + 1 load flake (`lane-runner.spec.ts:361`, rerun 3× green)**; export **188/188** (worktree
-`one-core-phase-3-s3b` detached at `e172749b`, ports 3311/3310, logs
-`final-e2e-r4-editor.log` / `final-e2e-r4-export.log`)
-
-**Next.**
-1. **The exports-off release**, [`site-exports-off.md`](site-exports-off.md): a per-site
- option, off on the operator's five published sites, which need a rebuild and a deploy.
-2. **The Rumble slice**, [`rumble-sweep-pacing.md`](rumble-sweep-pacing.md): step 0 is
- `--impersonate chrome` through a per-platform args table (the embed endpoint 403s every
- download, upstream #17496); step 2 is pacing the full sweep. The operator applied step 1
- on 2026-09-24.
-3. **One-core Phase 4** (CLI, entry points, config, docs). `buildDeployCore.ts` imports
- nothing from `editor/**`. `PUBLISH.md` does not exist yet.
-
-The release-4 rollout and the owed one-sync sweep ride in the prelude of whichever release
-comes next.
-
-**Still owed (operator):**
-- the Anilyzer **production** deploy (the preview is up, see below);
-- the other five sites to corpus spec 4;
-- the LM chat-only tier (shipped, not configured);
-- the **188 orphan temp files** in `transcripts/`, listed by `find transcripts -name '*.tmp-*'`.
- 175 of them are `.auto-queue/state.json.tmp-*` from the 2026-09-11 full-disk day. They are
- safe to delete while nothing runs.
-
-**Owed (code):**
-- `transcribeOne.ts:173` writes the remote transcript with no temp. It is the one real
- `writeFileAtomic` candidate left.
-- The export page writers `buildIndex.ts:971` / `buildStats.ts:220` need restructuring,
- which is out of W's scope.
-- The deferred follow-ups in the phase-3 "Next" section.
-
-**Previously:** 2026-09-22 — **the release *curated-tags follow-ups + debts sweep* is on
-`main` @ `766e0873`.** Base `4ac8ceda`; three branches merged in the order
-`1a011d96` alone → `tags/rules-and-ops` (`9837f066`) → `export/tags-followups` (`cb254919`)
-→ `editor/debts` (`766e0873`). Anchors for every seam are in
-[`FACTS.md`](FACTS.md#the-2026-09-22-release--curated-tags-follow-ups--debts-sweep-main--766e0873).
-
-**Final full-suite run on 766e0873 (docs commits after it change no code): editor 600/600 (30.0 m), export 188/188, e2e:2origin 3/3 — all detached in the release worktrees; live contracts (jeralyzer corpus.json / llms.txt, anilyzer tags.json 96/282/56) unchanged**
-
-### Curated per-video tags — shipped, reviewed, deployed to Anilyzer
-
-The plan is [`curated-tags.md`](curated-tags.md); it is now a shipped design, not work in
-flight. `transcripts/tags.json` is the authoritative vocabulary AND every assignment, written
-through the ONE path `applyTagAssignments` (`common/lib/curatedTagsStore.ts`) by all three
-writers (editor UI, `pnpm ops`, umtool); the MCP gained a read-only `list_tags` and a `tags`
-filter and no write tool. The record field is **`curatedTags`**, never `tags`. S1.1 froze the
-model (`d8c9d252`), then S1 ‖ S2 ‖ S3; review fixes `86cbb616`, `468f3a31`; the two
-re-apply bugs `edf0e204` (it held the event loop for minutes) and `8db8a3be` (the
-assignment-only pass destructured a bare key).
-
-**Rollout, 2026-09-21 → 09-22.** Seeded through `pnpm ops tags --file` (never by hand — the
-file carries provenance). First derivation: examined 77,224, re-derived 831 in 623 s; 103
-transcript pages rewritten, 906 unchanged. **All three seed patterns were then wrong against
-the real corpus and were corrected** — the full before/after is in `curated-tags.md`'s rollout
-log, and the shape of the error is worth carrying: a bare `elfpire` matched a friends-list
-boilerplate on MommaOcco (200 false hits), `@PapaElfpire` in chat, and "Jason Angelfire" /
-"channelfireball" / "RekietaLawLive" in ASR. **ASR never spells "Elfpire"**, so the caption
-rule is a misspelling alternation with `\b` on both ends.
-
-**Anilyzer is live with Eva tags** (`4ac8ceda`), reviewed, with 21 suppressions. Two bugs the
-live data found were fixed there. Every other site stays at corpus spec 3 until the operator
-chooses to rebuild it — a pre-spec-4 site serves no `/tags.json`, which the MCP reports as
-empty-with-a-warning rather than as a silent miss.
-
-**And a rule can exclude channels** (`1a011d96`): `channelsExclude` is applied AFTER
-`channels` and **the exclusion wins**. It is part of `hashCuratedRules`, which is the trap —
-see the post-release block below (all done but the deploy).
-
-### `storage/debts-1` — merged 2026-09-21 (`7589c50c` → `e109b6ac`, fast-forward)
-
-The three things S5/S6 named and left out; two of them are now done and the plan file says so.
-`assertRelocationRootPresent` (`1fccabac`) — a move can no longer `mkdir` its destination
-under an absent mount, checked from the preview AND immediately before each copy phase, on the
-channel mover and the saved-video mover both. A `/review` section for auto-paused channels
-(`bbc1899e`) — `common/views/review.ts` `autoPausedRows`, and a channel a PERSON paused is not
-a row. **Only the per-unit reachability re-check in the two lane runners is still open**, still
-deliberately deferred to the five-minute storage watch.
-Around them: `clips/` counted in `totalMediaBytes` (`7589c50c`) so the platter's bytes stop
-lying, clip-window eviction BY AGE (`4416bb58`, `e4f9fa1f`), the relocate space check freed
-from how much RAM is free (`1271e21f`), a fan-out that says which jobs it started
-(`94b24fdf`), the full-source path (`fab61a49`), and the umtool suite SKIPPING rather than
-going red without the song data (`1ab07623` → `007c12e5`).
-Anchors: [`FACTS.md`](FACTS.md#storage-debts-verified-2026-09-21-branch-storagedebts-1).
-
-### `feat/filtered-channel-followups` — merged 2026-09-21 (`337477d5`)
-
-Nine commits, `f142f7d9` → `c442cb60`, behind the per-channel download filter. A rejection
-takes its own prefetch directory with it; the metadata scan is DISPATCHED by the download
-lane, not waited for, and goes in the pick log like any other unit; a filtered-out livestream
-gets a third answer rather than settling forever; `videoHasAnyArtifact` turned out to be
-`isVideoDownloaded` under a second name. Review (`5c02e7da`) found the discard was a
-deny-list and four things it let through.
-Anchors: [`FACTS.md`](FACTS.md#filtered-channel-follow-ups-verified-2026-09-21-branch-featfiltered-channel-followups).
-
-### The release itself — what each branch landed
-
-**A · `tags/rules-and-ops` → `9837f066`.** `1a011d96` (merged alone, first) `channelsExclude`.
-`dcd065e7` a site layer carries NO rules — dropped on read AND on write, so a hand-written
-site rule is removed from the file on the next save. `d653b504` `--wait` survives a failed
-poll: the log route is POLLED (`{content, nextOffset, status, …}`), a poll failure is not a
-job failure, there is an `/api/jobs/active` fallback, probe failures are bounded, a
-`--wait-timeout`, and `followJob` is importable with injected `fetch`/`sleep`. `52f5c64c`
-both build routes take `siteId` OR `siteIds` via `reqSiteIds`, and `build-deploy` fans out
-returning `{ok, jobs, skipped, jobId?}`. `6214eeb9` `wt rm` finds the directory `wt add` made
-(`worktreeDirFor`, one function for both verbs). `729f64ef` a measure-nav comment. `bad9ea43`
-the four-lane status poll reads the corpus ONCE. `d0df901b` the `typeof process` guard in
-`contract.ts`. `94750a1b` review fixes — a bad site id is 400 *before* any job, and a
-recovered poll answering `queued`/`running` is not an outcome.
-
-**B · `export/tags-followups` → `cb254919`.** `e942dc7f` tag chip groups fold (`<details>`
-per group, local state, `"n selected"` on the summary). `ce5379f2` `SearchResults`' leaf
-sections read `SCOPE_LABELS` — one scope-label table, no second copy anywhere.
-`f40c4257` + `7a38b60b` hub `/ask` prerenders, and the fix is that `AskHub` needs the WHOLE
-provider stack (`PlayerProvider` → `MultiSiteDataProvider` → `SearchSessionProvider`), never
-an opt-out; `2e13c0ab` its spec, `export/e2e-hub/ask.spec.ts`. `befd2fbf` MCP: a tag filter
-takes posts OUT of the search, reported in `postsScanned.skippedForTagFilter` and in a footer
-sentence, because posts carry no curated tags and the export UI does the same.
-
-**C · `editor/debts` → `766e0873`.** `94c965d7` + `674c976b` the channel Storage panel evicts
-that channel's clip windows (`ClipWindowsCard` with a `slug`, disabled by the panel's
-`blockedReason`, by-age caveat on screen). `d23883f7` rename and delete refuse with
-`channelMediaBusyReason`. `1b3d4837` Sync all skips a channel whose media drive is not
-mounted. `1cace934` worker auth's 503-when-unset asserted. `1e0b10a9` `.gitignore`
-`/editor/content`. **S0-pause landed** — `98fa001a` the four legacy pause fields and their
-migration deleted (`migrateHeldToLanes` gone), `27b6be0f` `held` defaults per lane via
-`defaultHeldFor` (backfill `true`, the others `false`), `ad20ffd8` the editor readers gone,
-`7d2e889a` `settingsWrite.test.ts`. Review fixes `4d2fa0ca` + `70c2443a` (**every**
-`/api/test/*` route 404s unless `EDITOR_TEST_ROUTES=1`), `8ad4ea77` (the `held` default
-asserted through `sanitizeAutoQueue`), `67f17b30`, `307c9b81`.
-
-### Gates measured for this release
-
-`tsc --noEmit` clean in `common`, `editor`, `export`, `mcp`. Unit: common **1604** (was
-1592), mcp **219** (was 216), `pnpm run test:scripts` **151 passed + 1 deliberate LIVE skip**
-(was 138). Per-branch e2e: A `tags.spec.ts ops-api.spec.ts` **24/24**; B export **188/188**,
-hub **6/6**, `e2e:2origin` **3/3**; C 20 specs **184/184**.
-
-**`e2e:2origin` is GREEN for the first time since hub `/ask` existed.** The FACTS entry
-calling it known-red on the base is closed — a red run there is a regression now, not a
-known failure to skip past.
-
-### Housekeeping
-
-Worktrees `storage-locations-s0..s4` and `s0-pause` removed. Branches deleted:
-`storage/locations-s0..s4`, `storage/debts-1`, `feat/filtered-channel-followups`,
-`one-core/phase-1`, the seven `umtool/*`, `one-core/s0-pause`. **Kept:**
-`parked/download-filter-preview`, `p1-e2e`, `worktree-duplicates-page`, `diet-series`. The
-three release worktrees and branches (`tags/rules-and-ops`, `export/tags-followups`,
-`editor/debts`) are gone — checked 2026-09-23, neither `git worktree list` nor `git branch`
-shows them. Nothing unmerged was deleted.
-
-### Post-release operator steps — done 2026-09-22 evening except the deploy
-
-Run in the order the live editor forced (its pre-release sanitizer would have dropped
-`channelsExclude`, so the restart came first):
-
-1. **Rebuilt and restarted the editor and umtool on `472d5b59`** (`:3001`, `:3050`; both
- started with `pnpm run start -H 0.0.0.0` as before). Done.
-2. **Re-sent each Eva tag definition** via `pnpm ops tags --file`, built from the live defs in
- `transcripts/tags.json` (presentation fields intact) with `rules[].channels` empty and
- `channelsExclude: ["elfpire-eva", "elfpire-eva-x"]`. On disk: `channels` absent, the exclude
- present, all **48 assignments** untouched. Done.
-3. **`pnpm ops build-index --wait`** (job `01M36471VHTYX9V7DXYZY3R6B3`, 330 s): the log said
- `curated tags: rules 864eac5c (changed), examined 77224, re-derived 0`. Examined = the full walk
- the hash change forces; re-derived = records whose tags MOVED, and none did, because the corpus has
- 71 channels and the old 69-channel allow-list was already "everything but Eva's two". The exclude
- pays off when the next channel joins. Done.
-4. **`pnpm ops build-site --json '{"siteId":"anilyzer"}' --wait`** (job `01M364J54CA4ENG1SXQV865GM7`):
- composed into `export/public` and exported to `export/out`; `tags.json` counts **96 / 282 / 56**,
- byte-identical to live. No new false positive to suppress. Done — **built, not deployed**.
-
-**2026-09-23 — preview deployments shipped (`ef4a9f6d`, branch `deploy/preview`, 9 commits, Sonnet-reviewed):**
-`preview: "<branch>"` on the new `deploy-site` route (deploy-only of `export/out`, which now refuses a
-bundle built for another site), on `build-deploy`, on `pnpm ops`, and as a "Deploy preview" control on
-the site's Publish tab. Cloudflare Pages makes any non-production branch a Preview environment at
-`https://<branch>.<project>.pages.dev`. Anilyzer's release build is up at
-**https://tags-exclude.anilyzer.pages.dev** (deployment `2fafe052`, Environment = Preview); production
-is untouched (last production deploy still `4ac8ced`). Its data is byte-identical to production
-(96/282/56) — what differs is the export UI of this release (folding tag-chip groups, leaf-section
-labels). Editor restarted on `ef4a9f6d`; umtool unchanged. See `DEPLOY_CLOUDFLARE.md` "Preview deployments".
-
-**Still owed: the production deploy** — `pnpm ops build-deploy --json '{"siteId":"anilyzer"}' --wait`, then
-`curl https://anilyzer.pages.dev/tags.json | jq '.tags[].count'` and
-`list_tags {source:"remote:https://anilyzer.pages.dev"}`. The operator chose to hold it. Other sites
-stay at corpus spec 3 until the operator chooses.
-
-**Out of scope, decided:** hub tag federation. A tag filter works per site; the hub does not
-aggregate `/tags.json` across members.
-
-**Previously:** 2026-09-20 — **storage locations S5 + S6 shipped** on branch
-`storage/locations-s5-s6` (worktree `/home/user/Projects/storage-locations-s5-s6`, off `main`
-@ `60183f0`; **merged since — the "unmerged" below is stale, and the three things it names
-as left out are down to one, see the 2026-09-22 block above**). The operator's two asks that evening — *"disk space and current storage
-volume as columns on the channels menu, and let me filter by volume"* and *"progress on
-relocate jobs since rsync gives progress"* — plus the four things around them: per-channel
-media bytes in the snapshot (`totalMediaBytes`), the corpus volume as a first-class `/storage`
-row (`internal`, synthetic), the saved-video store made movable (`relocateDir.ts` is the
-channel mover's factored core; `relocateSavedVideos` is new), and a five-minute drive watch
-that auto-pauses a channel whose drive went away and restores its tier when it comes back
-(`ChannelPriorityEntry.autoPaused`). Slice record and what was deliberately left out:
-[`storage-locations.md`](storage-locations.md#s6--the-storage-surfaces-the-operator-asked-for-shipped-2026-09-20).
-Seams: [`FACTS.md`](FACTS.md#storage-locations-s5s6-verified-2026-09-20-branch-storagelocations-s5-s6).
-**Left out, named:** `assertRelocationRootPresent` (a move can still `mkdir` under an absent
-mount), a `/review` section for auto-paused channels, and the per-unit reachability re-check in
-the two lane runners.
-
-**Previously:** 2026-09-15 (Phase 3 slice 1 and the rack landed; see the Next block) — 2026-09-13: **gate A passed and `main` moved; the interlude shipments and one-core Phase 2 are all merged
-on one branch**, `integrate/2026-09-storage-priority`, tip **`bd3d4ec`**, unmerged. Off
-`e74f005`: `relocate-channel-media` (from `storage/relocate-media`), then `channel-priority`
-(from `channel-priority/s5`), then Phase 2's five slices in the order their reviews cleared —
-`7f86aef` S1, `b7a351c` S2b, `858aabc` S2c, `9026007` S3, `bd3d4ec` S2a. The branch waits on
-**operator gate A**, then a fast-forward to `main`. The two resolutions that are not a union
-of both sides — `listChannelMeta`'s return shape and the pair of bulk bars at the foot of
-`ChannelsTable` — are pinned in
-[`FACTS.md`](FACTS.md#the-storage--priority-integration-verified-2026-09-12--where-the-two-branches-collide);
-Phase 2's seams are in
-[`FACTS.md`](FACTS.md#one-core-phase-2-verified-2026-09-12-branch-integrate2026-09-storage-priority)
-and the slice-level record is
-[`one-core-phase-2.md`](one-core-phase-2.md#phase-2--shipped-2026-09-12).
-
-**The release-candidate gates on `bd3d4ec`, measured 2026-09-12 from the integration worktree
-(`/home/user/Projects/integrate-2026-09`, worktree #8 — editor 3801, test 3811, export 3810,
-export-e2e 3820), e2e behind the machine-global queue lock, one worker:** `tsc --noEmit`
-clean in all 7 workspace packages; `common` **1159/1159**; `mcp` **205/205**;
-`pnpm test:scripts` **78 passed / 1 skipped**; editor and export `next build` clean; the
-compose-site fixture byte-identical except `generatedAt` and the four `_headers` lines S2c's
-CORS change added, with the composed hub's `_headers` byte-identical to the pre-S2c literal;
-export e2e **172/172**, hub **5/5**, the editor suite **533/533** in 23.1 min with neither
-known flake firing, and umtool **129 passed / 40 failed / 2 skipped** — the same 40
-environmental failures S2b measured, spec for spec; and
-`curl https://jeralyzer.pages.dev/corpus.json` byte-identical to
-`plans/tools/jeralyzer-corpus-2026-09-12.json` (12,380 bytes) — which says the snapshot is
-still current, not that a rebuild would match, because jeralyzer has not been rebuilt.
-`e2e:2origin` was not run: it shells `build:hub`, whose `/ask` prerender is red on the base
-and predates Phase 2.
-
-**The operator runbook below is unchanged and still the sequence to follow** — the
-channel-priority migration first, with the editor stopped, then the platter mount, then the
-saved-video store, then the channels. Nothing in Phase 2 touches it.
-
-**Previously:** 2026-09-08 — **one-core Phase 1 shipped** on branch `one-core/phase-1`
-(`7f294df` → `81a663f` plus a docs commit, 36 commits, not merged): **dispatch is one scheduler, and the lane is the
-noun.** The slice-level record — every sha range, every divergence, both operator gates — is
-[`one-core-phase-1.md`](one-core-phase-1.md); the umbrella is
-[`one-core.md`](one-core.md) and the anchors are
-[`FACTS.md`](FACTS.md#one-core-phase-1-verified-2026-09-08). **No live number moved**: the
-before/after diff of `plans/tools/phase1-numbers.ts` over the real 78,000-video corpus is
-EMPTY for 1.1, 1.2, 1.4 and 1.5, and for 1.3 is 18 added lines / 0 removed — the two sweeps'
-scopes migrating into lane trees, both `enabled: false`.
-
-- **1.1 — four lanes in the model.** `AutoQueueKind` is `transcription | download | digest |
- backfill`, exported as `LANES`, and `PauseLane` is an alias of it. `retainLeaves` was
- DELETED rather than de-moded: `pending[leaf]` is what the leaf drew, so a post-hoc filter
- over it can only re-apply a rule the draw already applied. The rule moved into the draw.
-- **1.2 — the runner runs operations.** `digestBatch.ts` (647) + `backfillBatch.ts` (937) →
- one `controller/operationBatch.ts`. The status poll costs ~150 ms more for the two new
- lanes and a `(mtime, size)` parse memo gives ~140 ms of it back. Three runner-only bugs
- review found (a spend cap a 60 s TTL could reset, a context swapped under an in-flight
- unit, a dead engine re-probed every tick) and one the e2e spec found: **every runner held
- its own copy of `.auto-queue/state.json`, which is serialized whole**, so each persist
- clobbered the other lanes' pick log. They share one object now.
-- **1.3 — the sweeps and the arbiter retire.** Arming is tree authoring; ten settings fields
- migrate on read (`common/lib/laneMigration.ts`, a pure function tested through the
- sanitizer) and are then deleted with their sanitizers and forms. `reach` and
- `digest.recencyOrder` are RETIRED, not migrated, and the note says why. The one rendered
- change in the whole phase is here and was kept on purpose: the /jobs strip's four lane rows
- fold `gateHeld` now, so a held transcription row reads *Holding* where it read *Idle*.
-- **1.4 — pause is lane state.** One key, `autoQueue[lane].held`, behind the unchanged
- `isGateHeld` / `withGateHeld`. The four legacy fields survive as `legacyGateHeld`'s
- read-time input in `lib/laneMigration.ts` — NOT in `pauseGates.ts`, which would have pulled
- the operation registry into every reader of settings.json. The transcription
- intent-vs-pool asymmetry is intact.
-- **1.5 — one work list per lane in the snapshot.** `backfill.download` and
- `backfill.transcription` are the fold of each lane's default buckets, so
- `snapshot.backfill[op].ids` is where all four lanes' work lives; the runner reads it and
- falls back to the same fold, which is the migration (nothing is regenerated).
- `plans/tools/phase1-worklist-check.ts` checks all 68 live snapshots read-only: **OK**,
- download 9, transcription 882, zero already carrying an entry. The 882 is the
- POLICY-FREE work list; the transcription lane still draws **2,754** today, because the
- live `autoQueue.transcription.replaceAutoSubs` is `true` and `defaultDrawsForPolicy`
- appends `downloadedAutoSubsOnly` (1,872) at the tail of the draw.
-
-**Two operator gates are outstanding, and one of them gates a merge.**
-
-- **Gate A** — the digest lane's runner drives a production pass and comes back after a
- restart. Run it from **`one-core/phase-1-gate-a`** (`0438a72`), which is the code as 1.2
- left it; the step-by-step runbook, including the exact `settings.json` block and the
- channel to point it at, is in `one-core-phase-1.md`'s "Operator gate A" section. It gates
- the MERGE of 1.3 onward, not their authorship, which is why the branch exists.
-- ~~**Gate B** — before the backfill lane is ever `enabled` in production, decide
- `backfill.allowRedownload` and the channel scope. As configured today it would re-fetch
- audio for ~66,540 videos. The migration left the lane disabled; the tree's channel leaves
- are the scope from now on.~~ — **DONE 2026-09-23: reachable media only**
- (`allowRedownload: false`, lane held, still disabled). Record:
- [`one-core-phase-1.md`](one-core-phase-1.md#gate-b--passed-2026-09-23).
-- ~~**The four legacy pause fields go only once the live `settings.json` carries all four
- `held` keys**~~ — **DONE 2026-09-22 (S0-pause, in `editor/debts`).** The four fields
- (`transcriptionsPaused`, `downloadsPaused`, `digest.digestsPaused`, and the inverted
- `backfill.enabled`) are deleted from `SiteSettings`, from every sanitizer and from
- `writeSettings`' merge literal, so a file that still spells one loses it on the next write;
- `legacyGateHeld` and `migrateHeldToLanes` are gone. The warning this bullet carried was
- heeded: `defaultHeldFor(lane)` is `lane === "backfill"`, so **backfill defaults `true`**,
- and the invariant is asserted where a reader actually hits it — through `sanitizeAutoQueue`
- in `common/jobs/autoQueuePolicy.test.ts`, not through a unit test of the default itself.
- The backfill lane is now off twice over on a fresh install, unarmed AND held, which is gate
- B kept as two deliberate acts.
-
-**All four e2e flakes are fixed** (`plans/deflake-e2e.md`, `a32612a` → `fae99f1`), and the
-first three's class is worth remembering: **a debounced write survives a test boundary
-until the next reset.** `video-page.spec.ts:216` ("Delete directory wrong-id confirmation")
-asserted a video directory still existed after a refused delete and found it gone — nothing
-deleted it, `reconcileVideoDirs` RENAMED it. Snapshot generation moves `data/<name>` to
-`data/<extractVideoId(webpage_url)>` when the two differ, and the
-`one-youtube-channel-with-data` fixture was the only directory in the tree where they did;
-the previous test armed the debounced regen, and `resetData` copied the fixture back in
-BEFORE it invalidated, so the regen renamed the fresh copy. The fixture's id now matches its
-directory and `resetData` quiesces first (that route's `resetSnapshotScheduler()` clears the
-armed timer; a regen already past the debounce is not awaited and keeps walking, which is
-why the fixture fix is the half that actually closes it), so the two halves of the hazard
-are both closed. The export "no FOUC" theme
-tests read `data-theme` after a `waitUntil: "commit"` reload that does not promise the head
-script has run — the script now marks itself `data-theme-ready` and they wait for it. And
-ask-chat's "Stop aborts mid-sweep" raced a 500 ms route timer; the test holds batch 2 open on
-a latch it releases itself. No retries, `test.slow`, or serial markers were added anywhere.
-
-**The fourth is fixed too, and it was never the batch** (`fae99f1`,
-[`attribution-batch-hang.md`](attribution-batch-hang.md)). `attribution.spec.ts:346` "Run from
-the video page runs that video and no other" failed 1-2 runs in 10 waiting the full 90 s for
-the batch's "1 done". Instrumented at `fea2996` — `console.error` with ISO timestamps, never
-through the job's own `onLog` — it reproduced 3 times in 25, and every failure reads the same:
-
-```
-[TRACE 2026-09-08T20:25:21.661Z] attributeOne.post-write attrvid0002
-[TRACE 2026-09-08T20:25:21.661Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=4 closed=false :: Attribute attrvid0002 (text-only): 2 speaker(s)…
-[TRACE 2026-09-08T20:25:21.662Z] runPool returned attribution-channel
-[TRACE 2026-09-08T20:25:21.662Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=5 closed=false :: Backfill attribution-channel: 1 done, 0 already current…
-[TRACE 2026-09-08T20:25:21.663Z] fn.finally job=01M21B4PDQZC6YWGZH38WYV37N status=done
-Error: locator.getAttribute: Test timeout of 120000ms exceeded.
- - waiting for getByLabel('Run Speaker names (from the transcript) output')
-```
-
-The job finished in **65 ms**, wrote all five lines including "1 done", enqueued every one of
-them with `closed=false`, and finalized `done`. **All five hypotheses the plan ranked are dead,
-H1's mechanism included** — no `stream.cancel` fired in 240 instrumented tests, so the early
-SSE teardown H1 described (and the log-file polling it prescribed) was never happening; all
-that held of H1 was its disposition, server innocent and failure client-side. The real cause is
-a sixth mechanism outside the table: the log panel was **gone** — not stale, not short, absent.
-The failure snapshot shows the record body and the Run button and no `<pre role="log">` at all.
-`AttributionBody` returned two fragments of different SHAPES (`[p, RunOne]` with nothing on
-disk, `[dl, ul, p, RunOne]` with a record; `DiarizationBody` the same at `[dl, p, RunOne]`), so
-`reconcileChildrenArray`'s index pass broke at 0 and found `ul`/`p` where the UNKEYED `RunOne`
-had been — a positional type mismatch, which is what unmounts a child and takes
-`StreamActionLog`'s `log` state with it. React preserves state across a KEYED move, so a key
-alone or a fixed position alone would each have sufficed; the fix ships both. The
-refresh that lands the record is the one `StreamActionLog` fires itself when the run ends, so
-the panel is wiped at the instant the summary line reaches it, and the spec could only pass in
-the ~200 ms window before that. **The earlier note here — "the job never reaches a terminal
-state", "the hang is in the BATCH" — was the artifact, and so was "the log FILE has no more
-than the panel": the file had everything, and no reconcile could have helped a component whose
-state had been destroyed** — nor would the plan's own H1 fix have helped, for the same reason.
-Do not trust either claim again. Both bodies are one two-child list now, RunOne last and keyed;
-the spec asserts the log still says "1 done" AFTER the pill reads "current", which is red on
-every run at `fea2996` (5/5) and green at the fix. `attribution.spec.ts --repeat-each 20`:
-**20/20**. The durable rule — **a component carrying a `StreamActionLog` must not be UNMOUNTED
-when the record its run produced lands**, whether by an unkeyed move or by a parent branch
-swap — is in `FACTS.md`.
-
-**Those instances are now closed, and a fourth with them** (`c19098b`, follow-ups in
-`12d1778`; the specs that catch them in `b207e84`). `SourceVideoSection` early-returned the
-persisted view once the pointer landed; `IncompleteTranscriptBanner` and `ShortAudioBanner`
-were dropped by the parent when the run cleared their condition; and `PerFileTranscribeRow`
-swapped its panel for "Transcribe disabled — transcript already present." the moment its own
-run wrote transcript.json. All four are the same shape now: message and run panel in separate
-fixed slots, a `ranHere` flag set when a run starts there keeping the panel mounted across the
-refresh, and `StreamActionLog`'s existing `disabled` prop fed the now-cleared condition so a
-kept panel is not a second Run button. The banners' `role="alert"` and warning aria-label are
-conditional on the flag, so the box that outlives the warning does not keep announcing it.
-`PerFileTranscodeRow` was checked and is **not** an instance: its condition is the file's
-extension against a static format list, which a transcode cannot change. Each fix has an e2e
-case that reads the log's closing line only AFTER the state the run produced is on screen; all
-four are red without the fix and green with it, and `--repeat-each 10` over the four specs is
-340/340.
-
-**The last full suite: 518 passed, 0 failed of 518, 31.8 min** from a worktree of `12d1778`
-(one worker behind the queue lock). Previously **515/515 in 24.6 min at `65abc11`**, the
-de-flake tip; the three added cases are the difference. The four flakes are closed and the
-suite is clean end to end. Previously, at `2133d94`, it was 514/1 — slice 1.5's own new band
-assertion, and it was right: writing the two new snapshot entries doubled `/channels`' Download
-and Transcribe coverage, because that page passes the external ids into `buildOperationBands`
-and `addRegistryEntry` folded them on top of `addExternalBands`. Fixed in `d8754d2`.
-
-**2026-09-11 — [`relocate-channel-media.md`](relocate-channel-media.md) SHIPPED**, all three
-slices, on branch `storage/relocate-media` (`4059dad` → `affe525`, 24 commits off `61eae05`,
-**unmerged**; the suite is **523/523 in 22.3 min** at `affe525`, and
-`common` is 971/971). A channel's `data/` can be an absolute symlink to
-another drive with `config.dataDir` recording the target, moved by a Storage panel on the
-channel page or in bulk from `/channels`; four guards plus a `needsMedia` flag on the job kind
-stand between an unmounted drive and a re-download, and the low-disk gate now measures the
-volume the bytes are going to and latches per volume. **Nothing on disk moved** — the mechanism
-shipped, the bytes did not. The slice table, the two review rounds and eight divergences are in
-that plan's "As shipped (2026-09-11)"; the anchors are in
-[`FACTS.md`](FACTS.md#one-core-phase-1-verified-2026-09-08).
-
-**2026-09-11 — channel priority shipped** on branch `channel-priority/s5`
-(`28bfee3` → the tip below, four merge commits plus eight of its own, **not merged**):
-**one tier per channel, one focus, four COMPILED lane trees.** S0 (`28bfee3`) is the model;
-S1 (`2710195`) dispatch; S2 (`76c5784`) sync; S3 (`88da736`) the `/channels` UI and the one
-writer; S4 (`9fcc8b4`) the banner and the read-only tree; S5 merged all four in order (no
-conflicts — the slices touched disjoint files), closed the twelve parked review findings, ran
-the migration's dry run against the live corpus and deleted `excludeFromSync`. Anchors:
-[`FACTS.md`](FACTS.md#channel-priority-verified-2026-09-11); the record with every divergence
-is [`channel-priority.md`](channel-priority.md)'s "as shipped".
-
-- **The model compiles, it is not consulted.** `settings.channelPriority` → `prio-focus` >
- `prio-normal` > `prio-low` > `prio-all`, all strict, per lane. No dispatch code changed: a
- focus holds the rest because strict descent already does, re-asked on every grant. An absent
- document is today's behaviour byte for byte.
-- **The data-loss find.** `backfillReacquire.decideKeep` asked `policyDrawsBucket` on the
- transcription root — on a COMPILED root a channel paused for transcription has no leaf, so
- it would have answered "no-leaf" and unlinked the re-acquired audio of exactly the channels
- an operator had just put on hold. The pause is asked first and KEEPS. A hold is never a stop.
-- **The order that nearly went.** The bypass is all-or-nothing, so the first tier click on
- `/channels` stops the stored trees being dispatched from — and the two hand-made 9+9 lane
- orders live only there. The one writer now seeds from `channelPriorityFromLegacy` when the
- stored document says nothing and the stored roots are not already compiled. And a corpus
- whose roots ARE compiled recompiles even for a default document, or ending a focus would
- leave `prio-focus` at the head of a tree the runner is bypassing to.
-- **One writer of `root` too.** `saveAutoQueueAction` and `armLaneAction`-with-a-scope refuse
- server-side while a model exists; `prioritizeChannelDownloadAction` is a priority edit;
- create/delete recompile.
-- **`excludeFromSync` is deleted** — field, sanitizer clause, action, toggle, and all five
- legacy reads. `excludeFromBuild`/`excludeFromCleanup` untouched.
-
-**The full editor suite at `a8e908a`: 528 passed, 0 failed of 528, 22.9 min** from this
-worktree behind the queue lock (518 + the 10 new priority cases). Three specs went red on
-the way and all three were right: `channel-priority.spec.ts:172` caught End focus leaving a
-stale `prio-focus` at the head of the stored tree, and `new-channel-onboarding.spec.ts:111`
-was still reading "Add to top of auto-queue" as a hand-written leaf.
-
-**Two flakes cost a suite run and are named so the next session does not re-chase them.** An
-earlier run at `a8e908a` was 526/528: `no-subs-fallback.spec.ts:114` failed on an `EEXIST`
-inside `resetData`'s `cp` (a filesystem race in the harness, 3/3 green on re-run), and
-`backfill.spec.ts:457` failed on `uncheck()` not changing a controlled checkbox — the
-`PolicyTreeEditor` adopt-effect race, where the 3 s status poll calls `setForm` between the
-click and its assertion. Measured after: 1 failure in 6 runs of that case at `a8e908a`, 0 in
-9 at `4d256a2`, and the clean 528/528 above. Its payload path for a DEFAULT priority
-document is unchanged by this branch, so it reads as the known adopt race rather than a
-regression — but the sample is small, and it is the case to look at first if it recurs.
-
-**⚠ THE MIGRATION MUST RUN BEFORE THE FIRST BOOT OF THIS CODE, not after it.**
-`excludeFromSync` is deleted and `parseChannelConfig` drops the key, so on a corpus that has
-not been migrated the 15 channels that carried it read as *saying nothing about sync* — and
-four places act on that the moment the editor starts: `syncScheduler.ts:132` (selection),
-`:259` (`autoSyncEligible`, so the projection changes on sight),
-`channels/actions.ts:524` (*Sync all*) and `channelGroupSections.ts:140` (a group's Sync).
-The automatic tick is the one thing that does NOT fire on the live box — its
-`heartbeatSeconds` is 0 — but *Sync all* or a group Sync in that window sweeps every channel
-the operator had excluded. Nothing else moves: no lane's membership, no download, no
-transcription. **Order: stop the editor → run the migration → start it.** The script takes
-its own timestamped `settings.json.pre-priority-<ISO>` backup beside the file before its
-first write (refusing to overwrite an existing one), so the backup is not a step anyone can
-skip.
-
-**IT HAS NOT BEEN RUN — that is the operator's step at rollout.**
-`common/bin/migrate-channel-priority.ts --dry-run` against a READ-ONLY copy of the live
-`settings.json` (no config.json or settings.json mtime moved) says: **68 channels, 28
-entries, 14 ranked, 15 pinned `sync=paused`, no focus, every base tier `normal`**, and all
-four compiled roots `prio-normal(68) > prio-all`. The ranked order is
-`quartering-live, the-quartering-rumble, the-quartering, HasanAbiVODs3, nuxanor, hasanabi,
-darlingstrawb, rekietalaw-rumble, chibi-reviews, nux-taku, destiny, omnivods-odysee,
-leaflit-rumble, piratesoftware` — dense 0–13, merged index then the transcription lane's
-order then slug. No lane's membership moves; only `sync` loses anyone.
-
-**The rollout is the operator's, and the two shipments share one sequence. The migration
-goes first, because it is the only step that must happen before this code ever boots.**
-
-1. **Run the channel-priority migration, with the editor stopped.** `excludeFromSync` is a
- deleted field, so an unmigrated corpus reads its 15 channels as saying nothing about sync
- the moment the editor starts. Order: **stop the editor →
- `pnpm -C common exec tsx bin/migrate-channel-priority.ts` → start it again.** Run
- `--dry-run` first; the real run takes its own timestamped
- `settings.json.pre-priority-<ISO>` backup beside the file, and is a no-op on a second run.
- Never run it against a live editor: a running one holds settings in memory and writes them
- back on its own schedule.
-2. **Mount the platter.** `sdb1` (1.8 T, ext4) at `/mnt/platter` with `nofail` in fstab;
- create `/mnt/platter/archilyzer-media` and `/mnt/platter/archilyzer-saved-videos`, owned by
- `user`. Nothing below works before this, and no code needed it.
-3. **The saved-video store, by hand** — the relocate plan's runbook: rsync
- `transcripts/saved-videos/` out, verify with `--dry-run --itemize-changes`, move the
- original aside, symlink the store root, restart, then delete the original. **That is the
- step that frees the 130 GB**, it needs no code at all (every pointer carries an absolute
- `dir` and nothing walks the store root), and it goes before the channel moves because a
- 100 %-full `/home` is a hazard to every unrelated writer while they run.
-4. **Channels through the UI, largest deprioritized first.** Storage panel per channel, or tick
- rows on `/channels` and use the bulk bar; `omnimirror` (130.3 GB) is the obvious first move.
- Sizes are in the relocate plan's table — they are sizes, not priorities.
-
-**The gates, all run on the merged tip from the integration worktree
-(`/home/user/Projects/integrate-2026-09`, worktree #8 — editor 3801, test 3811, export 3810):**
-`tsc --noEmit` clean in all six packages; `common` **1051/1051**; `mcp` **205/205**;
-`pnpm test:scripts` **71 passed / 1 skipped**; `next build` clean; the editor suite
-**533 passed, 0 failed of 533, 24.2 min** behind the queue lock, one worker. No fix commit was
-needed — the six conflicts were the whole of the work.
-
-**Both suite totals are the sum of the branches', which is how we know nothing was dropped in
-the conflicts.** `common` is 908 at `e74f005` + 63 relocate (971 at `bc62248`) + 80 priority
-(988 at `996f182`) = **1051**. The editor suite is 518 at `12d1778` + 5 relocate (523) + 10
-priority (528) = **533**. Neither known flake reappeared: `backfill.spec.ts:457` (the
-`PolicyTreeEditor` adopt race) was green on its first run, and so was every video-page case.
-
-**The merge review (2026-09-12, on `c7f7b90`) found nothing above low.** Every conflicted
-file reproduces both parents' deltas line for line, and the six auto-merged files are exact
-unions; the sanitizer carries both branches' new keys on read and write. Three notes, none a
-blocker: (1) with rows ticked on `/channels`, BOTH bulk bars render — storage first, then
-priority — each announcing its own count and Clear, sharing one selection; no e2e on either
-branch could see the pair. (2) The relocate plan's "Step 0 / Step 1" labels are stale
-against the order above — the store rsync targets the platter, so the mount comes first; the
-runbook above is the one to follow. (3) `syncAllChannelsAction` skips paused channels but
-not unreachable ones (`channels/actions.ts:536-543`); an unmounted channel is refused inside
-`syncAction` by the `needsMedia` guard and surfaces as a failed sync, not a skip reason.
-Pre-existing on the relocate branch.
-
-**Gate A PASSED 2026-09-13** on the production editor (record in
-[`one-core-phase-1.md`](one-core-phase-1.md#gate-a--passed-2026-09-13)), and **`main` is
-fast-forwarded to `241d357`** — the integration, Phase 2 and the gate record. Every merged
-branch and worktree is deleted; what remains is `one-core/phase-1` (the primary checkout,
-until it switches to `main`), `one-core/s0-pause` (parked for the next release),
-`diet-series`, `p1-e2e` and `worktree-duplicates-page`.
-
-**The `/channels` rack shipped 2026-09-14** and `main` is fast-forwarded to **`1bc8765`**
-(`64b5573` → `1bc8765`, forked from `a1058d0`; tsc clean, common 1159, editor e2e **533/533**
-on the identical tree — the fast-forward got a `tsc --noEmit` smoke, not a second 25-minute
-suite). One deck, a sticky rack and a meter bridge; the record is
-[`editor-channels-rack.md`](editor-channels-rack.md). The worktree and branch are deleted.
-It merged BEFORE the rollout's channel moves on purpose: those go through the `/channels`
-bulk deck, which the rack rewrote, so the operator does them on the merged page. **One-core Phase 3 slice 1 SHIPPED 2026-09-15** — `main` `1faa987` → **`838da4a`**, fifteen
-code commits in four fast-forwarded sub-slices (A serial, B ∥ C, D serial), record in
-[`one-core-phase-3.md`](one-core-phase-3.md#slice-1--shipped-2026-09-15). Every payload the
-editor draws is a pure function in `common/views/` handed its singletons, readings and
-clock; the layer guard proves it (allow-list **11 → 10**, two new tests, a textual ban on
-getters, readers and `Date.now`); common **1264/1264**, the full editor suite **533/533**.
-Nothing rendered, routed or serialized moved; the one live change is `/operations` reading
-`.auto-queue/state.json` once per poll instead of four times. **Next, in parallel:** the
-rollout below (operator-physical), then S0-pause one boot later, then **Phase 3 slice 2**
-(unplanned; `one-core.md` §Phase 3 — the plan file's "What slice 2 inherits" is the start). Phase 3 slice 3 rewrites `ChannelsTable.tsx` again;
-landing the rack first keeps that a rebase-free rewrite of one file.
-
-**The rollout:** the **O2–O9 rollout**, editor stopped. **The migration script only exists on
-`main`**, so the checkout switches first; the rule is "migrate before the first BOOT", not
-before the switch. Done 2026-09-13: `git switch main`, then the migration for real — 67
-channels (one fewer than the 68 planned), 27 entries, 14 ranked, 14 `sync=paused`, no focus,
-all `normal`, backup `settings.json.pre-priority-2026-09-13T14-34-26-361Z`. Still to do:
-`pnpm install --frozen-lockfile`, the platter mount and the saved-video store rsync,
-`pnpm --filter editor exec next build`, start with `-H 0.0.0.0`, the channel moves through
-the UI, then `git branch -d one-core/phase-1`.
-
-**Then S0-pause lands, in the release AFTER this one.** The branch `one-core/s0-pause`
-(`2aeb358`) is ready and reviewed — it deletes `transcriptionsPaused`, `downloadsPaused`,
-`digest.digestsPaused`, `backfill.enabled` and `legacyGateHeld`. It is held back for a
-sequencing reason, not a quality one: a main-era `settings.json` has never carried
-`autoQueue.<lane>.held`, that key first appears when merged code writes settings back, and the
-same release cannot both introduce the writer and delete the read-time migration that covers
-every file written before it. An install taking it straight from an older release loses its
-pauses — transcription, downloads and digests come up running and the backfill lane comes up
-held. Boot this release once, confirm all four `held` keys are in the live `settings.json`,
-then take it.
-
-**Then the rest of one-core Phase 3** — views in the core, editor as shell, four slices
-([`one-core.md`](one-core.md) §Phase 3); slice 1 shipped (above), **slices 2 and 4a shipped
-2026-09-23** (see the head of this file), slices 3 and 4b are the next release. Read `common/architecture.test.ts`'s allow-list
-first: it is the shortest accurate statement of what is still tangled. Phase 2 left it at
-**eleven entries, byte-identical to the base**, while ADDING `"components"` to
-`FORBIDDEN.lib` — the forbidden list grew and the debt ledger did not.
-
-**Previously:** 2026-09-07 — **one-core Phase 0 shipped** on branch `one-core/phase-0`
-(`df5eb48` → `1691c4f`, six commits, not merged): **guardrails and dead weight**, every item a
-deletion, a move or a guard. `common/architecture.test.ts` is the layering (back-edges 16 → 12,
-the list can only shrink); `scripts/report-to-video` → `umtool/report-to-video`;
-`common/package.json` has an `exports` map; one `pageFileName` and one `CONTRACT`. **Nothing on
-disk in a corpus changed and nothing on the wire changed** — proved with a fixture corpus
-composed through `build-index` + `compose-site` before and after, identical apart from
-`generatedAt`. Detail: "Phase 0, as shipped" in [`one-core.md`](one-core.md); anchors in
-[`FACTS.md`](FACTS.md#one-core-phase-0-verified-2026-09-07).
-
-**Previously:** 2026-08-31 — **the transcode operation is removed** (`904f1a9` → `f717a36`): it never fired in production. The census over 68 channels found the `untranscoded` bucket empty in every one, both `failed-transcodings` files 0 bytes, and only four channels even passing the stage's gate — and `resolveAudioFile` falls back to any real audio file anyway, so transcription never needed it. Gone: four controllers, four job kinds, the channel stage and station, the catalog entry and with it `appliesTo`/`operationApplies` (catalog 8 → 7). Kept: `transcodeAudio` and the download path, the per-file *Transcode …* rows, both wrong-format sweeps — whose bucket is `wrongFormatAudio` now. The slice-5 leftovers rode first (`measure-nav.mjs`, `BUILD_KINDS`, `EditorAliasesClient`). Plan: [`editor-transcode-removed.md`](editor-transcode-removed.md).
-
-**Previously:** 2026-08-30 — **editor IA slice 5 shipped** (`140212a` → `df9b839`):
-**a site has tabs, and the family has one page.** Charts, Search aliases, Deploy, Build and
-Homepage were five sidebar entries beside *Sites*, three reading the site from a `?site=`
-param the picker had to seed, one about no site at all, one about the family's own hub.
-`/sites/<id>` is now **Settings · Charts · Search aliases · Publish** — a layout, the site
-named in the PATH, and the picker reading that path through a new pure `siteIdFromPathname()`
-so the two can never disagree (it writes it to storage, so Dashboard and Channels follow).
-`/sites` is the family page: the list, *Release notes*, *Build all sites* with the
-Basic/Docker mode, the *Hub*, and the *Pool* — the corpus-wide jobs — under a disclosure.
-The five routes 307, and a `?site=<id>` bookmark rides a `has` rule to that site's tab.
-`build/` and `deploy/` — already one module in two directories — are `sites/lib` +
-`sites/components`. The nav is **eleven**, the IA doc's end state, held by `nav.test.ts`; the
-IA doc's UI slices are complete. **Nothing on disk changes.** See "Slice 5, as shipped" in
-`editor-operations-ia.md`.
-Previously: 2026-08-30 — **editor IA slice 8c shipped** (`2226680` → `21feed3`):
-**`/jobs` is one list, and slice 8 is complete.** The design question #12 asked first — what
-is a ROW — is answered *a row is one job*, whichever of three places knows about it: a registry
-record, a `.log` + sidecar the registry has forgotten, or a scheduler slot whose record was
-evicted (a phantom). One `JobRowView`, one builder, one adapter per source, merged VIEWS by id
-with the live row winning. The page is one `<table>` with no mode: the live head (running,
-queued in queue order, anything that finished in the last half-minute) polled at 1 s while any
-row is non-terminal, the paged history below it on the global pulse. **The scheduler's drift
-check rides the live payload**, so every surface that draws work — `/jobs`, the dashboard, the
-widget, `/api/jobs/active` — frees a running slot whose record is terminal or gone, after
-drawing it once; `/api/pulse` does not build it and must not. `/jobs/active` and `/jobs/queue`
-307; the sidebar's *Active* entry and its running badge are gone. The five pages that
-hand-rolled a six-field copy of a running job now call `liveJobRows`, so their cards show the
-progress bars they used to drop. **Nothing on disk changes.** See "Slice 8c, as shipped" in
-`editor-operations-ia.md`.
-Previously: 2026-08-29 — **editor IA slice 8a+8b shipped** (`ea04b4e` → `fecac0f`):
-**sync is a catalogued operation and the schedule is its page.** `OperationDescriptor` gains
-`scope` ("video" | "channel") and `trigger` ("backlog" | "cadence"), `SYNC_OPERATION` is first
-in `operationCatalog()`, and `/operations/sync` — today's `/scheduler`, which 307s — is the
-per-channel cadence table with the **whole `syncScheduler` block** below it. Two things the IA
-doc's wording could not buy: `runner` is typed `AutoQueueKind` and the heartbeat is not one, so
-the console is chosen off `trigger`; and a band's populations are videos, so the rail row is a
-composed `SyncRailRow` rather than a hollow band. `saveSchedulerSettingsAction` is the block's
-one writer (it had two), `WorkersField` and a new `WorkersConfigForm` move to `/workers` with
-`saveWorkersAction` as *its* one writer, and the worker-tag vocabulary is the first consumer to
-filter on `scope === "video"`. The four lane-note strings are one `sweepLaneNote` beside
-`deriveLaneState` — they were two copies and a paraphrase, and nothing pinned them.
-The two Storage chores that ride the heartbeat (keep-latest check, saved-video backup) are
-labelled as such everywhere they show; **no tick logic, no settings key and nothing on disk
-changed**. The `/jobs` fold — the last third of slice 8 — is its own plan. See "Slice 8a+8b, as
-shipped" in `editor-operations-ia.md`.
-Previously: 2026-08-28 — **editor IA slice 6 shipped** (`6986efc` → `d5ca90a`): the
-video page shows one panel per registry operation. `common/controller/videoOperations.ts` is
-the reader — one `readVideoFiles`, one `resolveTarget` and one `state()` per entry, never
-re-derived — and `digestSectionStates` in `lib/digest.ts` is now the ONE per-section fold the
-digest operation's `state()` and the panel both count through, so the page's duplicate of it
-is gone. `DigestPanel` is the digest's BODY inside a generic `OperationPanel`; diarization and
-both attribution operations get bodies of their own, each with a **Run** that runs that one
-video on the speaker lane (`ids` now threads through `runBackfillChannelJob` →
-`countBackfillWork` → the batch, and rides in `spec.params` so a replay stays scoped). A
-record whose feature is switched off is still shown, marked *switched off*. `hasDigest` was
-the channel COUNT's helper, not the page's — it is now private to `channels.ts`;
-`hasAttribution` was dead and is deleted; `hasDiarization` is the live cleanup guard and
-stays. Every digest aria-label is byte-identical; the heading is "Digest" rather than "AI
-digest"; nothing on disk changed. See "Slice 6, as shipped" in `editor-operations-ia.md`.
-Previously: 2026-08-28 — **editor IA slice 7 shipped** (`c924f73` → `685cba3`): one
-pause. `common/lib/pauseGates.ts` is the only place the four gates' polarity is known
-(`backfill.enabled` is inverted), `pauseLaneAction` / `resumeLaneAction` replace eight
-actions in two files, and `components/lanes/pauseControl.tsx` is the one control every lane
-surface draws — the dashboard, the widget, `/workers`, `/jobs/active`, both sweep panels and,
-new, the runner pages, where it sits beside Start/Drain/Stop. The gate is keyed by LANE, not
-by operation: three speaker operations share one backfill queue and therefore one pause. A
-held runner lane can read *Holding* on the operations rail for the first time, and
-`/operations/transcription` says "transcriptions are paused" rather than "no enabled worker
-to run it" (`pauseAll` disables every worker, so the runner could not tell the two apart).
-Every aria-label is byte-identical; nothing on disk changed; the widget wire fields
-`digest.paused` and `backfill.enabled` are both `held` now. See "Slice 7, as shipped" in
-`editor-operations-ia.md`.
-Previously: 2026-08-28 — **editor IA slice 4 shipped** (`a623958` → `43c4e26`, docs
-`808e3fc`, e2e follow-up `97ee12a`): `/actionable` is gone and redirects to `/operations`. Its per-operation
-sections are the channel-work tables on `/operations/download|transcription|digest`, report
-freshness and the two refresh controls are on `/channels`, the two cleanup tables are on
-`/cleanup`, and duplicate clusters plus media-integrity findings are a new `/review` under
-Corpus. The nav is twelve. The dashboard's "No digest" is "Digest to do" — a rename, not a
-re-sourcing: `actionableNoDigestCount` already returned the digest band's `reachable`, so no
-number on any screen moved. The widget wire field is `digestReachable`. Nothing on disk
-changed. See "Slice 4, as shipped" in `editor-operations-ia.md`.
-Previously: 2026-08-28 — **the re-acquire hand-off shipped** (`e450c2c`, `f661677`,
-`bec4775`): re-acquired audio on a subtitle channel is no longer
-deleted under a transcription that the auto-queue policy would have started on it. It is
-handed over when `autoQueue.transcription` would draw the video from
-`downloadedAutoSubsOnly`, kept while a transcription task is running on it, and removed
-otherwise; audio that vanishes mid-transcription is now a skip rather than a permanent
-`failed-transcriptions` entry; and speaker attribution records which transcript the names
-were made from, so an ASR→whisper replacement goes stale (for records written from now on).
-Runbook item 2 **step 4 is resolved** — see below. Previously: 2026-08-27 — **the `deferred` cause is found and fixed** (`fed4b01`,
-`ca42f7b`): a backfill re-acquire on a `handling: "youtube"` channel was running the channel's
-own subtitle download, so it re-fetched captions, landed no audio, and left ~16,000 videos'
-`transcript.cues.json` stale by mtime. It now forces a per-video transcribe override and
-re-normalizes after every fetch. The census is in FACTS.md; the operator's four remaining
-steps are item 2 of "Recommended next". Previously: 2026-08-26 (late) — **unified-ops step 1 landed**: `buckets.noDigest` is
-deleted and `snapshot.backfill.digest` is the one digest work list. No rendered number moved
-(the fallback's migration was already complete on disk, 68/68), and **IA slice 4 is now
-unblocked**. One finding for the operator: corpus-wide `deferred` is **16,156**, against 1 on
-08-10 — see the dated section below. Earlier the same day: **editor IA slice 3 landed**: an operation's settings live on its operation page, and the four `*FormPresent` markers are gone. See the dated section below. Earlier the same day: **the vocabulary pass landed**: the registry is
-`operations.ts` and says `Operation`, the three id spaces slice 2 handed it say "speakers",
-"unit" has one meaning, and `transcode` is a registry entry. See the dated section below.
-Earlier the same day: editor IA slice 2 (speakers are a real stage; one runner path) landed,
-and slice 1 was committed with it. Previously: 2026-08-24 — **`main` is green again, `feat/channel-groups` is merged, and
-this file caught up with two sessions it had no entry for.** The 2026-08-12 session below
-landed in `7d32438` on 08-18; everything from 08-19 to 08-24 — recency ordering, the
-arbiter, lane guards, the pipelines band, worker tags and slots, LLM fan-out, unit
-executors, the sweep scope console — shipped on `main` with no STATE.md entry. The
-context-clear protocol in [`README.md`](README.md) was skipped twice; this block is the
-catch-up. Commit bodies are the primary record and carry the measurements — read them
-with `git log -1 --format=%b <sha>` rather than trusting a paraphrase here.
-
-**Later the same day (16:xx).** Operator decision: the homepage does NOT link to the hub for now (`3dad5944`, `homepage/app/page.tsx` `HUB_LINK_ENABLED = false`; the URL stays in `homepage.json` for the hub's own build; redeployed as https://e04f6dd7.archilyzer.pages.dev — 0 "Search all archives" on the live page). Next: a ground-up homepage refresh (describe the project; the five sites as "Official instances"; plain copy, fewer subtitles) on a preview branch for review.
-
-## What landed 2026-08-18 → 08-24
-
-- **Chapter-boundary quality metric** (`7d32438`) — the 08-12 narrative below, committed.
- `lib/boundaryScore.ts`, `--score-existing`, and the READ-RECALL-NOT-PRECISION finding.
-- **Recency ordering, four commits** (`74f8e51` → `efea56f` → `72745fe` → `bddae39`). A
- per-runner `order` (listed | newest | oldest) sorts within a rule; `digest.recencyOrder`
- and `backfill.order` do the same inside a batch; `reach` ("channel" | "corpus") extends it
- to the CHANNEL plan. The date comes from a layered key: a key-only scan of `index.mdb`'s
- `byChannel` (~300 ms for 78,583 videos, but only videos WITH a transcript — 122 of 870
- pending), then an 8 KB tail read of `metadata.info.json` (868/870, 0.19 ms each,
- memoized), then playlist position marked `estimated`. **Directory name ≠ metadata id on
- ~14.5% of this corpus** (`the-quartering-rumble/data/v1007ay` holds `vxe1ae`), so the
- index lookup is scoped to the owning channel or channel A's dir name inherits channel
- B's date. Measured: 11,329 candidates ordered in 118 ms; the sweep re-plans in ~1.5 s.
- `/auto-queue` became a dispatcher board saying what it would run next and why.
-- **Operation leaves, lane guards, the arbiter** (`3299a53`, `09d4598`, `ab68635`) —
- [`unified-operations-model.md`](unified-operations-model.md) steps **2, 3, 4 DONE; 1, 5,
- 6 open**. (That file's "designed, not built" header is stale by three steps; its step
- list is current.) `AutoQueueMatch.operation` beside `bucket`, claim key
- `${operation}\0${id}` so digest and diarization cannot steal each other's work;
- `common/controller/laneGuards.ts` holds digest's six rules as a preflight (throws) and a
- per-pull gate (holds, never stops); `common/controller/arbiter.ts` runs on `queueKey ""`,
- one unit per lane per pass, one job per channel, re-plans every pass, and REFUSES beside
- an armed sweep. Not persisted across restart — that is step 6's.
-- **The console and the band** (`1f2b7c2`, `43173c8`, `7fa975d`) — `/auto-queue` is one
- comparison rail over four pipelines; `components/pipelines/` holds the five-population
- band (reachable / needs-media / blocked / deferred / present — never summed, ~91× apart on
- this corpus). `band.ts` must stay directive-free and value-import-free: a server component
- calls its pure readings, and `"use client"` on it 500s every channel page at request
- time while `pnpm build` passes — caught by e2e, now pinned by a unit test.
-- **/channels, `group`, `costBasis`, and a word that was three things** (`4d57a5e`,
- `a5c4e48`, `07227ea`) — six bands per channel row; on the live corpus every row draws the
- same stripe and that uniformity IS the finding. Operations declare `group` and
- `costBasis`. **The fact that hid: `attribution-text` is ON, reachable on 11,337 videos of
- one channel, its unit is the transcript CHUNK (~194,000 model calls corpus-wide), and it
- has completed ONE video** — it read as a quiet row because "11,337 reachable" looks the
- same whether the unit is an audio pass or a per-chunk call. "Backfill" no longer names a
- figure anywhere; it is a queue key, listed with its members only where the shared pause
- and sweep live.
-- **Workers: tags route, slots multiply, endpoints fan out, executors run units**
- (`1ff2256`, `549c77b`, `2fcd08f`, `16004ac`, `eee3a07`). `Worker.tags` is consulted
- (`common/lib/workers.ts`); a remote is N slots, blank N filled from its own
- `/api/worker/health` through `controller/remoteCapacity.ts`; `WorkerKind "llm"` is a box
- running nothing but `ollama serve`, leased per call with only `baseUrl` swapped (outside
- the freshness identity → zero churn), verified against `/api/tags` for the exact model
- tag; every backfill kind declares `inputs / outputs / applyResult` and
- `/api/worker/unit` runs one unit on a corpus-less box (`controller/remoteUnit.ts`,
- `workerServer.startWorkerUnit`), refusing anything that is not a backfill kind. Executor
- deployment is in RUNNING_IN_DOCKER.md. `worker-unit.spec.ts` 6/6.
-- **Sweep scope console** (`dee7500`, `215d4e3`) — pick operations and channels before
- arming; scope is written by the ARM action only; a read-only "also runs on …" line per
- row derived through the same `workerMatches` the pool grants by.
-- **Channel groups on /channels** (`66ec9eb`, `421a13c`, merged 2026-08-24 from the
- `feat/channel-groups` worktree, which had sat uncommitted since 08-11). One table
- sectioned by the site's authored groups, each header carrying that group's slice of the
- pipeline as stations whose figure IS the button. Rebased over `4d57a5e`: the branch's row
- component now renders main's `PipelineCell` columns, sections join to rows by slug, and
- the header's `colSpan` is `8 + columns.length` rather than a literal.
-
-**Housekeeping, 2026-08-24.** `common` had failed `tsc` since `dee7500` (three test
-fixtures missing the widened `SweepKindCounts` fields; the node runner does not typecheck,
-so 821/821 hid it) — fixed in `6ea5ea2`. The `flexsearch-spike` worktree
-(`feat/client-flexsearch-index`, last touched 06-27, superseded by
-`common/components/searchIndex.worker.ts`) was **abandoned at `b4dee06`** — reflog only.
-74 already-merged local branches deleted; the empty May stash dropped.
-[`relocate-channel-media.md`](relocate-channel-media.md) is now tracked: designed and
-verified against the tree, **not started**, and its real prerequisite is operational —
-`sdb1` (1.8 T platter) is not mounted. **Not covered here:** `umtool` (27 commits on 08-18,
-a separate workspace package) is documented in `umtool/docs` and AGENTS.md.
-
-### 2026-08-26 — speakers become a real stage, and there is one way to run an operation
-
-Six commits, `1da6f22` → `1058b98`, each its own reviewable diff.
-[`editor-operations-ia.md`](editor-operations-ia.md) has the full "Slice 2, as shipped"
-section; [`FACTS.md`](FACTS.md) has the invariants. Slice 1 is committed too (`9b65b83`) —
-it had been sitting uncommitted as 50 changed files, which would have made slice 2 one
-unreviewable diff.
-
-**Two live bugs fell out of the refactor, neither of them the point of it:**
-
-- **The arbiter never called diarization's `laneFor`.** `laneForOperation` special-cased
- digest and returned the DECLARED `.lane` for everything else, so a sortformer/vulkan
- diarization reserved as `contendsFor: "cpu"` while holding ~4.4 GB of the same 8 GB card
- the transcription engine wants. Diarization has declared a `laneFor` since it was written;
- nothing asked it. Now one resolution off the kind's own declaration, and digest gains the
- `laneFor` it should always have had.
-- **`/operations/<id>` decided what to render from four hardcoded id tests.** A registered
- `transcode` — external, no runner — would have drawn the BACKFILL SWEEP'S console under a
- "Transcode" heading, with a live Start button arming a corpus-scale GPU commitment. The
- descriptor states it now (`runner?`, and `sweepLaneIdFor` off `lane.queueKey`), and **null
- is a real answer** rendered as a "no console here" panel.
-
-**One runner path.** `common/controller/operationJobs.ts`. There were four copies of "run one
-operation over one channel" and no two agreed: the editor's backfill summary line printed
-`deferred` and `blocked`, the sweep's printed `skipped`, and neither printed the other's — so
-"what did that run actually do" depended on which button started it.
-
-**The load-bearing decision in it: the runners do NOT drain.** Draining is the SWEEP's
-property, and the editor consumes the same stream client-side to draw a live log — a runner
-that drained would leave every stage card's log dead. The three callers that want sequencing
-drain at their own call site. This is the thing most likely to be "fixed" back.
-
-**`StageId "backfill"` → `"speakers"`.** It was a queue key wearing a stage's name; nobody can
-arm, pause or run "a backfill". `?stage=backfill` still resolves (`STAGE_ALIASES`) — an unknown
-`?stage=` falls back to the overview, which is right for a retired stage and wrong for a
-renamed one. **Two assertions would have passed vacuously after the rename** and were caught:
-a `notEqual` against a value the union can no longer hold, and a count-0 against a label
-nothing renders.
-
-**Decisions worth keeping:**
-- **`laneFor` must stay OPTIONAL.** `backfillBatch.ts` reads its PRESENCE as the marker for
- the GPU idle-only rule, so "give every kind a `laneFor` defaulting to `lane`" is not a no-op
- — it enrols every kind in that rule and revives a recorded regression.
-- **`laneForOperation` asks `getBackfillKind`, not `operationCatalog()`.** A catalog lookup
- would hand download and transcription a lane and the arbiter would start a backfill channel
- job for work no backfill kind can do.
-- **NOT one `OperationStage.tsx`**, which is what the slice plan said. The two cards overlap
- in presentation and diverge in everything that acts; merging them means a component
- branching on its own identity. `OperationWork.tsx` is the presentational half, and the
- criterion is written into the file.
-- **The `/channels` backfill group button is the LANE, not one operation**, so it does not go
- through the dispatcher.
-- **The population aria-labels still say "backfill"** — 16 spec lines, deliberately left for
- the vocabulary pass to keep them out of this slice's e2e risk. *(Done later the same day —
- they say "speakers"; see the entry above.)*
-
-**Recommended next**, with unified-ops step 1 (the old #2) now shipped:
-
-1. **GPU yield on a quiet box** — still the gate on arming the sweep, still unmeasured.
-2. **The operator runbook for the 16,156 `deferred`** — **CAUSE FOUND AND FIXED 2026-08-27**
- (`fed4b01` the fix + units, `ca42f7b` the e2e and the wording). It was **neither
- accumulation nor a regression in the cues gate**: it was one armed backfill sweep. With
- `allowRedownload: true`, every video on a `handling: "youtube"` channel is diarization
- `missing-input`, which dispatched a re-acquire that ran the channel's OWN
- `--skip-download --write-subs --write-auto-subs` download — rewriting
- `metadata.info.json`, landing no audio, and leaving `transcript.cues.json` stale by mtime.
- ~16,000 videos on eight channels, 2026-08-22 → 08-26, zero diarizations. Census, trail and
- numbers: FACTS.md "Verified 2026-08-27 — why `deferred` was 16,156". The fix forces a
- per-video transcribe override and re-normalizes after every fetch. **Four operator steps
- remain, and none was run from that slice:**
-
- 1. Keep `sweepEnabled: false` until `fed4b01` is on the running editor. (It is off now.)
- 2. **Clear the 16,081**: Digest stage card → *Normalize transcripts* on the-quartering,
- destiny, chibi-reviews, nux-taku, leaflit, kirsche, quartering-live, HasanAbiVODs3 (and
- shondo-vods, 22). Pure re-parse, no network; identical cues in 230/240 sampled cases;
- digests are not invalidated (`isSectionFresh` is provenance-keyed). Expect corpus
- `deferred` → ~76, the `missing`/`no-meta` tail.
- 3. **Re-affirm `allowRedownload` knowing what it now does.** With the fix the sweep will
- *really* fetch audio for the **66,540** youtube-handling `missingInput` videos
- corpus-wide, deleting each file after use (or handing it to auto-transcribe — step 4).
- The walk is **channel-major, in the configured order, with no inter-download sleep**:
- `sleepBetweenDownloadsSeconds` is the channel SYNC path's setting and the backfill
- sweep does not consult it (`backfillSweep.ts:55, 335-368`), so the earlier "30 s
- between downloads → ≥ 23 days" figure here was wrong. Scope it with `sweepChannels`, or
- turn the flag off, before arming. That is a policy decision, not a code one.
- 4. ~~**A known interaction, flagged not fixed**~~ — **RESOLVED 2026-08-28 by `e450c2c`.**
- The interaction was real: `autoQueue.transcription` is enabled with
- `replaceAutoSubs: true` and picks from snapshots that regenerate ~1 s after a download
- finishes, so a re-acquired `audio.mp3` on an ASR-only video is exactly what it looks
- for — and the backfill's `finally` would delete it mid-whisper, which is not "a failed
- unit, nothing lost" but a video appended to `failed-transcriptions`, honoured
- permanently by the manual per-channel batch. Now the backfill hands the file over
- instead (`decideKeep`), vetoes cleanup while a transcribe task is running on the video,
- and `transcribeOne` treats vanished audio as a `no-audio` SKIP on both the local and the
- remote path. **The operator no longer needs to turn `replaceAutoSubs` off for the corpus
- run**; the trade is that handed-off audio persists like any other download until a
- Clean-audio sweep. Mechanics and the file:line trail: FACTS.md "Verified 2026-08-27 —
- the re-acquire / auto-transcribe hand-off".
-3. ~~**Editor IA slice 4** (`/actionable` dissolves)~~ — **DONE 2026-08-28**, `a623958` →
- `43c4e26`. Plan: [`editor-ia-slice-4.md`](editor-ia-slice-4.md); outcome: "Slice 4, as
- shipped" in `editor-operations-ia.md` and the FACTS section "Verified 2026-08-28 — editor
- IA slice 4 seams".
-4. **Relocate `omnimirror`'s media** once the platter is mounted (131 GB off a 94%-full SSD).
-5. **Phase 6 Ollama `/ask`** — genuinely independent; a good parallel task.
-6. Decide `attribution-text`'s fate on that one channel: ~194,000 chunk-level calls is a
- sweep-sized commitment that was never priced.
-7. ~~**Unified-ops step 1**~~ — **DONE 2026-08-26**, `efb0cf9` → `00b1c8a`. Plan:
- [`unified-ops-step-1.md`](unified-ops-step-1.md); outcome: the dated entry below and the
- FACTS section "Verified 2026-08-26 — unified-ops step 1".
-8. ~~**Editor IA slice 3** (per-operation settings)~~ — **DONE 2026-08-26**, `9515083` →
- `43bb519`. Plan: [`editor-ia-slice-3.md`](editor-ia-slice-3.md); outcome: the dated entry
- below and "Slice 3, as shipped" in `editor-operations-ia.md`.
-9. ~~**Editor IA slice 7** (one pause)~~ — **DONE 2026-08-28**, `c924f73` → `685cba3`. Plan:
- [`editor-ia-slice-7.md`](editor-ia-slice-7.md); outcome: "Slice 7, as shipped" in
- `editor-operations-ia.md` and the FACTS section "Verified 2026-08-28 — editor IA slice 7
- seams". It is also **half of unified-ops step 5**: one definition and one writer among the
- controls, but the four settings fields are still four settings fields — step 6 moves the
- storage behind `isGateHeld`/`withGateHeld`.
-10. ~~**Editor IA slice 6** (the video page: one panel per operation)~~ — **DONE 2026-08-28**,
- `6986efc` → `d5ca90a`. Plan: [`editor-ia-slice-6.md`](editor-ia-slice-6.md); outcome:
- "Slice 6, as shipped" in `editor-operations-ia.md` and the FACTS section "Verified
- 2026-08-28 — editor IA slice 6 seams". The registry's per-video reader is
- `common/controller/videoOperations.ts`, and a fifth operation now needs no page.
-11. ~~**Editor IA slice 8a+8b** (sync is an operation; its settings and the workers' live on
- their pages)~~ — **DONE 2026-08-29**, `ea04b4e` → `fecac0f`. Plan:
- [`editor-ia-slice-8ab.md`](editor-ia-slice-8ab.md); outcome: "Slice 8a+8b, as shipped" in
- `editor-operations-ia.md` and the FACTS section "Verified 2026-08-29 — editor IA slice
- 8a+8b seams".
-12. ~~**The `/jobs` fold — the last third of slice 8**~~ — **DONE 2026-08-30**, `2226680` →
- `21feed3`. Plan: [`editor-ia-slice-8c.md`](editor-ia-slice-8c.md); outcome: "Slice 8c, as
- shipped" in `editor-operations-ia.md` and the FACTS section "Verified 2026-08-30 — editor
- IA slice 8c seams". The design question was answered **"a row is one job"** — and because
- it was, there is no mode: one list, live head and paged tail, one `<tr>` per job. Slice 8
- is complete.
-13. ~~**Editor IA slice 5** (Sites absorb the five)~~ — **DONE 2026-08-30**, `140212a` →
- `df9b839`. Plan: [`editor-ia-slice-5.md`](editor-ia-slice-5.md); outcome: "Slice 5, as
- shipped" in `editor-operations-ia.md` and the FACTS section "Verified 2026-08-30 — editor
- IA slice 5 seams". A site has tabs and the family page has the globals; the five satellite
- routes 307. **The nav is eleven** — the IA doc's end state — and the IA doc's UI slices are
- complete.
-14. ~~**The transcode operation**~~ — **REMOVED 2026-08-30**, `904f1a9` → `f717a36`. Plan:
- [`editor-transcode-removed.md`](editor-transcode-removed.md); census in FACTS "Verified
- 2026-08-30 — transcode: what it was, what stayed". The band question is closed by
- deletion; `EXTERNAL_BAND_IDS` is two — and since one-core 1.5 it is two because it is
- `EXTERNAL_OPERATIONS.map(o => o.id)`, so a third external pipeline would join the rail
- by being declared rather than by editing that constant.
-
-**Recommended next (editor IA).** The UI slices are done and the transcode band is no longer a
-candidate. What is left is **Phase 6** and **slice 9**, which is gated on the sweep running in
-production.
-
----
-
-### 2026-08-26 (late) — unified-ops step 1: the digest work list has one definition
-
-Three commits: `1db30c3` (the plan), `efb0cf9` (the deletion), `00b1c8a` (de-specialising the
-readers), plus this docs commit. Plan: [`unified-ops-step-1.md`](unified-ops-step-1.md);
-measurements in [`FACTS.md`](FACTS.md) under "Verified 2026-08-26 — unified-ops step 1".
-
-1. **The migration was already over, so the step was a deletion, not a rewiring.** All **68 of
- 68** snapshots on disk carry `backfill.digest` with a numeric `eligible` (`generatedAt`
- 08-11 → 08-26), so `digestWorkOf`'s `"bucket"` branch was reading nothing. **No rendered
- number moved.** The "published coverage percentage will change" warning in the step's own
- text had already happened, silently, between 08-11 and 08-26.
-2. **The two counters disagreed by 11,777 videos** (bucket 59,159 vs entry 47,382) and could
- not have been reconciled: on 65 of 68 channels the delta is exactly `deferred`, because the
- registry gates on a current `cues.json` and the bucket did not. Deleting the bucket is what
- makes there be one definition — the registry's `state()`, which is also what the runner
- dispatches from.
-3. **No regeneration, and no regen CLI.** Old snapshots keep a stray `noDigest` key until
- their next routine regen; `normalizeBuckets` picks only the keys it knows and there is no
- snapshot schema version. An offline writer would race the live editor's
- `snapshotScheduler` on the same files, and there is nothing it would need to do.
-4. **The `noDigest` view-model names were deliberately kept** — `DashboardChannel.noDigest`,
- the `/api/widget/actionable` wire field, `actionableNoDigestCount`, `DigestStage`'s
- `noDigestIds`. They mean "videos with no current digest", which is still what they hold;
- renaming a wire field is its own change. **Renamed in slice 4** (2026-08-28): the first
- three are `digestReachable` / `actionableDigestReachableCount`, because the number is the
- digest band's `reachable` and the honest name says so. `DigestStage`'s `noDigestIds` is
- untouched — it is a list of ids, not this count.
-5. **The transcode band was NOT taken with this step.** Three docs filed it "with step 1" only
- because both were thought to need one regeneration of the snapshots; step 1 needs none, so
- the coupling is void. It is its own snapshot-shape change (the writer recording a transcode
- population, `appliesTo(config)` and a kept-media denominator) and its own plan.
-6. **Digest is no longer special to any reader.** Four `id === DIGEST_OPERATION_ID` fallbacks
- went (`buildBands.ts`, `sweepPreview.ts` ×2, `sweepRecency.ts`). No entry now means for
- digest what it means for diarization: no work known, coverage unknown — an unfilled band
- outline, never a filled 0 %.
-
-**THE FINDING TO ACT ON: corpus-wide `deferred` is 16,156.** It was **1** on 2026-08-10, right
-after the normalize pass. `destiny` 3,869, `the-quartering` 3,762, `chibi-reviews` 2,699,
-`nux-taku` 1,802, `leaflit` 1,612, `kirsche` 1,197. That is 16,156 videos the digest lane will
-not touch, and it was invisible to a reader of the old bucket.
-
-> **Corrected 2026-08-27.** The "either accumulation or a regression" framing above was wrong
-> on both counts, and it is left here only because the census that settled it started from
-> these numbers. It was ONE ARMED BACKFILL SWEEP re-acquiring media on subtitle channels with
-> the channel's own subtitle-download config: metadata rewritten, no audio landed, cues stale
-> by mtime. Fixed in `fed4b01` / `ca42f7b`; the census and the file:line trail are in FACTS.md
-> under "Verified 2026-08-27 — why `deferred` was 16,156", and the operator runbook is item 2
-> of "Recommended next" above. The Digest card's **Normalize transcripts** button is still
-> what clears the 16,081 already on disk — deliberately NOT run from either slice.
-
----
-
-### 2026-08-26 (evening) — editor IA slice 3: an operation's settings are on its page
-
-Five commits: `9515083` (the plan, with the two uncommitted doc files), `f14ceb5` (the
-seams), `43bb519` (the move), `b303817` (copy, the `/settings` pointer, docs) and `7c34bc5`
-(the one collision the move created — see 6 below). The as-shipped record is in `editor-operations-ia.md`
-("Slice 3, as shipped") and the new file paths are in `FACTS.md` under the seams census;
-this entry is the decisions.
-
-1. **The markers were the deletion.** Four hidden `*FormPresent` inputs gated the four
- settings blocks, and every one existed because ONE form saved everything: an unchecked
- checkbox is absent from a FormData, so a submit from a form lacking a block would read
- that block's every switch as off — a disarmed corpus sweep, a dropped diarization capture
- lane, `allowRedownload` on against a full disk, ~194,000 model calls armed. One form per
- block makes that structural. 562 lines out of `SettingsForm`, 171 out of its action.
-2. **The lane block is per LANE, not per operation** (the decision recorded while scoping,
- and it held). `settings.backfill` governs `BACKFILL_QUEUE`, shared by diarization and both
- attribution operations, so `LaneSettingsForm` renders beside `SweepLane` in
- `SweepOperationView` — one definition, three renders, exactly where the shared pause and
- sweep already are.
-3. **`settingsBlock` is on the descriptor**, a closed union, switched over exhaustively —
- never a table keyed by operation id. Both attribution operations get one form because they
- declare one block. Same rule slice 2 set for `runner` and `sweepLaneIdFor`.
-4. **The `role="status"` boundary is now written down.** `SaveBar`'s "only role=status on
- this page" means RUNNER pages (`auto-subs-replace.spec.ts:415` depends on it); sweep-fed
- pages have settings forms with their own status regions and no policy tree.
-5. **Two blocks gained their first form-driving spec.** Attribution and the lane had none —
- which is how the most expensive switch in the console went untested from a browser. The
- new `operation-settings.spec.ts` also proves structurally what the markers used to buy:
- saving the diarization form beside the lane form leaves `backfill.enabled` alone. 7/7.
-
-6. **Moving a component moves its SENTENCES into someone else's selectors.** The lane form's
- paragraph still said "…so it lives with the plan it produces", and `The plan` is the
- heading of the sweep console now directly above it inside the same `section[data-lane]`.
- `backfill.spec.ts:484` scopes `getByText("The plan")` there and `getByText` matches
- substrings, so it resolved to two elements. Reworded, with a comment marking the phrase
- off-limits in that file. (The same commit keys the two server-built settings slots: an
- element created in a Server Component and rendered by a client component warns on React's
- dev key validation, naming a render method that did not create it.)
-
-Verified: tsc in all six packages, `common` 828/828, editor units 85/85, the new spec 7/7,
-and a fixture check of every operation page (digest → one form; diarization and both
-attribution pages → operation form then lane form; download/transcode/transcription → none;
-`/settings` down to its four remaining fieldsets and one `<form>`, carrying the pointer).
-The affected e2e specs ran twice: 104/107 then, after the fix, 28/28 on the three that had
-failed — two of those three (`auto-subs-replace.spec.ts:394`, `cadence-ui.spec.ts:212`) were
-timeouts and passed on a re-run untouched.
-
-Deliberately not done: the three other file-local `Field` copies; `WorkersField` (slice 8);
-the pause trio (slice 7); `/actionable` (slice 4). No persisted key or field `name` changed,
-and no route retired.
-
-### 2026-08-26 (later) — the vocabulary pass: the registry says "operation"
-
-Three commits after `e0703b4`, sized so the 60-file identifier sweep is reviewable on its own.
-The mapping table, the "unit" rule, the list of what deliberately still says "backfill" and
-the transcode-band boundary are in `FACTS.md` ("Verified 2026-08-26 — the vocabulary pass");
-this entry is the decisions.
-
-1. **Mechanical rename.** `backfillKinds.ts` → `operations.ts`, ~25 `Backfill*` exports →
- `Operation*`, tsc-verified, zero behaviour change. The rule: "backfill" survives where it
- names the LANE and its persisted contracts, goes where it named the kind. So
- `laneBackfillKinds` became `backfillLaneOperations` — the lane word moved to the front
- rather than vanishing, because once `Lane` is generic "the lane's operations" must say
- which lane. Persisted keys (`snapshot.backfill`, `settings.backfill`, `kindIds`,
- `sweepKinds`, the job kinds) are untouched; "kind" was not chased outside the export table.
-2. **The id spaces.** `StationId "backfill"` → `"speakers"` on `/channels`, with the label
- **derived** (`speakersLabel`, "Derived data" under default settings) rather than the
- literal "Speakers" — the same rule the stage title already follows, so a button never
- claims work its lane is not doing. `/actionable`'s section id → `speakers`, count column
- "reachable". `BackfillStage` → `SpeakersStage`, and its populations say "speakers" (15 spec
- lines). `PauseBackfillButton.tsx` deleted (zero importers). "unit" is one word: dispatch
- keeps it, cost is "cost basis", the `Figure({unit})` prop was a population label and says so.
-3. **`transcode` registered**, with the registry's first `appliesTo(config)` replacing three
- verbatim copies of `handling === "transcribe" && !!audioFormat`. `/operations/transcode`
- is the no-console panel slice 2 built. **Its band is not registered**: a snapshot carries
- no `handling`/`audioFormat`, so a pure band cannot tell "never transcodes" from
- "finished" — that waits for the snapshot writer to record it (unified-ops step 1).
- **Removed 2026-08-30** — see item 14 above.
-
-**Decisions worth keeping:**
-- **The station label is derived, not "Speakers".** `channel-stage-selection.spec.ts` pins
- "Derived data" as the honest fallback; `channel-groups.spec.ts` now asserts the same string
- on the group button.
-- **`backfill*Action` names stay** — `backfillChannelAction` and
- `start|stopBackfillSweepAction` run or gate the LANE, and their aria-labels
- (`pause backfill`, `start backfill sweep`) are asserted by specs that test the lane.
- (`pause|resumeBackfillAction` were named here too; **slice 7 deleted them** along with the
- other seven pause actions — the aria-labels stayed, which is the part that mattered.)
-- **Plans docs were not search-replaced.** They are dated history; FACTS carries the mapping
- and a line saying earlier sections are pre-rename.
-
-### 2026-08-25 — the editor gets its noun: `/operations`, and a nav with four groups
-
-**The backend found its organizing noun — the operation — and the UI had not.** Counted
-rather than estimated: 28 pages behind a 19-link nav whose "Pool" group held ten unrelated
-tools, four channel tables, four job lists, three renderings of lane state, and four
-different answers to "what needs doing". Digest and attribution are first-class in the
-REGISTRY and were second-class in the UI: no route, no stage, no per-video view, two settings
-fieldsets for one concept.
-
-[`editor-operations-ia.md`](editor-operations-ia.md) is the UI half of
-[`unified-operations-model.md`](unified-operations-model.md), written down whole — the four
-nouns (Corpus, Operations, Sites, Machine), the seven places "operation as the noun" honestly
-breaks and what to do about each, the nav end state, the reconciliations with unified-ops
-steps 5/6, PLAN.md Phase 11a and relocate-channel-media §6, and **nine slices, each
-shippable, each deleting something**.
-
-**Slice 1 shipped.** `git mv app/auto-queue app/operations`; `/operations` is the board (the
-rail, the arbiter, a sync row) and `/operations/<id>` is one operation, resolved against
-`operationCatalog()` so an unknown id 404s and a NEW registry entry gets a page with no route
-work. `/auto-queue` redirects. The **lane `<select>` is deleted** — with one lane per page
-there is no switch to lose policy-edit state across, which was the only reason the
-non-selected lanes stayed mounted. The runner section's ~1,200-line structural e2e contract
-survived the move verbatim (`RunnerOperationView.tsx` states every clause of it). Nav is four
-groups; *Monitor* left it (the widget is a projection of the board payload, reached from the
-dashboard's pipeline band).
-
-**Decisions worth keeping:**
-- **The sweep scope is NOT pre-ticked to the operation being viewed.** The scope is written
- at arm time, so a per-page default would arm a narrower sweep than the operator sees.
-- **A speaker operation's page draws its OWN band** (the shared panel could only say "this
- lane covers several operations"), and says in a sentence that the lane, sweep and pause are
- shared. A per-operation page is not a per-operation switch.
-- **The arbiter is the BOARD's control**, not a lane's — it decides *between* lanes.
-- **Retired routes redirect, never 404**, and the nav cap is umtool's rule, quoted in
- `nav.ts` so two consoles do not drift into two nav philosophies.
-
-**Recommended next** (supersedes the list under "Pre-sweep decisions", which still
-describes the reasoning):
-
-1. **GPU yield on a quiet box** — still the gate on arming the sweep, still unmeasured.
-2. **Unified-ops step 1**: collapse `noDigest` into `snapshot.backfill.digest` — the step
- Phase C skipped, and now the arbiter can act on the result.
-3. **Relocate `omnimirror`'s media** once the platter is mounted (131 GB off a 94%-full SSD).
-4. **Phase 6 Ollama `/ask`** — genuinely independent; a good parallel task.
-5. Decide `attribution-text`'s fate on that one channel: ~194,000 chunk-level calls is a
- sweep-sized commitment that was never priced.
-6. ~~**Editor IA slice 2**~~ — **DONE 2026-08-26**, see the section above. What it planned
- and what shipped differ in three places (`laneFor` is not universal, there is no single
- `OperationStage.tsx`, the backfill group button stayed the lane); the reasons are in
- [`editor-operations-ia.md`](editor-operations-ia.md).
-
----
-
-## Session 2026-08-12 — landed in `7d32438` on 2026-08-18
-
-See [`bakeoff/speakers-round1-notes.md`](bakeoff/speakers-round1-notes.md) and
-[`digest-context-review.md`](digest-context-review.md).
-
-**EVERY METRIC THE BAKE-OFF HAD WAS A DEFECT COUNTER.** `zeroYieldRate`,
-`chaptersPerHour`, `rejectionRate`, `maxGapSeconds`, `genericTitleRate`,
-`duplicateTitleRate` — all say how malformed the output is, none says whether a boundary
-is in the right place. `lib/boundaryScore.ts` (new, 12 unit tests) scores generated
-chapter starts against the **uploader's own chapter marks**, an oracle the model never
-sees. Boundaries are facts, so scoring against them reproduces nothing; the uploader's
-chapter *titles* are expression and are never scored against. The t=0 mark and
-boilerplate marks are dropped, and matching is one-to-one closest-pair-first so
-over-segmentation is punished rather than rewarded.
-
-**THE ORACLE IS FAR BIGGER THAN THE SPEAKER DATA IT WAS BUILT TO JUDGE.** Measured, not
-sampled: **14,923** video dirs carry a non-empty `chapters` array; **12,139** of those
-also have a transcript and >=4 marks, across **43 channels**. Nothing in the codebase read
-`metadata.info.json.chapters` before this. Against that, only **34** videos in the whole
-archive have audio + transcript + >=4 marks — the plan's figure, confirmed exactly,
-including its channel split.
-
-**FIRST BASELINE, FOR FREE, AND IT FOUND A BUG.** `--score-existing` scores digests
-already on disk with no model calls and no writes. Over the 15 scorable ones:
-**P@30 10.8%, R@30 26.1%, R@60 35.9%, F1@30 15.2%** across 153 uploader marks; per-video
-F1 spans 0–50%, so the metric discriminates. It immediately caught
-`omnibased/3fl_uRFXxLk`: video runs 0–5119 s, uploader marked throughout, digest emitted
-chapters only between 3184–4865 s — the head two-thirds unsummarized.
-
-**READ RECALL, NOT PRECISION — and there are now three samples proving it.** A generated
-run over a fresh 12-video / 8-channel sample at the production config
-(`chunk-local`/8192/600) gives **R@30 21.5%, P@30 5.6%, F1@30 8.8%**, median offset 109 s,
-163 marks, 87 chunks. Against the free `--score-existing` run (R@30 26.1%, P@30 10.8%) and
-a short/medium subsample (R@30 12.2%, P@30 20.8%): **recall stays in a narrow band across
-three samples sharing no videos, while precision swings 5.6%→20.8% on the same engine
-purely with the duration mix.** The digest targets 1 chapter/4 min, so on short videos it
-emits fewer boundaries than the uploader (24 vs 41) and on 8-hour VODs far more (149 vs
-9). F1 inherits the swing. **Compare candidates on recall with `chaptersPerHour` beside
-it**; a variant that "improves F1" by matching the sample's density has improved nothing.
-
-Same run's guard rails: 8.1% zero-yield, 14.8% rejection, 16.5% generic titles,
-47 s/audio-hour → 43.1 projected sweep days (same order as `digest-plan`'s 53.8).
-
-**THE SWEEP WAS PAYING AN 8× CONCURRENCY TAX.** The live `digest-channel-local` job was
-running at **~200 s/chunk against `MEASURED_SECONDS_PER_CHUNK` of 24.7** — `ollama ps`
-read `85%/15% CPU/GPU`, i.e. memory pressure had pushed the model mostly onto CPU
-(prefill ~43 tok/s). With the sweep and backfill paused and memory freed, the identical
-model loads **100% GPU**. The 53.8-day projection was on the order of 400+ days at the
-contended rate. This dwarfs every prompt-level improvement currently under discussion.
-
-**TWO PRODUCTION FILES TOUCHED, BOTH ADDITIVE, BOTH BYTE-IDENTICAL WHEN UNUSED, NO
-`PROMPT_VERSION` BUMP.** `transcriptToMarkdown.prefixForCue` (the speaker label must sit
-OUTSIDE the `[HH:MM:SS]` bracket — the prompt tells the model to copy those markers
-verbatim and `HMS_PATTERN` rejects an echo) and `ChapterPromptInput.speakerRoster`
-(deliberately NOT `contextNote`, which is per-channel and hashed into `contextHash`).
-The shipped lane sets neither, so sweep output is unchanged — the same argument that let
-`timestampMode` in at version 1. Both pinned by tests; 701/701 common tests pass, `tsc`
-clean in common/editor/export.
-
-**THE SPEAKER A/B DID NOT RUN, DELIBERATELY.** Sample built (`bakeoff/speaker-sample.json`,
-12 videos / 27.3 audio-h / 178 marks) and the pipeline proven end to end on one video, but
-the plan's own precondition — confirm the box is not loaded — failed: a second sherpa
-process alongside the operator's already-running `diarize-channel` took the box to
-**262 MB free, 14.1 GB swapped, memory-pressure full-stall 2.6%**. Stopped rather than
-corrupt both the operator's job and the bake-off beside it. Exact resume command is in
-the notes file.
-
-**WHAT THE ONE DIARIZED VIDEO SHOWS, AND IT IS NOT ENCOURAGING.** `shondo/OWuZuOrbQ10`:
-8 clusters → 3 speakers, 98.8% of cues labelled, speaker changes on 16.9% of cues,
-**prompt inflation only 4.4%** (well under the ~10% budgeted, because labels are emitted
-on speaker CHANGE only). But (a) the labels are ROLES — "Host", "Caller", "Interviewer" —
-so the title-quality half of the hypothesis is untestable on this material, there is no
-name to put in a title; and (b) they **invent speaker changes**, splitting one continuous
-narration across two labels. False changes are anti-signal for boundary detection. n=1,
-but both facts were invisible before the render existed, and both say the A/B must be
-read for harm as carefully as for benefit.
-
-**ELEVEN CHANNEL CONTEXT NOTES DRAFTED, NONE PROMOTED.** `digest-context.suggested.md` for
-the 11 heaviest channels by remaining sweep work (~113k of 188,269 chunks, ~60%). A note
-only reaches the prompt as `digest-context.md`, and only a human renames it — auto-applying
-model-authored context stays forbidden. `omnibased`'s note is the strongest: 11 of 150
-sampled descriptions carry the channel's OWN segment taxonomy (`AFK:`, `Chatting:`,
-`Gaming:`, `Clicking Links:`, `Watching:`, `Debate:` …), so that note transcribes the
-channel's vocabulary rather than inferring one. Provenance and a review checklist are in
-`digest-context-review.md`.
-
-**2026-08-09 (later)** — **Phase D step 1: the digest counters collapsed into the
-operation registry.** Branch `feat/digest-in-registry`, off a fast-forward merge of
-`feat/diarization-oom-wall` into `main` (8 commits, no conflicts).
-
-**THE DIGEST KIND'S `state()` WAS CALLED BY NOTHING, AND NOW IT IS THE ONLY DEFINITION.**
-`channelSnapshot` iterated `laneBackfillKinds()`, which excludes digest by queue key, so
-Phase C registered the operation and changed no number anywhere. It now iterates
-`allBackfillKinds()` — a work list the snapshot does not carry is a work list nothing can
-count, select or schedule, and that is the prerequisite for every later step.
-
-**THE HAZARD WAS REAL AND IS CLOSED BY DECLARATION, NOT BY AN ID CHECK.** Four surfaces summed
-`Object.values(snapshot.backfill)` on the assumption that the map WAS the backfill lane
-(`stageStatus.ts`, `loadActionable.ts` ×2, `api/widget/sync`). All four now use
-`laneEntriesOf()`, which filters on `lane.queueKey === BACKFILL_QUEUE` asked of the registry —
-so the next operation on its own lane does not re-arm the same trap. `backfill.spec.ts` has a
-spec that asserts BOTH halves: that `snapshot.backfill.digest` exists with the right ids, and
-that the Backfill card still reads 1 while the Digest card reads 2. Asserting only the second
-half would have passed vacuously if the entry were never written.
-
-**MEASURED, AND IT CONTRADICTS THE PLAN'S PREDICTION.** The plan expected the corpus digest
-count to RISE by ~1,530. It FALLS by 414, and the decomposition closes exactly:
-
-| | videos |
-| --- | --- |
-| old `noDigest` total (54 channels that have the bucket) | 75,613 |
-| + the 11 pre-bucket channels, now counted | +1,516 |
-| − newly `deferred` (no current `cues.json`) | −1,933 |
-| = new reachable | **75,199** |
-
-`deferred` is far larger than the plan assumed and it is CONCENTRATED: **`piratesoftware`
-alone has 1,683**, so 94% of that channel's 1,797-video apparent digest backlog was work
-`digestVideo` would have taken and immediately put back.
-
-**FOLLOW-UP, 2026-08-10 — the `deferred` bucket is now CLEARED, and the reason for it was
-wrong.** Splitting it by cause showed 1,942 videos with NO `cues.json` at all against 47
-genuinely superseded ones, so "the raw transcript changed underneath, and the normalize pass
-clears it" described 2.4% of the bucket and self-resolution described none of it: nothing
-automatic ever runs `normalizeTranscript` for a channel that downloads its subtitles. Fixed in
-`426ae51` — `isCuesJsonFresh` returns a `reason`, `normalizeAllTranscripts` takes
-`channelSlugs`, `normalize-transcripts` is a registered job kind, and the Digest card carries a
-**Normalize transcripts** button next to the count. Run over the 11 affected channels: **1,991
-written, 0 failed**; measured with the real `digest.state()` afterwards, corpus `deferred`
-**1,987 → 1** and reachable **75,406 → 77,392**, with `piratesoftware` going **~114 → 1,797**.
-`blocked` stayed at 1,626, unchanged, which is the point — those are waiting on transcription
-and normalize was never going to touch them. Full split and the `omnimirror` finding in
-FACTS.md. Everything else the plan stated held:
-`blocked` = **1,631** exactly (the untranscribed count), `eligible` = 78,885 of 78,963 videos,
-i.e. exactly **78** untranscribable. Coverage is **122** digested at the current identity.
-
-**COST GATE PASSED, SO THE OPTIMIZATION WAS NOT DONE.** `digest.state()` adds
-`isCuesJsonFresh()` per video: **0.34 ms/video** on a 125-video channel, **0.38 ms/video** on
-a 773-video one — 0.7x to 1.2x the `readVideoFiles` call the snapshot already pays, ~30 s
-across the whole corpus spread over 67 regenerations. `isCuesJsonFresh` re-lists a directory
-the caller already listed; folding that into `files.entries` is deliberately NOT done, because
-at this cost it would be an optimization with no measurement behind it.
-
-**A FIFTH STATE: `partial`.** Digests are generated per SECTION and `digestVideo` regenerates
-only the sections that are not fresh (`digestVideo.ts:158`), so "has chapters, needs tags" is
-a fraction of the cost of "has neither" and the two were both reported as `stale`. It is
-summed into `reachableBackfillWork` — the split is about what work COSTS, never about whether
-it is reachable — and it made the `never` check in `candidateAction` fire, which is exactly
-what that check is for. Not reachable on the live corpus today (`sections: ["chapters"]`), and
-it becomes the dominant case the moment the pre-sweep decision to enable tags lands: every
-already-digested video goes part-done at once, and without the split that reads identically to
-a `PROMPT_VERSION` bump that invalidated everything.
-
-**TWO THINGS THE PLAN GOT WRONG, CORRECTED IN PLACE:**
-
-- **`backfillSweep.ts:382` was never comparing on `" "`.** It already joins on a LITERAL NUL
- BYTE and was correct. The plan misread it because a raw NUL makes the file binary to `grep`
- — which is the actual defect. Both that line and `backfillBatch.ts:282` now use the
- `\u0000` escape (`digestSweep`'s form), so neither file needs `grep -a` any more.
-- **`present` is NOT available from `BackfillCounts`** — `addBackfillState` discards it by
- design, so the plan's "the registry now gives it directly" was false. Fixed by storing
- `eligible` (videos the operation had an opinion about) on `BackfillSnapshotEntry`, keeping
- the counts a pure work list; `presentBackfillWork()` derives present from it and returns
- **null**, never 0, on a snapshot that predates the field.
-
-**TWO LATENT DEFECTS FOUND ON THE WAY, BOTH FIXED.** `countBackfillWork` re-spelled the
-reachable rule instead of sharing it and had ALREADY drifted — it classified `blocked` and
-then counted it nowhere, so a channel of prerequisite-waiting videos reported three zeroes and
-read as finished. It now folds through `addBackfillState` + `reachableBackfillWork`. And the
-runtime backstop list in `backfillBatch.test.ts` was missing `"blocked"` — the one test whose
-job is to catch a state nobody wired up had itself missed one.
-
-**STEP 4 IS NOT DONE AND CANNOT BE DONE FROM HERE.** Regenerating the 66 snapshots only takes
-effect through an editor running this code, and the live editor on :3001 is a PRODUCTION build
-(`pnpm start`) serving the old one, currently supervising a diarization. It needs a restart on
-the new build, then a regen. The `noDigest` fallback in `digestWorkOf()` is what makes the
-interim safe: an un-regenerated channel reports its old bucket rather than reading as fully
-digested.
-
-> **STALE — corrected 2026-08-26.** It got done on its own. The live editor was restarted on
-> the new build some time after 08-10 and the snapshot scheduler regenerated the rest: **68 of
-> 68** snapshots carry `backfill.digest` (and a numeric `eligible`), `generatedAt` spanning
-> 08-11 → 08-26. So the fallback was reading nothing, and unified-ops step 1 deleted it along
-> with the bucket — see the 2026-08-26 (late) entry.
-
-**ALSO SHIPPED, ASKED FOR MID-SESSION: a diarization progress bar.** A `backfill` task got the
-DOWNLOAD parser, which matches nothing in diarization output, so a 40-minute windowed
-diarization showed an indeterminate bar while the job bar sat at "0/9 videos". `diarize-sherpa.py`
-was already printing `window 3/9 ... in 210.3s` and nothing read it.
-`createDiarizeProgressParser` turns that into a fraction plus an ETA measured from the windows
-already done, chained AHEAD of the download parser so a re-acquiring backfill keeps its
-download progress. Short files take the non-windowed path, print no per-window line, and stay
-indeterminate on purpose.
-
-**Coordination note:** NO pause was needed this time and none was taken. The plan's instruction
-to pause the backfill assumed a `next dev` server that hot-reloads; the live editor is
-`next start`, which serves a compiled build and cannot pick up source edits at all. The
-backfill sweep ran throughout (`sweepEnabled: true`), untouched, and `settings.json` was read
-but never written.
-
----
-
-
-**Previous session:** 2026-08-08 — **the OOM wall is gone, and it was removed rather
-than worked around.** Branch `feat/diarization-oom-wall`, four parts, all verified.
-
-**THE WALL: windowed diarization.** 6 of 10 videos over 6 hours were being killed by the
-kernel mid-run, ~40 minutes of CPU each, producing nothing. Two independent memory sinks,
-both now closed by the same change: `sherpa_onnx` clustering holds an O(n²) pairwise matrix
-over speech segments, and `subprocess.run(stdout=PIPE)` buffered the whole decoded stream.
-Long files are now processed in 45-minute windows (`--window-after-minutes 90`, `0` disables
-windowing) with per-window decode straight into a preallocated array. Cross-window identity
-is real, not hand-waved: each window's local speakers are reduced to an averaged, normalized
-`SpeakerEmbeddingExtractor` centroid and those are clustered globally with `FastClustering`
-at the same threshold. Both APIs verified live against the installed 1.13.4.
-
-| gate | result |
-| --- | --- |
-| (a) short file unchanged | **PASS** — `ObviousRises-rumble/v6z1o2g` re-ran byte-identical: 51 turns, 13 speakers, every non-volatile field equal, no `windowing` key |
-| (b) the file that OOM'd | **PASS** — `hasanabi/2834644359` (6h12m) completes: 3,433 turns, 96 speakers, 46 min, **peak RSS ~2.0 GB vs the 10.5 GB kernel kill** (`/proc/<pid>/status` VmHWM; GNU `time` is not installed) |
-| (c) quality | **PASS** — windowed vs whole-file on `v6z1o2g`: speech total **−0.1%**, identical wall-clock coverage, identity MORE concentrated (top-1 88.2% vs 73.1%, 6 speakers vs 13) rather than fragmented |
-
-**A REAL DEFECT WAS FOUND BY CHECKING, NOT BY READING.** The first seam merge joined only
-CONSECUTIVE turns in the sorted list, which silently leaves the same speaker overlapping
-THEMSELVES when two local speakers map to one global one — 35 self-overlaps and 24 sub-gap
-splits on the 6h12m file, which would double-count talk time in every downstream consumer.
-Now a per-speaker interval union; re-verified at 0 and 0. Cross-speaker overlap is left
-alone, because that is genuine overlapping speech the whole-file path emits too.
-
-**The cap shipped and is already switched off.** `settings.diarization.maxAudioHours` landed
-at 4h as the stopgap and now defaults to **0** — windowing removed the thing it was for. It
-stays as a knob for a smaller machine. Over-cap videos report as a new `deferred`
-`BackfillState`: a THIRD number, never summed into `reachableBackfillWork`, so a capped
-corpus can never read as finished. The dangerous line was `backfillBatch`'s candidate pull,
-which handled the states it knew and FELL THROUGH TO DISPATCHING everything else, with no
-exhaustiveness check anywhere in the repo. It is now a pure `candidateAction()` with a
-`never` default — a compile error instead of a silently-diarized six-hour video.
-
-**The detection bugs are fixed, and the fix is a shape, not a longer denylist.**
-`isRealAudioFile` / `isSourceMediaFile` / `isPartAudioFile` are anchored single-segment
-matches over `AUDIO_EXTS ∪ VIDEO_CONTAINER_EXTS`, in a new pure `common/lib/mediaFiles.ts`
-(`videoStatus.ts` re-exports, so no import site changed). An extension allowlist alone would
-NOT have been enough — this repo's own `audio.tmp-<pid>.<fmt>` carries a valid audio
-extension. Three more sites carried private copies of the old denylist and are folded in.
-Safety is provable: `audioFilesToRemove` is monotone in the predicate, so the delete set can
-only shrink.
-
-**THE MEDIA SCAN FOUND MORE THAN IT WAS WRITTEN FOR.** 953 media files across 68 channels in
-**83 seconds**, tier 1 only:
-- the known 4.0 GiB unreadable `nuxanor-kick/.../source-media.temp.mp4` (`moov atom not found`)
-- **3 zero-byte `audio.mp3`** in `leaflit-rumble` (`v6v9mq3`, `v6v9o25`, `v6v9r2r`) — these
- read as "downloaded", so the pipeline never re-fetches them, and `v6v9r2r` has a real
- `audio.aac` beside it that the mp3-first read preference would pass over. Newly visible.
-- **39 `transcript.m4a` in `community-notes`, 1.17 GiB** — audio under a name nothing in the
- app recognizes (not audio, not a subtitle: `SUB_FILE_RE` needs two segments). Present but
- invisible.
-- **7 duration mismatches** (up to 5h) awaiting the opt-in tier-2 decode.
-
-**STILL YOUR CALL, nothing done:** deleting anything the scan found; whether
-`community-notes`' 39 `transcript.m4a` files should be renamed into place (that is a WRITE to
-the corpus and it is not mine to make); and re-running the 4 previously-`failed` diarizations
-that were really `no-audio`.
-
-**One editor e2e spec is RED and it is NOT this branch's doing.**
-`auto-queue.spec.ts:208` ("strict priority") fails on a quiet box — and fails
-identically on `main` at `b6280a2`, checked by detaching to it and re-running. It is a
-race in the test, not in the app: `recordPick` fires at DISPATCH
-(`controller/autoRunner.ts:436`), so `picks.length === 4` means four videos were handed
-out, and the spec then asserts all four transcripts already exist on disk. Suite is
-449/451; the other red (`jobs-batch-tasks-drain.spec.ts:269`) passed on re-run and is a
-genuine flake.
-
-**Coordination note:** `settings.backfill.enabled` was set to false (the same field the Pause
-button writes) while `backfillKinds.ts` / `backfillBatch.ts` were edited, and restored after.
-A backfill job that was already running keeps the OLD code until it is stopped and started
-again — server modules hot-reload under `next dev`, but a job in flight holds its closure.
----
## Phase status
@@ -2198,10 +57,10 @@ of THAT plan, not of PLAN.md's phases above):
| One-core phase | Status | Notes |
| --- | --- | --- |
| 0 · Guardrails | **shipped** 2026-09-07 | |
-| 1 · One scheduler | **shipped**; gate A passed 2026-09-13, **gate B done 2026-09-23** | Records in `one-core-phase-1.md`. |
+| 1 · One scheduler | **shipped**; gate A passed 2026-09-13, **gate B done 2026-09-23** | Records in `one-core-phase-1.md` (archived: [`archive/acquisition-and-pipeline.md`](archive/acquisition-and-pipeline.md)). |
| 2 · One `ArchiveReader` | **shipped** (on `main` since 2026-09-13) | |
-| 3 · Views in the core | **COMPLETE 2026-09-24** (`main` @ `e172749b`) | Slices 1, 2, 4a, 3a, 4b, P, W, 3b. `one-core-phase-3.md`. Release 4 is not yet live. |
-| 4 · CLI, entry points, config, docs | **next** (after exports-off and Rumble) | `buildDeployCore.ts` imports nothing from `editor/**`; `settings-example.ts` and `file-schemas-docs.ts` carry `--check`; no `PUBLISH.md` yet. |
+| 3 · Views in the core | **COMPLETE 2026-09-24** (`main` @ `e172749b`) | Slices 1, 2, 4a, 3a, 4b, P, W, 3b. `one-core-phase-3.md`. Live since release 4. |
+| 4 · CLI, entry points, config, docs | **slices 1–3 shipped** (releases 6, 7, 11 — [`archive/releases.md`](archive/releases.md)) | The `archilyzer` CLI, `pnpm ops`, `PUBLISH.md`, OPERATING.md and the generated `COMMANDS.md`/`SETTINGS.md`/`SITE.md`/`CHANNEL.md` (`--check` gates) exist; the rest of the phase is unscheduled. (Corrected 2026-10-27.) |
| 5–6 | not started | |
**Three corrections to this document's own claims, verified against the code 2026-07-29.**
@@ -2322,8 +181,8 @@ temp at all, and it is the real candidate for later. The 188 orphan temps in `tr
are corpus files. They were left for the operator.
**Exports-off and Rumble are the next two items (2026-09-24).** Both were filed while release
-4 ran: [`site-exports-off.md`](site-exports-off.md) and
-[`rumble-sweep-pacing.md`](rumble-sweep-pacing.md). Neither was folded into release 4. Its
+4 ran: [`site-exports-off.md`](archive/sites-and-publishing.md) and
+[`rumble-sweep-pacing.md`](archive/acquisition-and-pipeline.md). Neither was folded into release 4. Its
slices were already cut, exports-off needs a five-site rebuild and deploy, and the Rumble fix
edits `runYtdlp.ts`, which W was touching.
diff --git a/plans/archive/acquisition-and-pipeline.md b/plans/archive/acquisition-and-pipeline.md
@@ -0,0 +1,71 @@
+# Archive — Acquisition, pacing, transcripts and the pipeline
+
+Fetching media politely, re-acquiring audio, the four-lane runner (one-core Phase 1), the stats cache and the e2e de-flake. Still-live plans of this kind stay in `plans/` because code cites them: [`pacing-guard.md`](../pacing-guard.md), [`channel-priority.md`](../channel-priority.md), [`live-capture.md`](../live-capture.md), [`one-core.md`](../one-core.md).
+
+Each entry is a finished plan or record, removed from `plans/` on 2026-10-27. The full text is in git: `git show <last commit>:<path>` (the commit named on the entry).
+
+### Attach dates — ISO dates in description.txt; `fillDates` (lane `lane/attach-dates`)
+
+`plans/attach-dates.md` — 47 lines, 2026-10-22 (`0c1db315`). Read it: `git show 0c1db315:plans/attach-dates.md`.
+
+Asked by the operator on 2026-10-22: the index logs "Skipping the-incredible-salt-mine/VcFA_LOnQoc: no upload_date" and "…/xLgf_MGQzXk: no upload_date" — "can we fix that?".
+
+### Root-cause the attribution batch hang
+
+`plans/attribution-batch-hang.md` — 183 lines, 2026-09-08 (`cc2433e1`) → 2026-09-08 (`65abc118`). Read it: `git show 65abc118:plans/attribution-batch-hang.md`.
+
+The de-flake job (2026-09-08, `a32612a`→`fea2996` on `one-core/phase-1`) fixed three of four e2e flakes. The fourth reproduces: `editor/e2e/attribution.spec.ts:349` "Run from the video page runs that video and no other" fails 1-2 in 10 under `--repeat-each 10`, waiting the full 90 s for the batch's closing "1 done" line. It runs through `runOperationBatch`, the runner Phase 1.2 introduced, so a batch that never …
+
+### Backfill re-acquire on subtitle channels — fetch audio, and keep the cues fresh
+
+`plans/backfill-reacquire-subtitle-channels.md` — 306 lines, 2026-08-27 (`1ba39522`). Read it: `git show 1ba39522:plans/backfill-reacquire-subtitle-channels.md`.
+
+**Every fact here was verified read-only against the tree at `9ffa437` (clean) and the real corpus on 2026-08-26/27.** Corpus-wide digest `deferred` is 16,156. A census with the real `isCuesJsonFresh` over all 78,128 transcribed video dirs: **16,081 `stale`** (cues.json older than a rewritten `metadata.info.json`; in 7,849 of those a re-fetched VTT too), 75 `missing`, 1 `no-meta`. The stale ones sit on eight …
+
+### De-flake the e2e suites
+
+`plans/deflake-e2e.md` — 218 lines, 2026-09-08 (`a32612ab`) → 2026-09-08 (`61eae055`). Read it: `git show 61eae055:plans/deflake-e2e.md`.
+
+Pinned to `d1acca7` (`one-core/phase-1`). Written 2026-09-08.
+
+### The whole-recording fetch downloads anyway, and every metadata rewrite keeps the old version
+
+`plans/full-fetch-forces-media.md` — 196 lines, 2026-09-26 (`555bc454`). Read it: `git show 555bc454:plans/full-fetch-forces-media.md`.
+
+Written 2026-09-26 (evening) in the fetch_clip session; anchors verified on `main` `151934e9` by one Explore pass. Rules: `plans/tools/implementer-rules.md` (one Opus implementer in a worktree, one read-only Opus review, the parent merges). Release 10 slice **N**; record in `plans/release-10.md` before `## Rollout`, shape of "Slice M, as shipped".
+
+### `fetch_clip` — the MCP asks the editor for clip media (no yt-dlp by hand)
+
+`plans/mcp-fetch-clip.md` — 307 lines, 2026-09-26 (`4ac32a2e`) → 2026-09-26 (`fa44984a`). Read it: `git show fa44984a:plans/mcp-fetch-clip.md`.
+
+Written 2026-09-26 in plan mode; self-contained for a fresh session. Anchors verified on `main` `c9223978` by two Explore passes and one Plan pass. Rules: `plans/tools/implementer-rules.md` (one Opus implementer in a worktree, one read-only Opus review, the parent merges). Memory to read first: `no-yt-dlp-by-hand`, `release-9-in-flight`.
+
+### One core — Phase 1: four lanes, one runner
+
+`plans/one-core-phase-1.md` — 1612 lines, 2026-09-07 (`7f294df7`) → 2026-09-23 (`b836ea8a`). Read it: `git show b836ea8a:plans/one-core-phase-1.md`.
+
+`plans/one-core.md` (committed on `one-core/phase-0`, seven commits, unmerged, e2e 511/511) is the umbrella. This is the slice-level plan for **Phase 1 — Dispatch: one scheduler**: finish `plans/unified-operations-model.md` steps 5 and 6 and delete what they retire, so one dispatcher owns every lane of media-derived work.
+
+### Re-acquired audio is handed to auto-transcribe, not deleted under it
+
+`plans/reacquire-handoff.md` — 395 lines, 2026-08-28 (`2afddd90`). Read it: `git show 2afddd90:plans/reacquire-handoff.md`.
+
+**Verified read-only against the tree at `da339a4` (clean) on 2026-08-27.** The previous slice (`fed4b01`, `ca42f7b`) made the backfill re-acquire land `audio.mp3` on an ASR-only `handling: "youtube"` video, diarize, then delete the audio in the `finally` at `backfillBatch.ts:684-693` (`buildCleanup`, `backfillReacquire.ts:257-290`; the only veto is `isDoNotClean`). Meanwhile `autoQueue.transcription` (enabled, …
+
+### Plan — a full sweep of a large Rumble channel must be paced, or it never completes
+
+`plans/rumble-sweep-pacing.md` — 84 lines, 2026-09-24 (`42caf3cc`) → 2026-09-24 (`7b50cb45`). Read it: `git show 7b50cb45:plans/rumble-sweep-pacing.md`.
+
+> **Superseded by `plans/release-5.md` slice R** (shipped on `one-core/r5-rumble`, 2026-09-24). The > release plan corrects this one: four arg-builders plus the unargued probe, not one `configArgs`; > impersonation for every Rumble spawn; a 429 mid-sweep is "incomplete" and falls back to the paged > walk. Kept for its 2026-09-24 findings; do not implement from it.
+
+### The stats cache key (fix, 2026-09-28)
+
+`plans/stats-cache-key.md` — 280 lines, 2026-09-28 (`6c7ff664`) → 2026-10-09 (`11cb1b09`). Read it: `git show 11cb1b09:plans/stats-cache-key.md`.
+
+Branch `fix/stats-cache-key` from `main` `ac438bbc`. **Merged `10cefd15` (2026-09-28). Rolled out with release 15** (the recount; the homepage at 77,547 transcripts on 2026-09-30, `release-15.md` "Rollout"). Verified in the tree 2026-10-09: the cache keys on `indexSignature` (`common/controller/buildStats.ts:119`), and `STATS_DOWNGRADE_ENV` (`:134`) guards a downgrade.
+
+### Plan: one YouTube video must not keep the whole platform in a 429 cooldown
+
+`plans/youtube-lane-pacing.md` — 167 lines, 2026-09-25 (`91d533a7`) → 2026-10-01 (`2ede037c`). Read it: `git show 2ede037c:plans/youtube-lane-pacing.md`.
+
+> "### Slice RL, as shipped" there).** A subtitle 429 — every YouTube 429 this file measured, and > all 78 of 2026-10-01's — no longer backs the platform off or defers the video: it is its own > class, `subs_rate_limit`, the download goes on to the media, and only the video's subtitles are > deferred. The "next lever" named below, honouring `sleepBetweenDownloadsSeconds` in the lane, is > built (plus an adaptive …
diff --git a/plans/archive/editor-ia.md b/plans/archive/editor-ia.md
@@ -0,0 +1,59 @@
+# Archive — Editor information architecture and the operations model
+
+How the editor's screens came to be organised around operations (IA slices 3–8ab, the `/channels` rack, the transcode removal, unified-ops step 1). The live design docs are still in `plans/`: [`editor-operations-ia.md`](../editor-operations-ia.md), [`unified-operations-model.md`](../unified-operations-model.md), and slice 8c [`editor-ia-slice-8c.md`](../editor-ia-slice-8c.md).
+
+Each entry is a finished plan or record, removed from `plans/` on 2026-10-27. The full text is in git: `git show <last commit>:<path>` (the commit named on the entry).
+
+### `/channels` rethink: one instrument, one deck
+
+`plans/editor-channels-rack.md` — 387 lines, 2026-09-13 (`64b55730`) → 2026-09-13 (`1bc87655`). Read it: `git show 1bc87655:plans/editor-channels-rack.md`.
+
+Pinned to `main` @ `a1058d0` (2026-09-13).
+
+### Editor IA slice 3 — per-operation settings live on the operation page
+
+`plans/editor-ia-slice-3.md` — 280 lines, 2026-08-26 (`95150834`). Read it: `git show 95150834:plans/editor-ia-slice-3.md`.
+
+The vocabulary pass landed 2026-08-26 (`02ff048` → `32950aa`): the registry is `operations.ts`, says `Operation`, and every UI id space says "speakers". The user chose **slice 3 over unified-ops step 1** as the next piece (recorded in `plans/STATE.md` "Recommended next" #6 and in memory). Step 1 follows it.
+
+### Editor IA slice 4 — `/actionable` dissolves
+
+`plans/editor-ia-slice-4.md` — 470 lines, 2026-08-28 (`a623958c`). Read it: `git show a623958c:plans/editor-ia-slice-4.md`.
+
+**Verified read-only against `184cb9f` (clean) on 2026-08-28.** `/actionable` is the fourth answer to "what needs doing" (`plans/editor-operations-ia.md:21`): one 696-line page (`editor/app/actionable/page.tsx`) rendering ten `SectionConfig`s from a literal array (`:92-321`) plus two hand-written sections (`DuplicatesSection :421-475`, `MediaScanSection :356-419`), behind a hand-exhaustive `nothingPending` gate …
+
+### Editor IA slice 5 — Sites absorb Charts, Search aliases, Deploy, Build and Homepage: a site has tabs, the family page has the globals
+
+`plans/editor-ia-slice-5.md` — 1106 lines, 2026-08-30 (`5660fae0`). Read it: `git show 5660fae0:plans/editor-ia-slice-5.md`.
+
+**Verified read-only against `2a8081e` (clean) on 2026-08-30**, the commit that closed slice 8c. The census is the appendix of this file (three exploration reports, every file:line re-checked at this sha); the findings cite it as "census (a)/(b)/(c)". A `duplicates-page` worktree exists (`git worktree list`) — another session commits into this checkout.
+
+### Editor IA slice 6 — the video page: one panel per operation
+
+`plans/editor-ia-slice-6.md` — 575 lines, 2026-08-28 (`6986efcd`). Read it: `git show 6986efcd:plans/editor-ia-slice-6.md`.
+
+**Verified read-only against `ce2ebd9` (clean) on 2026-08-28.** Slice 6 is the IA doc's bullet (`plans/editor-operations-ia.md:151-156`): `DigestPanel.tsx` generalizes to an `OperationPanel` built per enabled kind from `readVideoFiles()`; `hasDigest()` and `hasAttribution()` go; attribution and diarization get a per-video view for free; the "Open in umtool" link (`VideoPanel.tsx:219-231`, `data-umtool-link`) stays …
+
+### Editor IA slice 7 — one pause
+
+`plans/editor-ia-slice-7.md` — 377 lines, 2026-08-28 (`c924f735`). Read it: `git show c924f735:plans/editor-ia-slice-7.md`.
+
+**Verified read-only against `494cbee` (clean) on 2026-08-28.** Slice 7 is the IA doc's bullet (`plans/editor-operations-ia.md:157-161`): `Pause{Downloads,Transcriptions,Backfill}Button` → one button, "the six actions" → one pair, the polarity normalization in `laneState.ts` goes, **keep the aria labels**. Its reconciliation (`:87-91`) fixes the definition: *"pause operation X" = "pause the root of the tree that …
+
+### Editor IA slice 8a+8b — sync is an operation; its settings and the workers' live on their pages
+
+`plans/editor-ia-slice-8ab.md` — 655 lines, 2026-08-29 (`b8c485b0`). Read it: `git show b8c485b0:plans/editor-ia-slice-8ab.md`.
+
+**Verified read-only against `6f6c307` (clean) on 2026-08-29.** This is the Sync and Workers thirds of the IA doc's slice 8 (`plans/editor-operations-ia.md:168-171`); the `/jobs` + `/jobs/active` + `/jobs/queue` fold is a later plan of its own. The noun-model row for Sync (`:57`): an operation, channel-scoped and cadence-triggered; `OperationDescriptor` gains `scope` and `trigger`; it gets a board row and …
+
+### The slice-5 leftovers, then the transcode operation is removed: it never fired in production
+
+`plans/editor-transcode-removed.md` — 541 lines, 2026-08-31 (`de3149e4`). Read it: `git show de3149e4:plans/editor-transcode-removed.md`.
+
+**Verified read-only against `f3b187a` (clean) on 2026-08-30/31**, the commit that closed slice 5. Every file:line was re-read at this sha by the design pass; where the initial brief's anchors or wording were off, a finding says so. The `duplicates-page` worktree exists (HEAD `7baef40`, merge-base `43bb519`) — another session commits into this checkout.
+
+### Unified-ops step 1 — the digest work list has one definition
+
+`plans/unified-ops-step-1.md` — 277 lines, 2026-08-26 (`1db30c3a`). Read it: `git show 1db30c3a:plans/unified-ops-step-1.md`.
+
+`plans/unified-operations-model.md` step 1: "Collapse the counters. `snapshot.backfill.digest` replaces `noDigest`." It is the step Phase C skipped, `plans/STATE.md` "Recommended next" #2, the piece `plans/editor-ia-slice-3.md` named as what follows, and **the dependency IA slice 4 (`/actionable` dissolves) is waiting on**. Slice 4 wants what a flat id list cannot carry — the per-state split (`blocked`, `deferred`, …
diff --git a/plans/archive/releases.md b/plans/archive/releases.md
@@ -0,0 +1,293 @@
+# Archive — Releases 5–32 and 37, and what landed between them
+
+One entry per finished release record (and its lane records). Releases still cited by code stay in `plans/`: [`release-8.md`](../release-8.md), [`release-13.md`](../release-13.md), [`release-14.md`](../release-14.md), [`release-15.md`](../release-15.md), [`release-17.md`](../release-17.md), [`release-18.md`](../release-18.md), [`release-27.md`](../release-27.md) and the cited lane files of releases 32, 37 and 38. What each release changed for users is in the CHANGELOGs (`editor/`, `export/`, `homepage/`).
+
+Each entry is a finished plan or record, removed from `plans/` on 2026-10-27. The full text is in git: `git show <last commit>:<path>` (the commit named on the entry).
+
+### Release 5 — Rumble un-broken, visitor exports off per site, then ONE rollout
+
+`plans/release-5.md` — 486 lines, 2026-09-24 (`f4da04a9`) → 2026-09-25 (`0032ed8a`). Read it: `git show 0032ed8a:plans/release-5.md`.
+
+Cut 2026-09-24 (late evening) off `main` `8b7f8924` (code `e172749b`, one-core Phase 3 complete). Two parallel slices with no file overlap, merged **R → X**, then one editor restart at the END (release 3 and 4 rolled the previous release out as a prelude; release 5 rolls out last because R is what un-breaks Rumble syncing and the operator should not wait a release for it). The owed one-sync md5 sweep rides along …
+
+### Release 6 — follow-ups + Phase 4 slice 1
+
+`plans/release-6.md` — 108 lines, 2026-09-25 (`5f197e10`) → 2026-09-25 (`153869e1`). Read it: `git show 153869e1:plans/release-6.md`.
+
+`main` at `93dcb532` (release 5 merged: slice R, Rumble; slice X, visitor exports off). Release 5 is live. This release clears release 5's "found and left" items and Phase 3's deferred items, then lands Phase 4 slice 1.
+
+### Release 7 — YouTube lane pacing + the archilyzer CLI, then ONE rollout (releases 6 + 7)
+
+`plans/release-7.md` — 814 lines, 2026-09-25 (`6ee1d336`) → 2026-09-25 (`fd0ea5f5`). Read it: `git show fd0ea5f5:plans/release-7.md`.
+
+Written 2026-09-25 morning on `main` `0032ed8a`. Verified by three Explore passes and one design pass; anchors are on `0032ed8a`. Operator decisions (2026-09-25): release 6 is NOT rolled out on its own; release 7 = two parallel slices + one rollout at the end that brings 6 + 7 live, editor restart AND umtool rebuild + restart; scope = pacing slice + CLI slice (Phase 4 slice 2 + the rest of spec item 1 + hub deploy …
+
+### Release 9 — four fixes behind one restart
+
+`plans/release-9.md` — 683 lines, 2026-09-25 (`1ee6f972`) → 2026-09-25 (`351267f1`). Read it: `git show 351267f1:plans/release-9.md`.
+
+`main` at `9247211e`, release 8 live on :3001 since 2026-09-25 14:43. Release 9 is the four small bugs the release-8 rollout found on the live editor, batched so they cost one editor restart: a queued job that ends `failed` after doing its work, a 30 s sleep after every video the download filter declined, YouTube with no request-level pacing, and a `/jobs` page that calls a slow scan stuck and keeps restart-orphaned …
+
+### Release 10 — the brand: the Found-line mark, and base × accent reader themes
+
+`plans/release-10.md` — 2282 lines, 2026-09-26 (`5a433aa9`) → 2026-09-28 (`9d441510`). Read it: `git show 9d441510:plans/release-10.md`.
+
+`main` at `c9223978` (release 9 live on :3001 since 2026-09-25 19:40 as `0213f6c8`; C1b/C2/C3 deployed to the hub and the homepage the same evening). Release 10's first content is the brand the operator asked for on 2026-09-25: one mark and one wordmark for Archilyzer and every official site, and a reader theme made of two independent choices, a **base** (System / Light / Sepia / Dark) and an **accent** (the site's …
+
+### Release 11 — release 10's follow-ups, the homepage deploy from `/sites`, umtool's brand fonts, one-core Phase 4 slice 3
+
+`plans/release-11.md` — 1930 lines, 2026-09-28 (`2162db92`) → 2026-09-28 (`e56101fd`). Read it: `git show e56101fd:plans/release-11.md`.
+
+`main` at `ee9d41fa` (release 10 fully rolled out as 0.9.4 on 2026-09-28 at 00:53: the five sites, the hub `10d6946f` and the homepage `7ca70923`; the :3001 editor restart is still owed). Release 11 is the overnight session of 2026-09-28, which the operator asked for with all four candidate bundles: the lows left by release 10, the homepage deploy from `/sites` ([`homepage-deploy-from-ui.md`]), umtool's brand fonts, …
+
+### Release 12 — the source mirror: a read-only git clone on the project site
+
+`plans/release-12.md` — 1007 lines, 2026-09-28 (`c3177eeb`) → 2026-10-09 (`7414eee7`). Read it: `git show 7414eee7:plans/release-12.md`.
+
+`main` at `90c7f776` (release 11 merged in full and NOT rolled out: the cut, the :3001 restart, a settings save and the deploys are still owed by the operator, `release-11.md` "Rollout"). Release 12 is the operator's ask of 2026-09-27: the repo mirrored on the project site (https://archilyzer.pages.dev) as static, read-only files — `git clone https://archilyzer.pages.dev/source/archilyzer.git` over git's dumb-HTTP …
+
+### Release 16 — what a search reads
+
+`plans/release-16.md` — 1281 lines, 2026-09-30 (`6c6dcd04`) → 2026-10-01 (`03be31b5`). Read it: `git show 03be31b5:plans/release-16.md`.
+
+`main` at `9a259787` (releases 14 and 15 merged and rolled out). No plan file of its own: each slice's prompt carries its ruling, and this record carries what was built. Rules: `plans/tools/implementer-rules.md`, with the commit trailer this release's prompts give.
+
+### Release 19 — agents run the archive (ops, CLI and MCP; machine safety; the operator's guide)
+
+`plans/release-19.md` — 713 lines, 2026-10-09 (`11cb1b09`) → 2026-10-10 (`88c767ec`). Read it: `git show 88c767ec:plans/release-19.md`.
+
+Written 2026-10-09 from the "next batch" plan (releases 19–22), against `r18/integration` `4cffda3f` (release 18 complete, `main` `e921f82f` merged in). Rules: `plans/tools/implementer-rules.md` — three parallel Opus implementers, one per track, each in its own worktree branched from `4cffda3f`; the parent merges each track into `r19/integration` `--no-ff` on a clean tree, then fast-forwards `main`; records state …
+
+### Release 20 — the data model and the index (recorded dates, Twitch ids, the caption-track bug closed)
+
+`plans/release-20.md` — 259 lines, 2026-10-09 (`11cb1b09`) → 2026-10-10 (`54e9e8bf`). Read it: `git show 54e9e8bf:plans/release-20.md`.
+
+Written 2026-10-09 from the "next batch" plan (releases 19–22), against `r18/integration` `4cffda3f`. Track A's, after release 19 ([`release-19.md`]); small. Rules: `plans/tools/implementer-rules.md` and release 19's rules line, unchanged. Record file: this file (shape of `plans/release-18.md`).
+
+### Release 21 — playable archives: local media for held videos, WebTorrent playback on the sites
+
+`plans/release-21.md` — 434 lines, 2026-10-09 (`5bc20d32`) → 2026-10-10 (`e6c229e9`). Read it: `git show e6c229e9:plans/release-21.md`.
+
+Written 2026-10-09. Pilot: the TISM (The Incredible Salt Mine) v1 torrent archive → `the-incredible-salt-mine` (a Jeralyzer member channel). Two outcomes:
+
+### Release 22 — one article, two shapes: slides, and the isometric overview
+
+`plans/release-22.md` — 260 lines, 2026-10-09 (`fdbdd370`) → 2026-10-09 (`09f1a7d1`). Read it: `git show 09f1a7d1:plans/release-22.md`.
+
+Written 2026-10-09. An article (a `report.json`) can be read as the article it is, as a slide deck, or in an **isometric overview** that lays the two side by side in one tilted 3-D plane — each section beside its slide — so a reader sees the same article both ways and enters whichever they prefer at the same place.
+
+### Release 23 — cited-only channels, and the overnight's owed fixes (daytime 2026-10-10)
+
+`plans/release-23.md` — 224 lines, 2026-10-10 (`d3296bab`) → 2026-10-10 (`7c478f4a`). Read it: `git show 7c478f4a:plans/release-23.md`.
+
+Written 2026-10-10 against `main` `43e684bb` (release 20 live), on `r23/integration`. Rules: `plans/tools/implementer-rules.md`, AGENTS.md (no session trailers or links, the 6 GB floor and `pnpm heavy`, no hand edits to `transcripts/**`, private stays private). Record file: this file for Lane 2 and the batch; Lane 1's slices record in the files their table names.
+
+### Release 24 — hygiene and e2e speed (daytime 2026-10-10, added by the operator mid-batch)
+
+`plans/release-24.md` — 272 lines, 2026-10-10 (`72c44159`) → 2026-10-10 (`6e356bc5`). Read it: `git show 6e356bc5:plans/release-24.md`.
+
+Written 2026-10-10 on `r24/integration` from `r23/integration` `70539aa2` (release 23, being gated). Rules as release 23 (`plans/tools/implementer-rules.md`, AGENTS.md). Lanes run while release 23 gates and rolls out; release 24 gets its own gate round and rollout. Record file: this file.
+
+### Release 25 — local text-to-speech: narration for report videos, and podcasts
+
+`plans/release-25.md` — 387 lines, 2026-10-11 (`9d805472`) → 2026-10-11 (`515a9ac7`). Read it: `git show 515a9ac7:plans/release-25.md`.
+
+Drafted 2026-10-10 (evening) on the operator's ask ("good local AI text to speech for videos or podcasts made from Archilyzer"). Rulings: **bake-off first, then build; stock voices only** — no voice cloning of anyone, no reference-audio prompting with a real person's voice; every output discloses a synthetic voice. **Engine + voice (ruled 2026-10-11, by ear from the bake-off `~/reports/tts-bakeoff/index.html`): …
+
+### Release 28 — the remaining media tasks, generation quality, follow-ups and housekeeping
+
+`plans/release-28.md` — 1054 lines, 2026-10-13 (`bd0252ee`) → 2026-10-14 (`3f7f5ad9`). Read it: `git show 3f7f5ad9:plans/release-28.md`.
+
+Status: **LIVE 2026-10-14** — all slices but M8 (it waits for the operator's bench bar) merged, gated and rolled out; the live smoke's five fixes on `main`.
+
+### Release 29 — evidence gaps, verdicts round 2, generation round 2, debts
+
+`plans/release-29.md` — 780 lines, 2026-10-15 (`3cce2ad1`) → 2026-10-15 (`59fdc486`). Read it: `git show 59fdc486:plans/release-29.md`.
+
+Status: **in flight** — S0 done; phase 1 lanes A (E1 → E2), B (V1 → M8 code), C (G1 → G2 → D1).
+
+### Release 30 — corrupt-source recovery, the frame scan, verdict bench v3
+
+`plans/release-30.md` — 31 lines, 2026-10-15 (`3ef1b558`). Read it: `git show 3ef1b558:plans/release-30.md`.
+
+Lanes run after release 29 shipped (2026-10-15), each from a brief; the per-lane records are in `plans/release-30/`.
+
+### Release 30 lane V — the verdict bench, v3
+
+`plans/release-30/V.md` — 94 lines, 2026-10-15 (`ec5b8726`) → 2026-10-17 (`cb9b2fdc`). Read it: `git show cb9b2fdc:plans/release-30/V.md`.
+
+The diagnosis of bench v2's disagreements, and the fixes it called for. No real model call was made: the qwen runs are the orchestrator's (the transcription lane and the memory floor held the GPU the whole session). The commands are at the end of this section.
+
+### Release 30, lane P follow-up: the frame derivation (`r30/frame-derive`)
+
+`plans/release-30/frame-derive.md` — 64 lines, 2026-10-15 (`9a2c4754`). Read it: `git show 9a2c4754:plans/release-30/frame-derive.md`.
+
+The first live scan (`v7gkv5w`, 1,139 readings, $4.06 on Haiku 4.5) read well and derived badly: 26 tournaments where there is one, false double-ups from mid-hand dips, a final table from a table's seat count, stacks of 730 BB from a misread big blind, six "won" banners on other players' hands. The readings were kept; only the derivation changed, and a re-derive brings the sidecar up to date with no model call.
+
+### Release 30, lane P: the frame scan (`r30/frame-scan`)
+
+`plans/release-30/frame-scan.md` — 102 lines, 2026-10-15 (`06dfb4a4`). Read it: `git show 06dfb4a4:plans/release-30/frame-scan.md`.
+
+The operator's ask (2026-10-15): scan a stream on the Jeralyzer, break it into frames and analyse them for a poker tournament's progress, toward a supercut with a stats overlay. First stream: `the-quartering-rumble/v7gkv5w` (3:45:54, 1920×1080, the saved container `original`).
+
+### Release 30, lane Q — corrupt-source recovery (as shipped)
+
+`plans/release-30/q.md` — 125 lines, 2026-10-15 (`ebd2d95f`) → 2026-10-15 (`040155cf`). Read it: `git show 040155cf:plans/release-30/q.md`.
+
+Branch `r30/corrupt-recovery` from `main` `59fdc486`. Brief: `r30q-brief.md` (the plan of record for this lane). FACTS: "Release 30 lane Q: corrupt-source recovery".
+
+### Release 31 — mirrors, find a copy of every gone video, the audio audit, the poker overlay
+
+`plans/release-31.md` — 44 lines, 2026-10-16 (`0e892d97`). Read it: `git show 0e892d97:plans/release-31.md`.
+
+Lanes run overnight 2026-10-16 after release 30, each from a brief; the per-lane records are in `plans/release-31/`.
+
+### Release 31, lane A — the audio-integrity audit (as shipped)
+
+`plans/release-31/audio-audit.md` — 67 lines, 2026-10-16 (`ddddd4f7`). Read it: `git show ddddd4f7:plans/release-31/audio-audit.md`.
+
+Branch `r31/audio-audit` from `main` `3ef1b558` (`main` `c9ec3bc8` and then `1ed16ffc` — lanes C, P3, D — merged in before the final gates). Brief: `r31a-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane A: the audio-integrity audit".
+
+### Release 31, lane C — find a copy of every gone video (as shipped)
+
+`plans/release-31/find-copy-all.md` — 96 lines, 2026-10-16 (`72ef6f75`). Read it: `git show 72ef6f75:plans/release-31/find-copy-all.md`.
+
+Branch `r31/find-copy-all` from `main` `3ef1b558`. Brief: `r31c-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane C: a gone video's whole audio from a copy".
+
+### Release 31, lane D — a mirror channel and the creator it copies (as shipped)
+
+`plans/release-31/mirrors.md` — 94 lines, 2026-10-16 (`13c64b18`). Read it: `git show 13c64b18:plans/release-31/mirrors.md`.
+
+Branch `r31/mirrors` from `main` `3ef1b558` (`main` `c9ec3bc8`, lane C, merged in before the final gates). Brief: `r31d-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane D: a mirror channel and the creator it copies".
+
+### Release 31 — the audio check on every Odysee download, clip windows included (as shipped)
+
+`plans/release-31/odysee-integrity.md` — 20 lines, 2026-10-16 (`28b85792`). Read it: `git show 28b85792:plans/release-31/odysee-integrity.md`.
+
+Operator ask (2026-10-16): Odysee downloads with cookies from the browser, and always through the audio-integrity pipeline; try to salvage clip downloads before grabbing whole streams. Ruling: a window gets the pipeline's final probe (the periodic `.part` probe has nothing to do on seconds of media) and one re-fetch.
+
+### Release 31, lane P3 — poker events and the stats overlay (as shipped)
+
+`plans/release-31/poker-overlay.md` — 117 lines, 2026-10-16 (`a9c5698a`) → 2026-10-16 (`8b067449`). Read it: `git show 8b067449:plans/release-31/poker-overlay.md`.
+
+Branch `r31/poker-overlay` from `main` `3ef1b558` (main `c9ec3bc8` merged in before the last gates). Brief: `r31p3-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane P3: poker highlight events, the frames-cut budget, the `stats` region".
+
+### Release 31 — respellings: a transcript's mis-hearing corrected in an article's quotes (as shipped)
+
+`plans/release-31/respell.md` — 28 lines, 2026-10-16 (`39026c6e`). Read it: `git show 39026c6e:plans/release-31/respell.md`.
+
+Operator ask (2026-10-16): the cornbreadman article's quotes carry "cake cup"/"cakeup" for K-Cup; correct the text in the article as an operation that can be previewed. Ruling: bracketing is per respelling and OFF by default (an obvious correction reads plainly); `--bracket` marks an altered quote `[K-Cup]`.
+
+### Release 32 — the UI works without AI, and Docker is the first-class install
+
+`plans/release-32.md` — 70 lines, 2026-10-16 (`d4c562ff`) → 2026-10-17 (`712574f5`). Read it: `git show 712574f5:plans/release-32.md`.
+
+The operator's rules (2026-10-16): "Prioritize the ability to be able to do as much as possible with the UI outside of AI in situations where the compute becomes hard to come by", and "make it as easy as possible for anyone to use all the features of Archilyzer — Docker is a core component of that". Four lanes from briefs; records in `plans/release-32/`.
+
+### Release 32 lane R2 — by hand, no model (as shipped)
+
+`plans/release-32/by-hand.md` — 89 lines, 2026-10-16 (`b3300e06`). Read it: `git show b3300e06:plans/release-32/by-hand.md`.
+
+Operator rule (2026-10-16): every step a model can do, a person can do in the UI, with no model. An audit found six gaps in umtool; this lane closes them. Nothing here calls a model.
+
+### Release 32 lane R11 — three e2e failures over release 32 (as shipped)
+
+`plans/release-32/e2e-fixes.md` — 82 lines, 2026-10-17 (`9dfa66e3`). Read it: `git show 9dfa66e3:plans/release-32/e2e-fixes.md`.
+
+Three specs failed on `main` in the full suites of 2026-10-17 and passed alone in their lanes. One was the product (a newer rsync), two were umtool specs that depended on another spec's fetch.
+
+### Release 32 lane R7 — full Odysee downloads read the way the player reads (as shipped)
+
+`plans/release-32/odysee-ranged.md` — 113 lines, 2026-10-17 (`e27aa872`). Read it: `git show e27aa872:plans/release-32/odysee-ranged.md`.
+
+Measured (2026-10-16): Odysee answers yt-dlp with 429 — its lookup API and its own fetch of the stored original-file URL — while the player's ranged GETs of `player.odycdn.com/v6/streams/<claim>/<sd>.mp4` (Referer/Origin odysee.com, a browser user agent, no cookies) get 206; the CDN allows one new original file after a rest. The clip-window path already cuts that way (R5); full downloads (transcribe handling, audio) …
+
+### Release 32, lane R3 — every operation has a button, in the editor (as shipped)
+
+`plans/release-32/ops-buttons.md` — 111 lines, 2026-10-16 (`1be43740`). Read it: `git show 1be43740:plans/release-32/ops-buttons.md`.
+
+Branch `r32/ops-buttons` from `main` `977917c7`. Brief: `r32r3-brief.md` (the plan of record for this lane). FACTS: "Release 32 lane R3: every operation has a button" (and the Configure-form line of "The audio check's reach").
+
+### Release 32 lane R6: the owed UI (as shipped)
+
+`plans/release-32/owed-ui.md` — 94 lines, 2026-10-16 (`459da969`). Read it: `git show 459da969:plans/release-32/owed-ui.md`.
+
+Branch `r32/owed-ui` from `main` `23ea764b`. Brief: `r32r6-brief.md` (the plan of record for this lane). FACTS: "Release 32 lane R6: the owed UI".
+
+### Release 32 lane R10 — a stored-URL download survives mid-file network drops (as shipped)
+
+`plans/release-32/ranged-resume.md` — 111 lines, 2026-10-17 (`a0c43ee5`). Read it: `git show a0c43ee5:plans/release-32/ranged-resume.md`.
+
+Observed live (2026-10-17, one 3.3 GB Odysee file): the page opened (18 s, the player's reads 200/206), the ranged 8 MiB reads ran ~4 min to 344 MB, then `the ranged read at 343932928 failed: fetch failed` (undici, no HTTP status). The resume (page reopened) restarted at the last probed-clean byte, 277 MB, read ~100 MB in under a minute, and failed the same way at 377 MB. R7 reopened the page only on a 429; a …
+
+### Release 32 lane R1 — verify by playing the citation: the cited clip, the audition deck, the article's checks (as shipped)
+
+`plans/release-32/review-player.md` — 82 lines, 2026-10-16 (`caed44ee`) → 2026-10-16 (`0955a036`). Read it: `git show 0955a036:plans/release-32/review-player.md`.
+
+Operator asks (2026-10-16): "can we not play the citation audio in the umtool review screen? We should be able to play the video, even, to verify it — that's the only point it should need to hit a human"; then, for the drafts review, "similarly to a mobile app like Tinder … move fast when auditing clips … the perfect mix of AI heavy lifting with a human auditing ear". The release rule: every step a model can do, a …
+
+### Release 32 lane R8 — the operator's rulings of 2026-10-17 (as shipped)
+
+`plans/release-32/rulings.md` — 136 lines, 2026-10-17 (`cb9b2fdc`) → 2026-10-17 (`d135dee1`). Read it: `git show d135dee1:plans/release-32/rulings.md`.
+
+Branch `r32/rulings` from `main` `eb8d9523`. Brief: `r32r8-brief.md` (the plan of record for this lane). FACTS: "Release 32 lane R8: the operator's rulings of 2026-10-17", plus the rulings recorded in place under "Release 30 lane V" and "Release 31 lane C".
+
+### Release 32 — every feature in Docker, and both modes as services (as shipped)
+
+`plans/release-32/services.md` — 95 lines, 2026-10-16 (`ed7d425b`). Read it: `git show ed7d425b:plans/release-32/services.md`.
+
+Operator ask (2026-10-16): "Could we have everything able to be run as a systemd service, supporting either on host or via Docker?" and "I want to make it as easy as possible for anyone to use all the features of Archilyzer, and I think Docker is a core component of that." Rulings followed: Docker is the first-class install with full feature parity, host mode the alternative, both run as systemd services from one …
+
+### Release 32 lane R5 — a clip window from the stored media URL when the lookup is rate-limited (as shipped)
+
+`plans/release-32/stored-url.md` — 55 lines, 2026-10-16 (`606e9af2`). Read it: `git show 606e9af2:plans/release-32/stored-url.md`.
+
+Live (2026-10-16): Odysee answers 429 to yt-dlp's page/API lookup (`[lbry] … HTTP Error 429`) on the first request of a run, hours apart, with cookies; the fetch-windows job stops (`stopped: rate-limit`) and the platform is held, so later runs are refused at the door. Every held Odysee record's `metadata.info.json` already stores its media: one format on `player.odycdn.com`, a different endpoint. Ruling (operator): …
+
+### Release 37 lane D — `r37/cite`: renders, citations, the moment page, the MCP (as shipped)
+
+`plans/release-37/cite.md` — 136 lines, 2026-10-20 (`2ec5cecc`) → 2026-10-20 (`8817880e`). Read it: `git show 8817880e:plans/release-37/cite.md`.
+
+The plan of record is [`wayback-pages.md`] ("S4"). Lane A put page records in the posts store ([`core.md`]), lane C read the sites ([`extractors.md`]), lane B chose captures. This lane makes a page record something a person can SEE and CITE: its capture shot from the archive's replay, the same lines about the capture on every surface that shows it, a report's bare `page` citation turned into a citation of the record …
+
+### Release 37 lane A — `r37/core`: the client, the record, one-page import (as shipped)
+
+`plans/release-37/core.md` — 150 lines, 2026-10-20 (`0861c490`) → 2026-10-20 (`569a3441`). Read it: `git show 569a3441:plans/release-37/core.md`.
+
+The plan of record is [`wayback-pages.md`] ("What a record is", "What a channel is", S1). This lane makes a Wayback Machine capture of a page that is not a video a first-class record: a `Post` on platform `"webpage"` in a **Wayback pages** channel, imported one capture at a time (`import-page`), its raw body kept so its records can be re-derived offline (`reextract-pages`). Rulings followed: the UI works with no …
+
+### Release 37 lane C — `r37/extractors`: the site extractors (S3, as shipped)
+
+`plans/release-37/extractors.md` — 114 lines, 2026-10-20 (`9f3012f5`). Read it: `git show 9f3012f5:plans/release-37/extractors.md`.
+
+The plan of record (`plans/release-37/wayback-pages.md`, "What a record is" and "S3") makes a non-video Wayback capture a `Post` on platform `"webpage"`. This lane is S3: the site extractors, pure modules against the contract on main (`common/lib/waybackPages/types.ts`), registered in `SITE_EXTRACTORS`. Lane A's generic extractor, dispatcher and importer are not needed here; every module is tested directly. Rulings …
+
+### Release 37 lane G — `r37/forum-resume`: a forum walk that resumes, never re-crawls (as shipped)
+
+`plans/release-37/forum-resume.md` — 131 lines, 2026-10-20 (`e132bac5`) → 2026-10-20 (`dc450d71`). Read it: `git show dc450d71:plans/release-37/forum-resume.md`.
+
+The operator, 2026-10-20: "change the walk to track the last page and be able to resume rather than always re-crawling, even if things could change. We can have two buttons like a channel's sync and full fetch." The bug seen live: a run capped with `pages: 3` caught up the 3 newest pages and stored its catch-up position as THE cursor, replacing the history cursor (2340 → 2593), and the next run re-read ~250 held …
+
+### Release 37 lane E — `r37/live`: liveness and saving what is still up (as shipped)
+
+`plans/release-37/live.md` — 128 lines, 2026-10-20 (`682ee2a5`). Read it: `git show 682ee2a5:plans/release-37/live.md`.
+
+The plan of record is [`wayback-pages.md`] ("S5"). A page record (lane A) is a capture of a page; this lane answers whether the page's ORIGINAL is still up — when it is not, the Wayback copy is the only copy — asks the Wayback Machine to capture a page that is still up (Save Page Now), and teaches find-copy to find a copy of a gone page a report cites. Rulings followed: no model anywhere; every operation has a …
+
+### Release 37 lane B `r37/scan` (S2: scan and choose) — as shipped
+
+`plans/release-37/scan.md` — 83 lines, 2026-10-20 (`9082180c`) → 2026-10-20 (`0370664e`). Read it: `git show 0370664e:plans/release-37/scan.md`.
+
+Plan of record: `plans/release-37/wayback-pages.md`, "What a channel is" and "S2". The brief's decisions held: a scan never fetches a body; `collapse=digest` by default; no model anywhere.
+
+### Landed without a plan — `main`, 2026-10-05 → 2026-10-09
+
+`plans/landed-2026-10.md` — 91 lines, 2026-10-09 (`11cb1b09`). Read it: `git show 11cb1b09:plans/landed-2026-10.md`.
+
+`main`'s first-parent history `39abec18..e921f82f`: 70 entries, 246 commits. Merged into `r18/integration` at `f2fd11a7` (through `edadc712`), `ff9c6b7d` (through `f6137a04`) and `4cffda3f` (the rest). The report-site slices have their own record, [`report-sites.md`]; everything else here had none. Each row is the merge and what it landed. FACTS has the verified details for the starred rows ("Verified 2026-10-09").
+
+### Overnight 2026-10-09 → 10 — the next batch, run from the primary checkout
+
+`plans/overnight-2026-10-10.md` — 190 lines, 2026-10-09 (`585be292`) → 2026-10-10 (`43e684bb`). Read it: `git show 43e684bb:plans/overnight-2026-10-10.md`.
+
+Operator rulings (2026-10-09, late evening; do not re-open): - **Scope:** e2e speed S1–S3 ([e2e-speed.md]); B2 report-to-video robustness; release 19 A6–A9; release 21 D2, then release 20 (the data model). - **The orchestrator runs in the primary checkout** (`~/Projects/yt-dlp-transcript-browser`, branch `main`) and advances releases itself: after full green gates it fast-forwards `main` and runs the standard …
diff --git a/plans/archive/report-video.md b/plans/archive/report-video.md
@@ -0,0 +1,161 @@
+# Archive — Report videos, montages and the clip finder
+
+Releases 33–36 (montages and auditioning them, judging clips, the clip finder rounds one and two), release 38's local video assistant, and the deck lanes of 2026-10-22/23. The code-cited plans of this kind stay in `plans/`: [`release-35/clip-finder.md`](../release-35/clip-finder.md), [`release-34/voice-match.md`](../release-34/voice-match.md), [`onscreen-deck.md`](../onscreen-deck.md), [`deck-counts.md`](../deck-counts.md), [`video-knobs-core.md`](../video-knobs-core.md), [`video-knobs-ui.md`](../video-knobs-ui.md), [`clip-marks.md`](../clip-marks.md), [`live-preview.md`](../live-preview.md); umtool's docs are [`umtool/docs/`](../../umtool/docs/README.md).
+
+Each entry is a finished plan or record, removed from `plans/` on 2026-10-27. The full text is in git: `git show <last commit>:<path>` (the commit named on the entry).
+
+### Release 33 — montages, and auditioning them
+
+`plans/release-33.md` — 64 lines, 2026-10-17 (`508334f2`) → 2026-10-18 (`9d5df831`). Read it: `git show 9d5df831:plans/release-33.md`.
+
+The operator's request (2026-10-17): a montage of every time TheQuartering said "slow news day/week/…", roughly chronological, with editing techniques that show the many instances well, auditioned as variants — and variant auditions in umtool. Also: `queue-lock --heavy` caps what it admits by default (the operator's go, same day).
+
+### Release 33 lane M3 — montage editing in report-to-video (as shipped)
+
+`plans/release-33/montage.md` — 74 lines, 2026-10-17 (`89e6f9a3`). Read it: `git show 89e6f9a3:plans/release-33/montage.md`.
+
+The operator asked (2026-10-17) for a montage of every time TheQuartering said "slow news day/week/cycle", kept chronological, with editing techniques worth auditioning as variants. This lane is the renderer half: `render.montage` in report-to-video and the named styles umtool's take maker (lane M1) lists.
+
+### Release 33 lane M3c — montage polish (as shipped)
+
+`plans/release-33/montage-polish.md` — 62 lines, 2026-10-18 (`065d2d64`). Read it: `git show 065d2d64:plans/release-33/montage-polish.md`.
+
+After the build-to-wall audition (2026-10-18), three fixes to a montage, on `main` `2be6f0b7`:
+
+### Release 33 lane M3d — the silent tile (as shipped)
+
+`plans/release-33/silent-tile.md` — 70 lines, 2026-10-18 (`90f48db7`) → 2026-10-18 (`ad1416e1`). Read it: `git show ad1416e1:plans/release-33/silent-tile.md`.
+
+In the build-to-wall smoke, the s70 tile (v7fucc4, window `clips/355.02-368.18.mp4`) measured −53.7 LUFS and was raised the full +20 dB. s38 (v4dl2pq @6331) measured −38.6 LUFS and was also raised +20 dB.
+
+### Release 33 lane M1 — `r33/takes`: variant auditions in umtool (as shipped)
+
+`plans/release-33/takes.md` — 116 lines, 2026-10-17 (`ba3699c9`) → 2026-10-17 (`5d0017c9`). Read it: `git show 5d0017c9:plans/release-33/takes.md`.
+
+Operator request (2026-10-17): variant auditions for a montage project, in umtool. Operator rule (2026-10-16): everything a model can do is doable in the UI with no model. Before this lane takes were only ever made by a one-off script, and the winner was copied by hand. Now umtool makes them, from the Takes page or a terminal, and **Use this take** puts one in the project's place. Nothing here calls a model.
+
+### Release 33 lane M3b — the montage wall in synced groups (as shipped)
+
+`plans/release-33/wall-sync.md` — 86 lines, 2026-10-18 (`6fd889ac`). Read it: `git show 6fd889ac:plans/release-33/wall-sync.md`.
+
+The operator auditioned the slow-news takes (2026-10-17/18): "I really like the wall finale … something with elements from accelerate with a wall finale … really sync up those wall groups and speeding up the pacing toward the end — the slide transition was cool too". Addendum: "if we do the unison wall finale it shouldn't have had those same clips appear earlier, use it as a way to condense the repetition."
+
+### Release 34 — judging montage clips, and finding the next phrase
+
+`plans/release-34.md` — 43 lines, 2026-10-18 (`a5bb847d`) → 2026-10-18 (`6fda0f58`). Read it: `git show 6fda0f58:plans/release-34.md`.
+
+The operator, judging the slow-news cut (2026-10-18): the stale takes and old images go; then "plan next steps you can do while I judge the cuts" — all five approved. Records in `plans/release-34/`.
+
+### Release 34 lane N1 — `r34/clip-deck`: the montage clip audition deck (as shipped)
+
+`plans/release-34/clip-deck.md` — 137 lines, 2026-10-18 (`4934862e`). Read it: `git show 4934862e:plans/release-34/clip-deck.md`.
+
+The operator rules montage clips by ear ("#4 is another speaker, #6 is him reading a tweet, #58 only makes sense if she's refuting his claim"), and until now the orchestrator hand-edited the seed's `edits.json`. This lane is the app surface for it: one card per instance, swiped keep / cut / not him / read aloud, persisted through the app, applied at render. Rulings followed: audits get an app-like UI, one decision …
+
+### Release 34 lane — report-to-video's suite on Debian's ffmpeg 7.1 (as shipped)
+
+`plans/release-34/docker-parity.md` — 23 lines, 2026-10-18 (`2773c812`). Read it: `git show 2773c812:plans/release-34/docker-parity.md`.
+
+In `archilyzer:r33-umtool` (ffmpeg 7.1.5-0+deb13u1), after r34/wall-ffmpeg71, the whole `umtool/report-to-video/*.test.mjs` had 6 failures. Every one was in the tests; no renderer code changed.
+
+### Release 34 lane N3 — `r34/phrase-finder`: find the next montage phrase in the UI (as shipped)
+
+`plans/release-34/phrase-finder.md` — 114 lines, 2026-10-18 (`987a927c`) → 2026-10-18 (`4a6da60e`). Read it: `git show 4a6da60e:plans/release-34/phrase-finder.md`.
+
+The catchphrase ranking of 2026-10-18 was made by a script a model wrote (a patched phraseScan for many phrases in one pass, because one phrase took 2.5+ min under load). Operator rule (2026-10-16): what a model can do is doable in the UI with no model. This lane makes the search a umtool page and a CLI, and a montage one click from a result. Nothing here calls a model.
+
+### Release 34 lane — the wall's length on ffmpeg 7.1 (as shipped)
+
+`plans/release-34/wall-ffmpeg71.md` — 44 lines, 2026-10-18 (`39bd3ff5`). Read it: `git show 39bd3ff5:plans/release-34/wall-ffmpeg71.md`.
+
+The umtool image (`archilyzer:r33-umtool`, Debian trixie, ffmpeg 7.1.5-0+deb13u1) failed `montage.test.mjs` "render: wall-finale" with "420 vs 443". The host (ffmpeg n9.0.2) passed.
+
+### Release 35 — the clip finder: Archilyzer as an assisted clipping tool
+
+`plans/release-35.md` — 60 lines, 2026-10-19 (`9473c93c`) → 2026-10-19 (`c5f3941a`). Read it: `git show c5f3941a:plans/release-35.md`.
+
+The operator (2026-10-18 night): a bespoke clip video of a reaction livestream, cut to where the host comments on and laughs at the narrated video, above all other video work — "a significant step in adding the ability to use the Archilyzer as an AI-assisting clipping tool", with "an easy way for a human to hop in and either comment or manually adjust clips created by an assistant". Quartering montages cancelled …
+
+### Release 35 lane C1 — `r35/clip-analysis`: finding the clips (as shipped)
+
+`plans/release-35/clip-analysis.md` — 113 lines, 2026-10-19 (`455318e8`) → 2026-10-19 (`dda22a28`). Read it: `git show dda22a28:plans/release-35/clip-analysis.md`.
+
+The plan of record is [clip-finder.md]; this lane is its analysis half: from a long recording's speaker turns, words and sound to clip proposals in a report-video manifest, each marked as the assistant's, and `reactions.json` beside it. Lane C2 (`r35/clip-editor`) is the review UI over the same two shapes.
+
+### Release 35 lane C2 — `r35/clip-editor`: a person hops in on an assistant's clips (as shipped)
+
+`plans/release-35/clip-editor.md` — 91 lines, 2026-10-19 (`204e1adf`) → 2026-10-19 (`ba6b8e84`). Read it: `git show ba6b8e84:plans/release-35/clip-editor.md`.
+
+The operator: "Add the ability in the UI for an easy way for a human to hop in and either comment or manually adjust clips created by an assistant." This lane is that surface: the clip editor at `/projects/<id>/clips` for a report video whose cut is not a montage — the clip finder's highlights above all (lane C1 writes them, each with `assist`), and any other report video's clips. Rulings followed: the UI works with …
+
+### Release 35 lane O2 — `r35/hyperframes-fx`: the effects region (as shipped)
+
+`plans/release-35/hyperframes-fx.md` — 68 lines, 2026-10-19 (`f6cd4d7e`). Read it: `git show f6cd4d7e:plans/release-35/hyperframes-fx.md`.
+
+Ten opt-in overlay effects for report videos with the on-screen deck, under `render.chrome.fx`, drawn by ONE HyperFrames page for the whole cut over exactly the footage box (`chrome-fx.mjs`, region `fx`), scheduled by `fx.mjs` from the build's own clock. Overlays on the evidence, never cards. Mid-lane the orchestrator re-prioritised to reaction-highlight clipping; the reaction effects (two-voice captions, punch-in, …
+
+### Release 35 lane O1 — montage operations in the app (`r35/montage-ops`), as shipped
+
+`plans/release-35/montage-ops.md` — 60 lines, 2026-10-19 (`6413f66b`). Read it: `git show 6413f66b:plans/release-35/montage-ops.md`.
+
+The steps the orchestrator did by hand for the slow-news montage — a scan, no cap, a fetch-windows body built in python, a second fetch for refused Rumble windows from the same stream's other upload — as app operations, each with a CLI and a UI button, deterministic, no model.
+
+### Release 36 — the clip finder, round two (record)
+
+`plans/release-36.md` — 50 lines, 2026-10-19 (`9ed97a1b`). Read it: `git show 9ed97a1b:plans/release-36.md`.
+
+Plan of record: [`release-36/clip-finder-2.md`]. Lane records: `release-36/clip-analysis-2.md` (B), `find-clips.md` (A), `clip-look.md` (C), `clips-suggest.md` (D), `clip-edges.md` (E: room + the blur slide).
+
+### Release 36 lane B — `r36/clip-analysis-2`: auto-scope, the chat, site-less links (as shipped)
+
+`plans/release-36/clip-analysis-2.md` — 114 lines, 2026-10-19 (`8ccc04a2`). Read it: `git show 8ccc04a2:plans/release-36/clip-analysis-2.md`.
+
+The plan of record is [clip-finder-2.md]; this lane is its analysis half, extending release 35 C1's clip finder ([../release-35/clip-analysis.md]): where in a reaction stream each narrated video is, the stream's chat as a second ear, links and a look for a channel on no site, and the umtool route the editor's Find clips (lane A) calls. Lane D (the optional AI pass) builds on this branch.
+
+### Release 36 lane E — `r36/blur-slide`: room at the clip edges, and the blur slide (as shipped)
+
+`plans/release-36/clip-edges.md` — 95 lines, 2026-10-19 (`b36aac75`). Read it: `git show b36aac75:plans/release-36/clip-edges.md`.
+
+The operator, watching the first highlights cut: the edges are tight — a join fades over the end of one clip's last sentence and the start of the next one's first. Ruled: the sound runs on to the first silence, and muted picture carries the join. This lane makes that a render key, `render.room`, and records the blur slide (the orchestrator's commit `a012e9ff`) that the site-less seed now starts with. Rulings …
+
+### Release 36 — the clip finder, round two: one button, a clean look, captions, shorts, chat, an optional AI pass (plan of record)
+
+`plans/release-36/clip-finder-2.md` — 110 lines, 2026-10-19 (`0d471989`) → 2026-10-19 (`c5f3941a`). Read it: `git show c5f3941a:plans/release-36/clip-finder-2.md`.
+
+Release 35 (main `ff6d0fbb`) made Archilyzer an assisted clipping tool. The first case, "The Nik Drop" (a reaction livestream, 9278 s), was cut by the clip finder and adjusted in the clip editor (one clip cut, a comment brought in, no on-screen UI, fade-through-black joins). Running it live exposed the hand work that is still not a button: - the chain (persist video → word timings → transcript → speakers → `umtool …
+
+### Release 36 lane C — `r36/clip-look`: the Look panel, loudness, speaker captions, vertical shorts (as shipped)
+
+`plans/release-36/clip-look.md` — 100 lines, 2026-10-19 (`48a5554c`). Read it: `git show 48a5554c:plans/release-36/clip-look.md`.
+
+The plan of record is [clip-finder-2.md], lane C. The first case's render look (no header or QR, fadeblack joins) was a jq edit of the manifest; it had no captions, uneven loudness (−19 LUFS) and no shareable shorts, and `umtool build` only printed its chain. This lane makes each of those a render key a person sets in the UI, renders them, and adds the short and `build --run`. Rulings followed: the UI works with no …
+
+### Release 36 lane D — `r36/clips-suggest`: the assistant's labels, Ask the assistant (as shipped)
+
+`plans/release-36/clips-suggest.md` — 99 lines, 2026-10-19 (`8b4f6cec`). Read it: `git show 8b4f6cec:plans/release-36/clips-suggest.md`.
+
+The plan of record is [clip-finder-2.md], lane D: the clip finder's OPTIONAL AI pass. Lane B's analysis ([clip-analysis-2.md]) and lanes A and C were merged into this branch before its gates. Rulings followed: the UI works with no model (with no labels file, generation off or no model the clip editor is as it was; every edit a proposal names is a button the operator already had); the only model calls are through …
+
+### Release 36 lane A — `r36/find-clips`: one button on the video page (as shipped)
+
+`plans/release-36/find-clips.md` — 114 lines, 2026-10-19 (`03a9e0dd`). Read it: `git show 03a9e0dd:plans/release-36/find-clips.md`.
+
+Release 35 ran the clip finder's chain from a shell, step by step, and forced two transcriptions through a PAUSED worker pool by hand. This lane makes the chain one job and one button: **Find clips** on the video page (`pnpm ops find-clips`), a run-while-paused path for one manual transcription, and a chat-replay fetch for one video. Rulings followed: the UI works with no model (nothing here calls one); every CLI …
+
+### Release 38 lane E — `r38/video-assist`: the local video assistant (as shipped)
+
+`plans/release-38/video-assist.md` — 168 lines, 2026-10-20 (`53064c5c`). Read it: `git show 53064c5c:plans/release-38/video-assist.md`.
+
+The operator, 2026-10-20: "A feature to iterate on the video with hyperframes using qwen, such that I can request little things like changing transition time on local AI even when Claude Code is not available." This lane makes a request in words ("make the joins 0.15 s with less smear") a set of checked, proposed edits of a video project that the operator applies with a click — on the local model by default. Rulings …
+
+### Deck finale — the timeline in primary view (lane `lane/deck-finale`, K3)
+
+`plans/deck-finale.md` — 53 lines, 2026-10-22 (`50e0e2a9`). Read it: `git show 50e0e2a9:plans/deck-finale.md`.
+
+Asked by the operator on 2026-10-22 for the Huck seizure-timeline video: "For the finale we can move the timeline into primary view, and prominently show our totals as well as 'seizures per year' and maybe 'incidents per year'." Scope narrowed the same day to what the render needs (the Huck video's first release).
+
+### The QR-origin check — exact (lane `lane/siteorigin-check`)
+
+`plans/siteorigin-check.md` — 38 lines, 2026-10-23 (`fd520cb7`). Read it: `git show fd520cb7:plans/siteorigin-check.md`.
+
+Asked by the operator on 2026-10-23: "Am I good to click 'fix manifest' on the huck video in umtool? And why do I have to click it for everything?" → "queue it" (fix the check).
diff --git a/plans/archive/sites-and-publishing.md b/plans/archive/sites-and-publishing.md
@@ -0,0 +1,47 @@
+# Archive — The export sites, the homepage and publishing
+
+The responsive export redesign, header-first search, visitor exports off, the homepage deploy from the UI, the release cut CLI and the source mirror. [`PUBLISH.md`](../../PUBLISH.md) is the current reference.
+
+Each entry is a finished plan or record, removed from `plans/` on 2026-10-27. The full text is in git: `git show <last commit>:<path>` (the commit named on the entry).
+
+### Cut a release from the CLI (release 10 slice P)
+
+`plans/cut-release-cli.md` — 88 lines, 2026-09-26 (`84c502f3`). Read it: `git show 84c502f3:plans/cut-release-cli.md`.
+
+Written 2026-09-26 (night). Operator: "Are you able to cut releases with the CLI ops? add that ability if not." Answer today: NO. The only cutter is the `/sites` page's "Release notes" form (`editor/app/sites/components/CutReleaseForm.tsx` → `editor/app/sites/lib/cutReleaseAction.ts`), and the runbook's step 0 ("re-cut the release notes first") is a click. Anchors verified on `main` 5f577437.
+
+### Release 14 — the social icons within reach, and a clear screen until the first Search
+
+`plans/export-header-first-search.md` — 416 lines, 2026-09-28 (`be593e19`) → 2026-09-29 (`5a95be7d`). Read it: `git show 5a95be7d:plans/export-header-first-search.md`.
+
+Written 2026-09-28 against `main` `6f03805b`. Self-contained for a fresh session. Rules: `plans/tools/implementer-rules.md` (one Opus implementer per slice in a worktree, one read-only Opus review, the parent merges; no cut, no deploy and no restart inside a slice). Record file: `plans/release-14.md` (NEW, created by the first slice to start, the shape of `release-12.md`). Facts below were gathered by two read-only …
+
+### Export site — mobile-first responsive redesign
+
+`plans/export-responsive-redesign.md` — 330 lines, 2026-08-29 (`de9efebc`) → 2026-09-28 (`6f05ea22`). Read it: `git show 6f05ea22:plans/export-responsive-redesign.md`.
+
+The `export/` app (the public static archive: jeralyzer.pages.dev etc., plus hub mode) was designed desktop-first at `max-w-6xl` and relies on `flex-wrap` everywhere. Measured against a built `export/out` served locally at iPhone-13 width (390px) on 2026-08-29:
+
+### Deploy the homepage from the editor
+
+`plans/homepage-deploy-from-ui.md` — 147 lines, 2026-09-26 (`a575685d`) → 2026-09-28 (`83b786ca`). Read it: `git show 83b786ca:plans/homepage-deploy-from-ui.md`.
+
+Written 2026-09-26 (evening) by the slice N implementer, on the operator's ask. Rules: `plans/tools/implementer-rules.md` (one Opus implementer in a worktree, one read-only Opus review, the parent merges). Small: one slice, editor + ops only; nothing in `homepage/` or `export/` changes.
+
+### The Ko-fi mark in every site's social row (release 10 slice O)
+
+`plans/kofi-mark-on-sites.md` — 84 lines, 2026-09-26 (`9860bcbe`). Read it: `git show 9860bcbe:plans/kofi-mark-on-sites.md`.
+
+Written 2026-09-26 (evening). Operator, verbatim: "I downloaded ~/Downloads/kofi_brandasset.zip for the kofi logo official assets, use them to show kofi in the social section on all sites." This SUPERSEDES the 2026-09-25 ruling that a site build carries no Ko-fi link (the "bare link, no copy, hub only" rule in `export/app/components/Footer.tsx:98-110` and `export/e2e/site-branding.spec.ts:48-54`). "No copy" still …
+
+### Plan — visitor exports off on the published sites, kept as an option for the OSS release
+
+`plans/site-exports-off.md` — 56 lines, 2026-09-24 (`77f63356`) → 2026-09-24 (`6950945a`). Read it: `git show 6950945a:plans/site-exports-off.md`.
+
+> **Superseded by [`release-5.md`] slice X** (shipped as "### Slice X, as shipped" > in its Record). Kept as written for the inventory; where the two differ, release-5.md wins — > notably there is no `pnpm ops site-config` (the site form is the one writer), and the hub has no > `site.json` of its own.
+
+### Release 12 — the source mirror: a read-only git clone on the project site
+
+`plans/source-mirror.md` — 518 lines, 2026-09-28 (`c3177eeb`) → 2026-10-09 (`7414eee7`). Read it: `git show 7414eee7:plans/source-mirror.md`.
+
+Written 2026-09-27 in plan mode, RE-CHECKED 2026-09-28 against `main` `90c7f776` (128 commits later; see "What changed since the plan was written"). Self-contained for a fresh session. The design was verified by three Explore passes and one Plan pass; the dumb-HTTP clone, the filter-repo scrub and wrangler's upload filter were PROVED in scratch. Rules: `plans/tools/implementer-rules.md` (one Opus implementer per …
diff --git a/plans/archive/state-history.md b/plans/archive/state-history.md
@@ -0,0 +1,2162 @@
+# Archive — STATE.md session history, 2026-08-12 → 2026-10-09
+
+The "Previously" blocks and "What landed" logs that [`../STATE.md`](../STATE.md) carried, moved here verbatim on 2026-10-27 (links re-pointed for this folder). Statuses in them are as of their own dates — "owed" and "not live" lines were all overtaken; the decisions log, open questions and surprises stay in STATE.md.
+
+**Previously (2026-10-09): release 18 is complete on `r18/integration`, and `main` is merged into it (`4cffda3f`, 94
+commits ahead of `main` `e921f82f`, 0 behind: a fast-forward).** The merge brought main's ~70 commits since 2026-10-06
+(umtool articles + notes, `ops transcribe` with word timings, fetch-windows, metadata refresh, channel
+create/rename/delete over ops; record: [`landed-2026-10.md`](releases.md)); the changelogs keep both sides, r18
+first. Nothing of release 18 is live.
+- **Owed, in order:** fast-forward `main` to `r18/integration` from a session that is not worktree-isolated (the
+ primary clean first); the rollout per `~/reports/release-18/RUNBOOK.html` (editor rebuild + restart, Publish now,
+ jeralyzer preview, hub tombstones, step 5b `r18-eva-sites.sh` + production deploys of hasanalyzer and bonnellyzer,
+ policies, the lane on; the script guard sha updated to the merge); then pruning — the five `r18-*` slice worktrees
+ and their branches, `render-local-sources`; the ~170 merged branches and the stale worktrees (`diet-series`,
+ `export-gumroad-tip`, `r13-phase-5`) are listed for the operator to approve, never deleted unasked.
+- **The five working sessions** (Super Hasanalyzer, Super Jeralyzer, Super Jasolyzer, candace owens corpus analysis,
+ unified media aggregation) are doing corpus and content work and hold no unmerged code. The tooling gaps they
+ reported are releases 19–20.
+- **Releases 19–20 are in flight on three tracks** (index: `PLAN.md`, "Beyond the AI track: releases"): Track A
+ [`release-19.md`](releases.md) A1–A9 (agents run the archive: ops, CLI, MCP) then
+ [`release-20.md`](releases.md) (data model); Track B release 19 B1–B6 (machine safety and tooling); Track C docs
+ and plans (OPERATING.md and `archilyzer docs cli`, doc fixes, homepage docs, FACTS). Integration branch
+ `r19/integration`, branched from `4cffda3f`.
+- **The `en` → 0 cues caption bug (filed 2026-10-01) is CLOSED** by `200a3105` (en-orig first, empty tracks fall
+ through, cue-block VTTs parse, a one-shot index re-read); verified against the tree and an index fixture by release
+ 20 D3 (2026-10-10; FACTS, "The caption-track rule"). Left open: the stats cache does not see that pass's re-reads.
+- **Release 20 D2 (Twitch ids) is HELD for an operator ruling**: built and kept on `r20/twitch-ids`, reverted on
+ `r20/d2-r20`; the two options are in `release-20.md` ("Slice D2 — held").
+
+**Previously (2026-10-06): release 18 — publishing as queueable stages — is complete on `r18/integration`** (record:
+[`release-18.md`](../release-18.md): slices S1 the stage contract, stamps, lock, bundles and CLI; S2 deploy hardening; S3
+the status, the queue and the publish lane; S4 the surfaces; S5 the image half; S6 the records — each reviewed, merged
+`--no-ff`; `main` `edadc712` merged in first). **Not on `main` yet, and nothing of it is live.**
+- **Owed, in order** (the plan's steps 5–6): fast-forward `main` to `r18/integration` from a session that is not
+ worktree-isolated (an empty `status --short` in the primary first; if `main` moved, merge it into the integration
+ branch and re-gate instead); remove the idle `r18-*` worktrees (keep `r18-integration` until the rollout is done);
+ then the rollout: ONE editor rebuild + restart (adapt `~/reports/release-17/scripts/r17-*.sh`), Publish now with
+ every policy off (= the index update alone; `/` answers under 5 s throughout), a jeralyzer build → preview deploy →
+ live-check verdict, the hub with its tombstone probes (open question 1 for real), production deploys site by site,
+ then policies (`build` for all six; `preview` where wanted; `production` for none until a week of lane runs reads
+ clean) and the lane on (`checkEveryMinutes` 10, `refreshEveryMinutes` 360); `archilyzer doctor`; build
+ `runtime-vulkan` and `runtime-cuda` once.
+- **The Eva tags leak (found 2026-10-06):** `eva-topic` is published on hasanalyzer (1, hasanabi) and bonnellyzer
+ (3, omnibased) — the three Eva rules fire on every channel but Eva's own. Ruled: they exist on Anilyzer only (and
+ a future VTuber site). Fixed in code on `tags/site-scope` (a tag's `sites`, merged here); the DATA change is
+ owed once the new code is live: `~/reports/release-18/scripts/r18-eva-sites.sh` (scopes the three to anilyzer,
+ updates the index, rebuilds the three sites), then production deploys of hasanalyzer and bonnellyzer.
+- **What changes for the operator:** /sites → **Publish** replaces "Build all sites" and the hub/homepage sections
+ (Publish now, Build all stale, a row per target with index | built | deployed | live chips); **Build stats dataset is
+ gone** (the index update builds the stats); `/operations/publish` is the lane; a site's **Publish policy** is on its
+ form; `pnpm ops publish {"verb": …}`; `archilyzer publish …` (PUBLISH.md). Every stage is a child process under one
+ publish lock, so a build no longer starves the editor.
+
+**Previously (2026-10-02, 03:20): `main` is `a6155bf2` (+ plans commits) — release 17, the media tier, is complete
+and LIVE: the editor on `:3001` (`Dt4zuo5uJcPKZ9fKk0L-f`, restarted 02:51 after the migration) and umtool on
+`:3050` (02:40, `UMTOOL_MEDIA_DIR` set to a folder on the Platter).** Record: [`release-17.md`](../release-17.md)
+(slices D0, T1, T2, T3, U1, U2, XP, RL, each with its review; the Rollout section). The operator's runbook is
+`~/reports/release-17/RUNBOOK.html`; its scripts are `~/reports/release-17/scripts/`.
+- **The migration ran (02:40–02:51, editor stopped):** ten channels moved to the media tier (realcandaceo,
+ omnimirror, leaflit-rumble, cornbreadman, shondo-vods, friday-night-tights, piratesoftware, kirsche,
+ nuxanor-kick, HasanAbiVODs3). **12:19–12:34 (2026-10-02, editor stopped): the big three too** — rekietalaw,
+ the-quartering-rumble and omnibased migrated in 860 s; nothing on the retired layout remains; `/home`
+ 77 GB → 43 GB free. The auto-subs purge (channel page → Cleanup → "Superseded auto-captions", shown only when the
+ bucket is non-empty) applies to 24 HasanAbiVODs3 videos and none of omnibased: the plan's 7.6 GB counted
+ every `en-orig.vtt`, most of which are their video's only transcript and are never purged. `--reclaim` (the platter's text copies) later.
+- **The saved-video store move (209 GB → the Platter) is DEFERRED:** started 11:45 offline through
+ `relocateSavedVideos`, stopped at 6.8 GB because the platter wrote at 2 MB/s (a 1 GiB `dd` on the idle
+ drive: 4.7 MB/s; reads 55 MB/s). The operator cleared the marker (12:58); the store is "In place" again
+ and its writers are free. Move it again from the Storage card when the drive writes at a sane rate; the
+ 7.4 GB partial copy under `<platter>/saved-videos` is reused. The operator floated "text on the
+ platter as a per-channel option" as a release valve for SSD space — not built; a candidate slice. `transcripts/channels` is a paused Syncthing folder: unpausing now
+ syncs the migrated text to the peers.
+- **Live proof:** a migrated video page in 0.2 s, its audio and transcript stream through the links (206),
+ the dashboard answered in 1.4–2.1 s during three simultaneous report regenerations (D0), `/storage` says
+ "legacy (3 to migrate)", umtool's `move-out --all` moved ten `out/` trees (12.3 GB) to the Platter.
+- **Owed to the operator (release 17):** X posts private — create the private site (Sites → New, Audience:
+ Private, every channel), set "Where X posts appear: Private" on `/settings`, rebuild + deploy hasanalyzer,
+ anilyzer and jeralyzer, REBUILD + DEPLOY THE HUB (it serves X posts today), decide on old Cloudflare
+ deployments, re-register the MCP against the private build; the saved-video store move when the platter writes properly; watch the download
+ lane page (YouTube's backoff was at 6 failures at 03:18, no hold; "Clear hold" is the way out of a hold).
+- **Rulings this release:** an implementer's commits carry its own model's `Co-Authored-By` (never rewritten
+ to another model's); never write the refused identifier suffix as text in a record; never run a whole e2e
+ suite while other agents work (an OOM kill at 22:41 took the desktop session and a transcriber).
+
+**Previously (2026-10-01, 00:10): `main` is `271db070` — releases 14, 15 and 16 (CK the "Search in" row, DX the
+setup on the homepage's AI and MCP doc), release 13's three slices that had never landed (W3 the
+build image, W1 the editor lows, W2 the export/docs lows, each brought to `main` by a reviewed
+merge), and the report-video on-screen deck from the parallel session (`plans/onscreen-deck.md`).**
+Records: [`release-16.md`](releases.md), [`release-13.md`](../release-13.md) (its Rollout is now
+written), [`release-14.md`](../release-14.md), [`release-15.md`](../release-15.md). The operator's runbook is
+`~/reports/release-15/RUNBOOK.html` (its banner carries the current two lines).
+- **Live (2026-10-01, 01:31) — everything:** the editor on `:3001` (`3Wc3BdFQWKuLx9PbNZvmB`), umtool on
+ `:3050` (`LRRG_c7H8GRM6ZpHbqvt0`, the deck), the index and stats, the homepage from `2cf43a69`
+ (mirror `6b34c2aa`, 2,029 commits; 20/20), the hub (6 sites) and the six sites (Search in, the
+ `@Archilyzer` link, the Use-with-AI link to the homepage doc, the sixth chart colour) — the
+ operator ran `r15-umtool-restart.sh` and `r15-deploy-all.sh` at 00:26–01:31. `realcandaceo` is
+ still held by its own interrupted media move (the operator's Resume).
+- **Release 16 is complete and LIVE on `:3001` (2026-10-01 12:54, `Xfavvt2XajdNzOvvn0NtL`):** FK
+ (`a44dc38d`, forms keep what was typed), RM (`ae23a695`, a move refuses over a running job, holds
+ the channel's writers, mirrors its copy; Reconcile and resume), XL (`a07bfa21`, the Connect window
+ is the operator's own browser without automation signals; the fetchers use the operator's Firefox
+ login via `social.x.cookieSource`). The posts deck (`458f4fcd`) is live on umtool (restarted 11:13).
+ `realcandaceo`'s move completed 2026-10-01 (five stale scratch files removed from the destination
+ copy by hand, then Resume) — the case RM now handles itself.
+- **Owed:** the build-only Build all through the rebuilt build image, when the machine is idle; the
+ operator's by-hand check of the X section (Check, then Connect or the browser login). Follow-up filed: `export-search.spec`'s "Deleted"
+ checkbox locator matches a result card's "Select … for AI" box by substring (`exact: true`).
+- **Settings changed by hand through `writeSettings` (2026-09-30):** the X social link is
+ `x.com/Archilyzer`; `storage.health.budgetMs` 20000 and `probeTimeoutMs` 10000 (the 3 s default held
+ six Platter channels while renders churned the disk — the operator's ruling was to tune, not to
+ change the detector).
+- **Rules changed:** the homepage build gate is `build:nodata`, never `run build` (its `prebuild`
+ indexes whatever `transcripts/` is visible — a three-minute stray index build against the real
+ corpus happened during W2's catch-up; identical code, two records, stopped).
+- **Ruled and built (2026-09-30):** the source's history under `/source/git/` by stagit (SG;
+ Sendforge was out: JS for history, no sub-path); the drive-health timings as
+ `settings.storage.health` (DT).
+- **Follow-ups the reviews named:** the editor's and export's build traces list dot-directories
+ (cosmetic while `standalone` is off); `REQUIRED_TOKENS` lacks `--chart-other` (the e2e pins it);
+ `export`'s `WorkspaceView` `splitOn` has a one-paint flash from a localStorage restore;
+ "Load more results" never resumes a leaf that settled at its cap (`runQueryTree`'s `setHitLimit`
+ reaches running leaves only; on `main` too — release 16 CK re-review R-I1; wants a spec).
+ - `/changelog/` overflows a 390 px phone: long inline code in a released entry
+ (`export/CHANGELOG.md:103`, the 133-character `export/app/ask/{useAskChat,…}` list) cannot wrap. Wrap `<code>` in the changelog renderer, then drop
+ the `test.fail` in `export/e2e/responsive.spec.ts` (release 16 DX).
+ - The JSX entity/whitespace hazard sweep: 22 texts in 19 files run a word into the element before
+ them (FACTS, "Use with AI is the homepage's AI and MCP doc"; release 16 DX).
+
+**Previously (2026-09-28, night): the stats cache key fix — built, reviewed (SHIP AFTER FIXES, then SHIP
+on re-review; every touch-up done), not merged.** (Merged `10cefd15` the same evening; the recount rolled out with
+release 15, the homepage at 77,547 transcripts on 2026-09-30.) The branch is `fix/stats-cache-key`, and [`stats-cache-key.md`](acquisition-and-pipeline.md)
+holds the record, the review and the rollout. FACTS has "The stats cache key".
+- **What it fixes:** the homepage showed Jasolyzer as 0 transcripts, 0 channels, 0 hours while it
+ served 1,889 videos. Instance-wide it showed 49,798 transcripts of about 77,000.
+- **The cause:** `statsByPath` was keyed on the metadata mtime alone. It is now keyed on the index's
+ own record as well, and a transcript always has a date.
+- **Added by the review:**
+ - a guard against clearing a newer cache (`ARCHILYZER_STATS_ALLOW_DOWNGRADE`);
+ - an unmounted drive's stats are kept, and a cache clear with one refuses;
+ - "not indexed yet" and "not indexable" are counted apart.
+- **Owed after the merge:** the rollout in the record, in its order. First, rebuild and restart
+ :3001 (until then, never press "Build stats dataset"). Then index, then one full stats pass of
+ 10–30 min, then the homepage, the hub and the sites. The homepage deploy waits on release 12's
+ step 0: it runs the source publish.
+- **Merge note:** `homepage/social-visible` merged `main` (`10cefd15`) at `4d11542c`; the one
+ conflict, `homepage/CHANGELOG.md`'s `[Unreleased]`, kept both sides.
+- **CLOSED by release 15 slice IG (branch `r15/index-hold`, [`release-15.md`](../release-15.md)):
+ the index build no longer treats an unmounted drive as an empty channel.** It holds the channel:
+ not rescanned, its index records and shared pages kept, and the `Diff:` line says
+ ` Held: N channel(s), K video(s) kept.` A full rebuild with a channel held refuses unless
+ `ARCHILYZER_INDEX_ALLOW_HELD=1`. FACTS has "The index build's hold". Until that branch is merged
+ and rolled out, the rollout's step 3 `Diff:` check stays the safeguard: thousands removed means
+ a drive was missing.
+
+**Previously (2026-09-28, evening): release 12 — the source mirror — is merged to `main` and NOT rolled
+out.** [`release-12.md`](releases.md) holds Q's and R's records, their reviews, "Merged" and
+"Rollout". The operator's runbook is `~/reports/release-12/RUNBOOK.html`, with its scripts in
+`~/reports/release-12/scripts/`. The plan is [`source-mirror.md`](sites-and-publishing.md).
+- **What merged:**
+ - **Q** (`4855f70b`, and the changelog fix `e6c5d2e3`) fixes the hardcoded umtool paths.
+ - **R** (`ffdeb2cd`) adds `archilyzer source publish`:
+ - a fresh bare clone of `main` is rewritten by git-filter-repo with the operator's scrub rules,
+ then repacked for git's dumb HTTP;
+ - an audit gate refuses a denied literal anywhere;
+ - the raw tree at `/source/tree/` and the tarball are published beside the mirror, and the
+ `/source/` page shows them;
+ - a refusal withdraws the source from `public/` and `out/`;
+ - `deployHomepage` refuses any `out/` it cannot vouch for.
+- **The operator's side is prepared:**
+ - `~/.config/archilyzer/` holds a scrub file (3 rules) and a denylist (3 literals: the user name,
+ the host name, an email address). NEVER print them;
+ - `git-filter-repo` 2.47.0 is installed with pipx;
+ - `source publish --check` exits 0. With `main` at `ffdeb2cd` it would publish `8188e02a7d04`:
+ 2,473 files, 69.8 MB. The parent's first check, on `e56101fdee5d`, gave `20c367613f75`.
+- **Owed, in order** (release-12.md "Rollout"):
+ 0. The operator completes the denylist (real name, handles), then runs `source publish --check`.
+ **No deploy of any kind before this: a Pages preview is public and permanent until it is
+ deleted.**
+ 1. The song link, before any umtool restart.
+ 2. Rebuild and restart :3001 with `~/.local/bin` on PATH. It runs 0.10.0 (`BUILD_ID`
+ `vWCJb87ktCy5akih_pM9X`), which has no source step, no withdrawal and no deploy check.
+ 3. A FRESH `archilyzer build homepage` in the primary. The current `out/` predates `/source`, so
+ the deploy check refuses it.
+ 4. The preview `--preview source` and its live checks.
+ 5. Production.
+ 6–7. What to do if the edge refuses the clone, and if anything private ever ships: delete that
+ deployment.
+ 8. The cut (`release cut editor …`: 2 bullets; export has none) and the worktrees.
+- **Baselines now:** common **2,149**, homepage unit **7**, homepage e2e **36**; editor unit 85,
+ `test:scripts` 185 + 1 and mcp 269 are unchanged.
+
+**Previously (2026-09-28, afternoon): release 11 is LIVE as 0.10.0, and Jasolyzer is launched.** The
+rollout ran 12:11–14:05 ([`release-11.md`](releases.md), "Rollout, as done", every deploy and job
+id): the cut (editor `24c8352e`, export `bf6904e8`), ONE :3001 restart (`BUILD_ID`
+`vWCJb87ktCy5akih_pM9X`, on `main` `e6c5d2e3`), a Settings save (two ran; the second byte-identical — `buildPipeline.mode` dropped, the
+x.com icon `currentColor`), and the six sites by name + the hub + the homepage (the homepage through
+`pnpm ops build-homepage {"deploy":true}` — O4's live proof). **Jasolyzer**
+(https://jasolyzer.pages.dev; `piratesoftware`, 1,889 videos; archives and transcript downloads
+off; vermilion; a draft description the operator may reword) is the sixth site in every footer, the
+hub and the homepage. **The LM chat-only tier is closed as moot** (Legal Mindset's filter has
+`includeLivestreams: true`).
+- **The external drive stalled the rollout** (11:35–12:57): an SMR disk (`sdb`, JMicron JMS578 UAS)
+ under a 10 GB remux timed out, reset and froze :3001 — all four libuv workers blocked in its
+ ext4 reads. No data errors. **Open, for a later slice:** one stalled drive freezes the whole
+ editor. **Operator options:** `echo 180 | sudo tee /sys/block/sdb/device/timeout` (not persistent)
+ and the durable `options usb-storage quirks=152d:a578:u` (a replug; do it with the lanes paused).
+- **Release 12 belongs to a parallel session** (the source mirror, [`source-mirror.md`](sites-and-publishing.md);
+ slice Q merged at `4855f70b`, slice R next). **This session's bundles are release 13**
+ ([`release-13.md`](../release-13.md)): W1 editor lows, W2 export/docs lows, W3 the build image (with
+ W3b: container Build all was broken on `main` — `.next` symlink + the image's baked `public/` —
+ and a wrong-site guard now sits before every site deploy), all reviewed SHIP; then one-core
+ Phase 5 (P0, the plan doc `one-core-phase-5.md`, awaits the operator's OK and five rulings).
+- **Worktrees:** the seven `r11-*` stay until release 12's are gone (index-based ports).
+
+**Previously (2026-09-28, morning): release 11 is merged to `main` in full and NOT rolled out.** The
+overnight of 2026-09-28 ([`release-11.md`](releases.md): every slice's record, then "Integration,
+as merged", then "Rollout"). `main` = `eb28a341` + three integration `plans:` commits
+(FACTS `eeff74c3`, `brand-and-themes.md` `3643c974`, then this STATE and the record); no code
+changed at integration. Nothing was deployed, cut, pushed or restarted; :3001 still runs `BUILD_ID`
+`S07zTu3MKTjHJa9eDM1GF` (2026-09-26 21:46).
+- **The slices, in merge order:**
+ - **O4 — the homepage builds and deploys from `/sites`** (`baaa4b47`): a Homepage section after
+ Hub (Build homepage / Deploy after build / Deploy homepage, a preview branch box), jobs
+ `build-homepage` / `deploy-homepage` / `build-deploy-homepage`,
+ `/api/ops/build-homepage|deploy-homepage` and `pnpm ops build-homepage|deploy-homepage`;
+ `JobLane` survives Strict Mode.
+ - **O3 — runner lows** (`c1d4790a`): an `error` recheck keeps a video "Missing?" (5 real videos flip
+ at the next build: jeralyzer 4, rekietalyzer 1); a failed forced source download keeps the
+ subtitle pass's status and fails the job with yt-dlp's line (`sourceFetchFailure`); a bucket's
+ retry keeps its log (`cookies-mode.spec:241` deterministic); the cut-release lows L3 + L4.
+ - **O6-A — one-core Phase 4 slice 3, checkpoint A** (`cb9d02b2`): `archilyzer doctor`, `run
+ <operation>`, `mcp`, every bin a subcommand, `pnpm archilyzer`; `common/lib/ports.mjs` and
+ `common/lib/envVars.ts` → generated `ENVIRONMENT.md`; `PUBLISH.md` absorbs the two deploy docs;
+ the build mode is a label (then dropped outright: O6c, below).
+ - **O1 — hub lows** (`6cd3a9fe`): `/ask` waits for the hub's list, says when there are no
+ archives, shows a scope line; a member's missing live chat on its chip with a live-chat Retry;
+ `normalizeSocialSvg` themes a single-colour icon (the x.com fix); `mcp/README.md`'s `fetch_clip`
+ env lines. Three DRAFT copy lines (ruled 2026-09-28: shipped as written, O1c).
+ - **O2 — homepage and brand lows** (`139a648e`): a custom hex fitted per base (`perBaseColor`),
+ `--chart-6` (a rust, Vermilion's family, validated), the mark's forced-colours outline, the
+ homepage e2e on a synthetic summary.
+ - **O5 — umtool brand fonts** (`15d5d646`): the rail / ledger / scroll / chart in IBM Plex Sans
+ under the brand, fitted by the face's own advances; IBM Plex Mono Bold vendored; an unbranded
+ render byte-identical (334 files).
+ - **O2b — follow-ups** (`69e7f59e`, + changelog nits `59d2f877`): the hub's added archives fitted
+ per base; `<clipPath>` passed over like `<mask>`; `no-data.spec`.
+ - **O6-B — checkpoint B** (`eb28a341`): every test-only env var `E2E_`-prefixed and declared in its
+ playwright config; the harnesses read `ports.mjs`. **One-core Phase 4 is done** (the optional
+ SETUP/PLAN.md consolidations aside).
+ - **O6c — the build-mode stub dropped** (2026-09-28 morning, on the operator's ruling; branch
+ `r11/phase-4-s3` tip after `5b6a66ec`): `buildPipeline.mode`, the `/sites` toggle and the
+ Settings select are gone; an old `settings.json` with `mode` loads and drops it on the next
+ save; Build all still uses containers whenever `docker version` answers.
+- **Gates on the merged tree** (`eb28a341`; every number in the record): tsc clean; common 2,112,
+ editor unit 85, `test:scripts` 185 + 1 skip, mcp 269, homepage unit 2; the three generated-doc
+ checks exit 0; editor, export site + hub, homepage and umtool builds ok; e2e export 206, `e2e:hub`
+ 33, `e2e:2origin` 3, homepage 31 with 0 skipped (no `homepage/public` data), umtool 175 + 2 failed +
+ 45 skipped (the known `mix.spec` pair; alone ×3 36/36), editor full 652 + 1 failed + 12 skipped of
+ 665 in 39.5 min (`transcript-source.spec.ts:76`, a flake new to the records: alone ×3 9/9).
+ Verdict: **FLAKES-ONLY**, no regression. The primary's `export/public` was byte-identical at every
+ checkpoint.
+- **What the operator owes, in order** (`release-11.md`, "Rollout"; the parent's runbook
+ `~/reports/overnight-2026-09-28/MORNING.html` has the scripts):
+ 1. ~~**The copy rulings**~~ **Ruled 2026-09-28 (the operator: "ship the drafts as written but I
+ don't like this regex bracket link thing").** The four lines in
+ `export/app/ask/hubScopeCopy.ts` ship as written. Follow-up O1c (`a4ffa959`, `r11/hub-lows`)
+ removed the DRAFT markers and replaced the [bracket] + regex link with `` copy`…${link("…")}…` ``.
+ No reader-visible change, so no bullet. Record: `release-11.md`, "Operator rulings and
+ follow-up O1c".
+ 2. **The operator questions the records raise:**
+ - ~~Should Build all honour `buildPipeline.mode` (today a label; O6)?~~ **Ruled 2026-09-28:
+ dropped** ("just drop it for now rather than keep the stub"). Follow-up O6c removed the mode,
+ the `/sites` toggle and the Settings select; an old `settings.json` with `mode` still loads.
+ Build all uses containers whenever `docker version` answers, as before.
+ - ~~Is `--chart-6`'s rust near `--state-gone` acceptable (O2)?~~ **Ruled 2026-09-28: accepted;
+ Vermilion keeps slot 6.**
+ - ~~Settle the five 410'd Rumble videos with a "Full-check unexpected" on `rekietalaw-rumble`
+ and `the-quartering-rumble` (O3)?~~ **Done 2026-09-28 13:32Z** (the operator: "full check the
+ rumble channels"; run by the parent on :3001 through `platform:rumble`): all five read
+ deleted, 0 errors, so they publish as Deleted at the next build, not "Missing?" (jeralyzer's
+ and rekietalyzer's counts do not rise by 4 and 1). Record: `release-11.md`, "Operator
+ actions (2026-09-28 morning)".
+ 3. **A release cut** (`archilyzer release cut all next --commit`; editor 8 and export 9 pending
+ bullets — export's is public on every `/changelog`).
+ 4. **The :3001 restart** on the new `main` (it brings O4's Homepage section and routes, O3's
+ retry-bucket and cut-form fixes, O6's copy and the digest replay that keeps `ids` — restart
+ before retrying any `archilyzer run digest` job — and O2's sidebar outline).
+ 5. **One settings write** after the restart (any Save): it re-normalizes the stored social icons, so
+ the x.com icon loses its `fill="white"`.
+ 6. **The deploys:** the five sites by name, then the hub, then the homepage — the homepage through
+ the new `/sites` → Homepage section (Build homepage, then Deploy homepage), which is O4's live
+ proof.
+ 7. **Re-upload the YouTube picture, watermark and banner** (`~/reports/archilyzer-media/brand/`),
+ still owed since release 10.
+ 8. Optional: rebuild + restart umtool on :3050. Its app changed only in `lib/tools.mjs` (the
+ shared tool probe) and two test-only variable names; O5's render changes already reach it from
+ disk (the live :3050 spawns `report-to-video/*`), and an unbranded render is byte-identical.
+- **Release 14 (2026-09-28): HP merged (`bfa1ff3c`, final review SHIP); T1 and H1/H2 built on
+ `r14/two-grounds-headers`, not merged** — `plans/export-header-first-search.md`, record in
+ `release-14.md`. S1 (a clear screen until the first Search) is next, and S2 is a candidate.
+ - **HP** (merged): the homepage's header carries the social row and one theme toggle at every
+ width, through the shared `SocialLinks`; its wordmark's text drops first on a very small
+ screen; Changelog is in the footer; the cards wear the site's wordmark; a social icon is
+ checked by an allowlist on save and at render; `featured` on a social link.
+ - **`r14/two-grounds-headers`** (built, `0f358ee7` + the records):
+ - the final review's Lows (F1, F3, F4, F5, F8);
+ - F8 opts every cwd-derived path op in the three Next apps out of Turbopack's tracing, with
+ the guard widened to `scripts/next-build-trace.test.mjs`;
+ - the charts' foreground separators are withdrawn for a 2 px gap in the surface's colour,
+ the shared charts included;
+ - **T1:** two grounds, Light and Dark, in every app; a stored Sepia reads as Light before
+ paint and is rewritten; each site wears its own accent, and the accent picker is gone;
+ - **H1/H2:** every site's header and the hub's carry the social row and the toggle as one
+ group; an Archilyzer link to the homepage's new `#instances` replaces the sites dropdown
+ and the hub link; Changelog is in the footer; the wordmark's text drops exactly when it
+ does not fit, for any title; the inline nav starts at `lg`.
+ - **Reviewed SHIP AFTER FIXES; the fixes are in:**
+ - stacked areas in the shared charts keep their coloured edge, with the surface gap on
+ stacked bars only (H1);
+ - the growth chart measures thickness at right angles before it takes a gap, so no band is
+ covered; the gaps now read as dashes, and folding the small sites into "Other" or small
+ multiples is the operator's call (M1);
+ - the hub URL texts say what the setting does now (M2);
+ - the Lows (L1, L2, L5, L6, L9, L10); L3 and L7 are left, and L4 needed nothing.
+ - **Owed:** the parent's merge, then the rollout in `release-14.md` ("## Rollout"): the editor,
+ then the homepage (with `#instances`) before any site, then the hub, then the six sites.
+ - **The narrow header, as ruled after the review, is built** (`447ded9a`). Below 520 px every
+ header shows the name and only the links marked **Keep in header on small screens** (none
+ marked → none); from 520 px it shows every link, up to four.
+ - **Re-reviewed SHIP; its findings are in** (`1a2e3342`, `4ea1c495`, `11a33f7a`):
+ - below the switch the export bar's two gaps are 8 px (ruled 2026-09-29): every real title
+ shows in full at 360 px under touch with one marked link (Rekietalyzer at exactly 360);
+ - the wordmark's reservation is a minimum width, so wider-rendering text is never clipped;
+ - the switch is `32.5rem`, so it moves with the reader's text size, and the homepage's
+ wordmark fit is keyed by the wide row's count from it;
+ - a marked link keeps its configured place (ruled as built).
+ - **The operator's settings:** the link to keep in the header is marked in Settings BEFORE any
+ build; the parent does this when the branch lands (`release-14.md`, "## Rollout",
+ precondition 5).
+- **Next candidates:** one-core Phase 5 (projects join the core, `plans/one-core.md`); the Diagnostics
+ cards keeping their retry log (O3's found-and-left); `ChartView.tsx`'s five-slot cycle reaching
+ `--chart-6` (O2); O5's two wording lows in `svg-faces.mjs` / the README (kerning is not
+ conservative; `FALLBACK_EM` has exceptions); the LM chat-only tier config; the `Dockerfile.build`
+ image refresh; `transcript-source.spec.ts:76`'s stale-snapshot race (FACTS, "What the integration
+ gate found"); removing the seven `r11-*` worktrees, this one included once `main` carries its tip
+ (it re-sorts the port blocks; `diet-series` stays).
+
+**Release 10 is fully rolled out as 0.9.4 (2026-09-28, 00:53).** The blocks below this one are
+the history, newest first from "Accent swap and mark contrast rolled out".
+- **Slice MR** (the mark ring on dark) merged `2b10f31b`; **0.9.4** cut as editor `2a6f6884` +
+ export `ee9d41fa` (record: `release-10.md`, "Slice MR, as shipped").
+- **Deployed from `ee9d41fa`** (`~/reports/release-10/tmp/r10-*.log`): the five sites by name
+ (jeralyzer `df279ac1`, anilyzer `e367536d`, bonnellyzer `41e9b1aa`, hasanalyzer `a48342b6`,
+ rekietalyzer `05444c21`), then the hub `10d6946f`, then the homepage `7ca70923`.
+- **Verified live:** `--mark-ring` on every surface; `/changelog` shows 0.9.4.
+- **Owed by the operator:**
+ - the :3001 editor restart (the favicon and the sidebar mark's ring; :3001 still runs the
+ post-brand build of 2026-09-26 21:47, `BUILD_ID` `S07zTu3MKTjHJa9eDM1GF`);
+ - re-uploading the YouTube picture, watermark and banner (`~/reports/archilyzer-media/brand/`).
+- **Next:** release 11, the overnight of 2026-09-28 ([`release-11.md`](releases.md)).
+
+**Previously (2026-09-26, afternoon): release 10 is merged to `main` in full and NOT rolled out.** It is
+the brand (S0–S3: the Found-line mark and base × accent reader themes; its own final commit
+`bb6f378f`, then cut as editor + export 0.9.0 at 01:37, `0e0d8f59` + `31798769`), plus brand S4 and
+the lows L1 + L2. Those three merged 2026-09-26 12:52 on the operator's word, before the rollout,
+and the integration pass gated them together. Record: [`release-10.md`](releases.md) (the L2
+and L1 records, then "Integration (S4 + L1 + L2), as merged"); the brand's plan and per-slice
+records, S4's included: [`brand-and-themes.md`](../brand-and-themes.md).
+
+**Hub link hidden again (2026-09-26 night, operator: "Hide the hub again for now"):** `9217eaaa`
+`homepage/app/page.tsx` `HUB_LINK_ENABLED = false` (the release 9 C3 flip reversed); the hub stays
+deployed and reachable by URL, the sites' header backlink points at the homepage (not the hub) so
+nothing else changes. Homepage e2e 27/27; redeployed to production from the primary (see the line
+below this block's homepage entry).
+
+**Merged to main (2026-09-26), NOT rolled out:**
+- **Slice P, cut a release from the CLI — merged `2edaf4f8`** (`cli/cut-release` @ `e23782e8`, reviewed SHIP
+ after fixes; common 2,015, scripts 174 + 1, e2e list 53/53). One writer `common/controller/cutRelease.ts`;
+ the `/sites` form is an adapter (its version box also takes `next`/`next-minor`);
+ `archilyzer release show|cut <editor|export|all> <X.Y.Z|next|next-minor> [--commit] [--date]` locally with
+ no editor running (`all` cuts both or neither; a real calendar date; a version newer than the latest
+ heading); `pnpm ops cut-release --json '{"workspace","version","commit"}'` → `/api/ops/cut-release`
+ (exists only on an editor built from this main). No package.json bump, no tag — the heading is the
+ version. Proved read-only from the primary: `release show` → editor 0.9.0 + 9 pending, export 0.9.0 +
+ 4 pending, next-minor 0.10.0. The runbook's step 0 is now that command. Plan:
+ [`cut-release-cli.md`](sites-and-publishing.md).
+- **Slice O, the Ko-fi mark on every site — merged `6a5167a7`** (`export/kofi-mark` @ `ec08bc7e`, reviewed
+ SHIP; export e2e 204/204, hub 24/24). The official `kofi_symbol.svg`, byte-identical at
+ `export/public/kofi-symbol.svg`, is the LAST item of the footer's social row on every site and the hub
+ (accessible name "Ko-fi", no copy, official colours, offline-cached like the icons); the hub's bare
+ text link is gone. SUPERSEDES the 2026-09-25 "hub + homepage only" ruling on the operator's word
+ (2026-09-26: "show kofi in the social section on all sites"). Homepage untouched. Live only after
+ every site + the hub rebuild (runbook steps 5–6). Plan: [`kofi-mark-on-sites.md`](sites-and-publishing.md).
+ **Reversed by `export/drop-kofi`** (Ko-fi dropped for now, 2026-09-26; record in `release-10.md`).
+- **Slice N, the whole-recording fetch downloads anyway + metadata history — merged `6a1678a0`**
+ (`editor/full-fetch-media` @ `115f9656`, reviewed SHIP after fixes; full editor e2e 641/2/12 of 655,
+ both failures classified: `tags.spec:220` load flake 3/3 alone, `cookies-mode.spec:241` a pre-existing
+ log-unmount in `DownloadStage.tsx`, low). `forceMedia` on `downloadOneManaged`: Persist source video,
+ `fetch_clip` `full: true` and Persist kept now fetch + persist the source on a captions-only channel
+ even with a transcript on disk (Whisper transcript untouched, no audio beside one; YouTube subs are
+ re-fetched as on any re-download). Every `metadata.info.json` rewrite appends a normalized diff to
+ `metadata.history.json` (cap 200), shown on the video page. NEEDS the :3001 restart (runbook step 1);
+ live proof after it: `full: true` on `teamrcn/dbnS-cBgStY` → a file in `saved-videos/`, and a
+ history entry. Plan: [`full-fetch-forces-media.md`](acquisition-and-pipeline.md).
+- **Slice M, `fetch_clip`, merged after the integration pass and ALREADY IN EFFECT:** `mcp/fetch-clip`
+ @ `fa44984a` → `main` `64f26a71`. The MCP gains ONE tool that asks the live editor's
+ `POST /api/media/fetch-window` for a cited moment's media (a window ≤ 15 min, or `full: true` for
+ the whole recording into the saved-video store); the ask/sweep plans send media through it and
+ never a hand-run yt-dlp. Live-proved 2026-09-26 evening against :3001 (YouTube window fetched then
+ cached; Rumble embed id → slug dir; full recording fetched then cached); `archilyzer` re-registered
+ with `ARCHILYZER_EDITOR_URL` + `WORKER_TOKEN`. Nothing to restart. The `/ask` fresh-session proof
+ is DONE too (19:15Z, a Kirsche clip through `fetch_clip` with `source: remote:…anilyzer…`, 47 s). Two editor-side lows found by the proof (record, "Slice M — fetch_clip, merged and
+ proved live"): full mode is a silent no-op on a captions-only channel whose video already has a
+ transcript; full mode rewrites `metadata.info.json`. Plan: [`mcp-fetch-clip.md`](acquisition-and-pipeline.md).
+- **The merges**, in the planned order: S4 `dcb04f61` (`brand/media` @ `333d2826`) → L2 `41ddc382`
+ (`r10/runner-lows` @ `14e96739`) → L1 `5c0a6ef9` (`r10/hub-lows` @ `b6b47ec1`). The code merged
+ clean; the conflicts were `plans/release-10.md` (the record sections, all kept) and one
+ `editor/CHANGELOG.md` `[Unreleased]` join (S4's bullet and L2's four in one section above
+ `[0.9.0]`).
+- **Integration tip:** `brand/found-line` = `main` `4ac32a2e` + the integration `plans:` commits
+ (FACTS `9e3047e3`, then this STATE and the record). `4ac32a2e` is `5c0a6ef9` plus the plans-only
+ `plans/mcp-fetch-clip.md`, committed to `main` during the pass; the integration commits were
+ rebased onto it. No code changed at integration. The parent fast-forwards `main` to the tip, and
+ the runbook's `FINAL` is that tip.
+- **What is in it:**
+ - **S4, Archilyzer Media:** `common/lib/brandMedia.ts` (the lockup with its letters as glyph
+ outlines); `common/bin/brand-media.ts` (the YouTube assets, already generated in
+ `~/reports/archilyzer-media/brand/`, with `INDEX.html` there; upload any time); umtool
+ report-to-video's opt-in `render.brand: "archilyzer-media"` with vendored OFL fonts (a manifest
+ without it renders byte-identical, 334 files checked); and the brand choice in umtool's
+ new-project form.
+ - **L1, hub:** subs 404 = an empty manifest, one retry, never fails an archive; `/ask` honours
+ the scope chips (none in scope: disabled + one line); the official instances in the homepage's
+ order and colours; the playwright config and the compose scripts never write through
+ `export/public` links (`common/bin/_publicFile.ts`; the FACTS workarounds are retired).
+ - **L2, runner:** YouTube's "try again later" soft block backs off (batch, runner, scan, a
+ prefetch early exit; the availability check stops); `verifyBeforeClean` never judges an
+ unprobed suspect; the boot pass waits at most 60 s for the storage pass; `/jobs` shows
+ `cancelReason`; the safeRevalidate warning is counted.
+- **Gates on the merged tree** (`5c0a6ef9`; every number in the record):
+ - tsc clean;
+ - common 1,954, editor unit 85, `test:scripts` 173 + 1 skip (the report-to-video tests
+ included), mcp 219;
+ - editor, export site + hub, homepage and umtool builds ok, the icon checks green;
+ - e2e: export 204, `e2e:hub` 24, `e2e:2origin` 3 (the `export/public` links left in place: the
+ primary's `export/public` and a `sw.js` sentinel byte-identical throughout), homepage 27;
+ - umtool 175 + 2 failed + 45 skipped (the known order-dependent `mix.spec` pair; alone 6/6);
+ - editor full 634 + 6 failed + 12 skipped in 54.6 min, under the live editor's load. All six are
+ flakes (fixture EEXIST, the pulse timing tripwire, two sync-deep stamp races, a 7 s task timer,
+ the diarization snapshot poll); alone ×3: 18/18. No integration regression.
+- **Next action: the operator re-cuts the editor + export `[Unreleased]` notes, then the rollout
+ per `~/reports/release-10/RUNBOOK.html`** (`make-runbook.py` beside it; the scripts in
+ `scripts/`). Both changelogs have a new `[Unreleased]` above the 0.9.0 cut. Export's (L1's three
+ hub bullets) is public on every site's `/changelog` from the next site build; the editor's holds
+ S4's and L2's. Cut on `/sites` → Release notes with "Commit changelog" unticked whenever the
+ primary's tree is dirty (it refuses one; at the 0.9.0 cut an untracked
+ `settings.json.pre-priority-*` made it so, and the tree was clean at this pass), then commit both
+ files by hand.
+ Then, per the runbook:
+ 1. restart :3001 on the new `main` (one editor restart; md5 before / pre-restart / after-boot;
+ smoke);
+ 2. optionally, rebuild and restart umtool on :3050 with `r10-umtool.sh`, for the form's brand
+ choice;
+ 3. set each site's accent and wordmark lead;
+ 4. preview Anilyzer;
+ 5. deploy the five sites by name, then the hub, then the homepage.
+- **Jeralyzer already serves the brand, in Signal.** A build-deploy on the live editor built
+ Jeralyzer from `main` @ `386ac995` and deployed it to production (job `01M3F36N7SCKGC5JV27EBDFYPN`,
+ 2026-09-26 10:51–11:06, no agent recorded). That tree was the brand plus the 0.9.0 notes, before
+ S4/L1/L2. Its accent is unset, so it wears Signal until the runbook's step 4 (every site by name) rebuilds
+ it in Brass.
+ The same build left the primary's `export/public` as a Jeralyzer site compose (no hub `sw.js`,
+ `hub-sites.json` or `hub-summary.json`).
+- **umtool is no longer untouched.** Its report-to-video scripts changed on disk, and the live :3050
+ already spawns them (it still runs release 8's build, `a9YAe_dwhuM6DiCPzIwMD`). That is safe: a
+ render that does not opt in is byte-identical. Its app changed only for the new-project form's
+ brand choice, which appears after the optional `r10-umtool.sh` rebuild and restart.
+- **Copy rulings still owed by the operator:** *(RULED 2026-09-28: all four hub copy lines ship as
+ written, each now carrying its link in the line (the tagged template `copy` with `link()` replaced the
+ [bracket] regex);
+ `/ask` shows the scope line. Release 11 follow-up O1c, merged `e1ef1923`.)*
+ - `NO_ARCHIVES_IN_SCOPE` (`export/app/ask/hubScopeCopy.ts`). The draft is "No archives selected.
+ Choose some on the [hub's front page] to ask.", with the bracketed words a link to `/`. It
+ ships as drafted unless changed.
+ - Whether `/ask` shows a "Searching N of M archives" scope line.
+- **New lows (not started):** *(ALL CLOSED 2026-09-28 by release 11, merged to `main` and not yet
+ rolled out: the icon by O1 — `normalizeSocialSvg` themes a single-colour icon, applied at the next
+ settings write; slice N's forced download and `cookies-mode.spec:241` by O3; `/ask` on a
+ zero-archive hub and the chip's missing live chat by O1 (DRAFT copy); `resolveMaybeMissingState` by
+ O3; umtool's rail/ledger/chart font and the bold IBM Plex Mono by O5. See `release-11.md`.)*
+ - the operator's x.com social icon is invisible on the light footer (1.11:1): its `<path>` carries
+ `fill="white"` and `normalizeSocialSvg` defaults only the root fill — fix by re-pasting the icon
+ without the path fill in `settings.json` (found by slice O's screenshots);
+ - slice N: a forced source download that fails on a video with a transcript marks the download
+ failed, the fetch job still ends `done` with no file, and a `source-media.*.part` can linger;
+ - `cookies-mode.spec.ts:241` intermittent under load: `NeedsCookiesList` returns null when its bucket
+ empties and unmounts the retry's run log (`DownloadStage.tsx:442`) — keep the card mounted while a
+ run lives, as `SourceVideoSection` does;
+ - `/ask` waits forever ("Loading transcripts…") on a hub with zero archives;
+ - the chip doesn't show a member's missing live chat (it needs a subs-only Retry);
+ - `resolveMaybeMissingState` reads an `error` probe newer than the scan as `available`
+ (display only: the published presence badge);
+ - umtool's rail, ledger and chart text stays Fira Sans under the brand;
+ - no bold IBM Plex Mono is vendored (the HyperFrames band's `fontBold`).
+- **Worktrees that can go:** `brand-mark`, `brand-themes`, `brand-media`, `r10-hub-lows` and
+ `r10-runner-lows` are all merged. `brand-found-line` can go once `main` carries its tip. Removing
+ any of them re-sorts the port blocks (`diet-series` moves up).
+
+**Accent swap and mark contrast rolled out (2026-09-27, 15:21):**
+- **Accent swap.** On the operator's word ("matches the subjects' branding") **hasanalyzer = violet** and **bonnellyzer = blue**, set through the site form; the md5 check shows only those two `site.json` files changed. The mapping is now:
+
+ | Site | Accent |
+ |---|---|
+ | jeralyzer | brass |
+ | hasanalyzer | violet |
+ | anilyzer | sakura |
+ | bonnellyzer | blue |
+ | rekietalyzer | green |
+ | jasolyzer | vermilion |
+
+- **Slice MC** (mark contrast) merged `7f64e507`. The mark's dim lines now reach 3:1 against their tile: child `#6b5d47`, Archilyzer `#586977`, and every lit value stays at least 2:1 above them. The rules are pinned in `common/lib/brand.ts`. The chart passes the validator for adjacent pairs in both orders.
+- **Release 0.9.3** cut: editor `cca3b7df`, export `5267f454`.
+- **Deployed** by `r10-sites.sh` plus `r10-home.sh` from `5267f454`:
+ - the five sites (jeralyzer `f6ec1484`, anilyzer `dc65b57b`, and so on);
+ - the hub `9c5e0b0c`;
+ - the homepage `716ab0d6`.
+- **Verified live:** each site's `data-accent`, the header dim `#6b5d47`, the icons' dims, the parent `#586977` on the hub and homepage, and the homepage stripes and summary on the swapped accents.
+- **Owed by the operator:**
+ - the regenerated YouTube picture, watermark and banner need re-uploading (`~/reports/archilyzer-media/brand/`);
+ - the editor's own favicon updates at its next restart.
+- **Open, the operator's call:** on the dark base the ink tile still merges into the ink page. A hairline ring or a lighter tile on dark would fix it.
+
+**Release 10 rolled out (2026-09-27, 02:28):**
+- **Accents and wordmark leads** were set through the live editor's site form; the md5 check shows exactly the six `site.json` files changed:
+
+ | Site | Accent | Lead |
+ |---|---|---|
+ | jeralyzer | brass | Jer |
+ | hasanalyzer | blue | Hasan |
+ | anilyzer | sakura | Ani |
+ | bonnellyzer | violet | Bonnell |
+ | rekietalyzer | green | Rekieta |
+ | jasolyzer | vermilion | Jaso |
+
+ Rekietalyzer moved from vermilion to green because no five-accent set passes the dataviz validator on all pairs; see `release-10.md`, "Slice AC".
+- **Slice AC** (accent colours) merged at `edf8dabc`, then **0.9.2** was cut (editor `9bb0a012`, export `d9edb240`).
+- **Deploys:** `r10-sites.sh` ran from `d9edb240` (01:55–02:27), then `r10-home.sh`:
+ - jeralyzer `52254b28`, anilyzer `8417624e`, bonnellyzer `db2b1820`, hasanalyzer `ca2d5073`, rekietalyzer: see the log;
+ - the hub `92aad41e`, whose `hub-summary.json` covers 5 instances;
+ - the homepage `1eb1f60d`.
+- **Verified live:** every site has its `data-accent` and split wordmark, the hint is `text-brand`, and no page links to Ko-fi. The homepage cards use `var(--swatch-<id>)`, the chart uses `--chart-1..5`, and both summaries carry `accentId`.
+- **The editor was not restarted, on the operator's word.** :3001 has run a post-brand build since 2026-09-26 21:47 (`BUILD_ID` `S07zTu3MKTjHJa9eDM1GF`, main ≈ `9801a034`).
+- **Skipped:** the runbook's Anilyzer preview / phone check, on the operator's choice to deploy all five directly.
+- **Still optional:** `r10-umtool.sh`.
+- **New lows:** *(both CLOSED 2026-09-28 by release 11 O2, not yet rolled out: `--chart-6`, a
+ validated rust in Vermilion's family; a custom hex fitted per base through `perBaseColor`.)*
+ - A sixth published site's chart colour would nearly duplicate Anilyzer's magenta. Fix this before Jasolyzer gets a `siteUrl`.
+ - A custom hex is not fitted per base on the homepage cards.
+
+**Deployed 2026-09-26 23:58 (release 10, partial rollout):** Ko-fi dropped for now (merged
+`a54014e5`); release **0.9.1** cut (editor `98d4bf6f`, export `bc1b0a03`, `archilyzer release cut all
+next --commit`); the hub (ops job `01M3GF6SKBJFGH4R7YY3TRMBZE`, deploy `0cda9466`) and the homepage
+(`r10-home.sh`, deploy `665b9faf`) redeployed from `bc1b0a03`. Both are verified live: no Ko-fi link,
+`/kofi-symbol.svg` 404, `data-accent="signal"`, and the homepage `/changelog` shows 0.9.1.
+**Still owed** (runbook, in order):
+- the :3001 editor restart;
+- each site's accent + wordmark lead, set in the site form;
+- the Anilyzer preview;
+- the five sites. Jeralyzer is live on the brand in Signal until then.
+
+**Live on :3001 — unchanged since 2026-09-25, 19:40:** `0213f6c8` (release 9 slice F + hub C1),
+`BUILD_ID` `P0VMdKX7gbdsaiS5GvorF`; umtool's build untouched (`a9YAe_dwhuM6DiCPzIwMD`; its
+report-to-video scripts on disk are `main`'s, above). Live sites:
+- https://archilyzer-hub.pages.dev — C1 + C1b + C2 (archilyzer theme, "Official Instances" with
+ the homepage's figures, scope chips, per-archive state, "N of M archives answered", archive named
+ on every card, bare Ko-fi footer link), deploy `6ef7f472` (20:50);
+- https://archilyzer.pages.dev — **release 10's build** (the brand, in Signal) from `main`
+ `555bc454`, deploy `857e0092` (2026-09-26 17:19). It was deployed early, on the operator's word, by
+ the runbook's own `r10-home.sh`, so **the homepage half of the runbook's step 5 is done**. Its
+ `/changelog` shows export's `[Unreleased]` until the re-cut and a redeploy. There is no UI deploy
+ yet: [`homepage-deploy-from-ui.md`](sites-and-publishing.md);
+- https://jeralyzer.pages.dev — **the brand, in Signal**, deploy `35593886` (2026-09-26 11:06, above);
+- the other four official sites at release 8's slices Z + E (17:45 / 18:10 deploys); they carry no
+ Ko-fi, and with Ko-fi dropped (`export/drop-kofi`) release 10's rebuild will not add it.
+
+**The release 10 candidates of 2026-09-25 evening are all done** (L1 and L2 above). Next after
+release 10's rollout: the homepage deploy from `/sites` ([`homepage-deploy-from-ui.md`](sites-and-publishing.md),
+one small slice), Phase 4 slice 3 (`plans/one-core.md`), the LM chat-only tier config, the
+`Dockerfile.build` image refresh, and the new lows above.
+
+**The 2026-09-25 evening plan is complete** (steps A–C: release 9 F + C1 live on :3001; C1b, C2, C3
+on the hub and the homepage). The operator's rulings (C2's federated search as proposed; a bare Ko-fi
+link on the homepage and hub footers only — superseded 2026-09-26 by slice O, the mark on every site,
+and then **Ko-fi dropped for now** (2026-09-26, `export/drop-kofi`: no Ko-fi link or asset on any
+site, the hub or the homepage); the Paramount Tactical filter clear) are recorded in
+`release-9.md`. Paramount Tactical downloads in full at lane pace since the operator cleared its
+`Quartering` include filter (19:35). See the
+[release-9 rollout record](releases.md).
+
+See the
+[release-8 rollout record](../release-8.md#rollout-2026-09-25-late-afternoon--0e72ef73-live-on-3001-second-restart-of-the-day).
+
+**Last updated:** 2026-09-25 (late afternoon). **Release 8 is live, the day's second restart.**
+- Release 8 (`bb3dbb4c` → `0e72ef73`) has two slices, each Opus-reviewed: SHIP AFTER FIXES, then
+ SHIP.
+ - **V, video titles** (`one-core/r8-video-titles` → `faa92c51`), the operator's 13:40 ask. The
+ channel video list shows and searches titles: index → scan store → `metadata.info.json`,
+ memoized per channel by the `data/` mtime after the review measured Rumble lists at 5 s per
+ render. The video page shows scan-store metadata for an undownloaded video.
+ - **S, one shared auto-queue state** (`one-core/r8-state-share` → `0e72ef73`). This is the root
+ cause of the 13:33 `state.json` revert, which recurred at ~14:18: four lanes booted
+ concurrently and each held a private copy. The in-flight read is now cached, and a manual
+ Sync/scan 429 cooldown writes through the live object.
+ - Record: [`release-8.md`](../release-8.md).
+- Gate on `0e72ef73`: tsc 0, common 1,810, editor unit 75, scripts 161 + 1 skip, `next build`
+ ok, the union of both slices' specs 86/86. No numbers changed.
+- Rollout. md5 80 → 80, with one explained difference: `paramount-tactical/config.json`, the
+ operator's `downloadFilter.include: "Quartering"` plus a `lastFullDownloadAt` stamp. The
+ deferral and `fails: 13` survived the restart. Smoke `SMOKE_FAIL=1` with both flags explained:
+ a moving jobs list, and a correct deferral where the old check expected `[]`. Titles are proved
+ live on `/channels/paramount-tactical/videos`.
+- **Second-restart proof:** no `legal-mindset` re-scan on either of today's boots.
+- **Paramount Tactical.** The boot-dispatched metadata scan ran at about 10/min with 0 429s. It
+ was cancelled at 377/1,382 on the operator's ask, and its store kept the 377. download-missing
+ then settled **376** non-matching videos by the filter with no request and is downloading the
+ rest. `pnpm ops keep-videos` ran live for the first time: 1 match (`NV1QqS9NOiU`), marked.
+- **The owed `teamrcn` sync ran** and moved exactly `lastSyncedAt` + `lastFullSweepAt`, but it
+ reads `failed`: `Invariant: static generation store missing in revalidatePath`. A QUEUED job's
+ own `revalidatePath` runs outside any request.
+- Operator questions answered today: the 429s are not concurrent downloads, and
+ `downloadFilter.include` has a UI (release 7).
+
+**Open:**
+- **the queued-job `revalidatePath` fix**, small. A `safeRevalidate` in the editor, or drop the
+ job-body revalidations for `requestChannelSnapshot`. Until then, an ops job that queues reads
+ `failed` after doing its work. The running download-missing `01M3CY7FHQNMTA376HA724BKK7` is
+ expected to end that way;
+- **the keep-videos re-run** after download-missing finishes (dry run first, `match:
+ "TheQuartering|Quartering"`). Optionally, the rest of the Paramount Tactical scan (~1,000) for
+ list titles;
+- the `/jobs` stall label misreads a slow scan (`STUCK · POSSIBLY-STALLED` at 10/min); stale
+ `queued` metas after a restart; the smoke's deferred check should become "well-formed";
+- S's optional merge nit (merge `until` and `fails` separately); V's memo nits and L3;
+- the evening pacing watch: `grep -h 'deferred 6h' transcripts/.jobs/*.log`;
+- the 410 re-read (release 7 step 11), not observed;
+- candidate: YouTube `--sleep-requests` in `common/ytdlp/platformArgs.mjs`, not applied;
+- worktrees to remove: `one-core-r8-{video-titles,state-share}`, `one-core-r7-{pacing,cli,keep}`,
+ `one-core-r5-{exports,rumble}`, `one-core-r6-followups`, `one-core-phase-4-s1`;
+- `thequartering-X`'s transcripts manifest goes live at the next jeralyzer build + deploy.
+
+**Next:** the `revalidatePath` fix (a small slice), then Phase 4 slice 3: config + docs,
+`doctor`, `run`, `mcp`, and `PUBLISH.md`.
+
+**Last updated:** 2026-09-25 (afternoon). **Release 7 is live, with release 6 riding along.**
+- Release 7 (`0032ed8a` → `bb3dbb4c`), three slices, each Opus-reviewed: **Y** pacing
+ (`one-core/r7-pacing` → `2497d20b`): a rate-limited video is deferred 6 h (`videoDeferrals`,
+ persisted beside `platformBackoff`) so the lane moves on after the cooldown; an identical
+ metadata-scan error refreshes its `at` once a cooldown old. **C** the CLI (`one-core/r7-cli` →
+ `3049be43`): `common/bin/archilyzer.ts`, named publish entry points, export's `build` = the CLI
+ (`build:nodata` / `prebuild` gone), docker scripts on the CLI, hub build + deploy (`/sites`,
+ `pnpm ops`, CLI), `build|deploy homepage`, the posts-only 404 fixed in the composer. **K**
+ `pnpm ops keep-videos` (`one-core/r7-keep` → `ac2c4aee`), the operator's mid-rollout ask. Plus
+ `211d4666`, a test-only guard (below). Record: [`release-7.md`](releases.md).
+- Final suites on `3049be43`: editor 626 passed / 5 failed / 12 skipped (53.1 min, machine in
+ swap) — four load timeouts and one REAL isolation bug: `ops-api.spec.ts` deploy-hub started a
+ deploy job of the hub a 2origin run had left in `export/out` (nothing reached Cloudflare), fixed
+ `211d4666`; the five specs on `bb3dbb4c`: 55/55. Export 192/192, hub 8/8, 2origin 3/3.
+- Rollout: install no-op; numbers 1,353 paths / 3,859 lines (corpus growth); md5 80 → 80
+ identical across the restart; smoke `SMOKE_FAIL=0`; a Rekietalyzer `skipData` build through
+ `pnpm ops` (27 s, no `prebuild`, no data phase). The old server had already run C's new
+ `build site` script live at 13:00 (a Rekietalyzer build-deploy, 81 files).
+- **Pacing proved live within 10 minutes of boot:** the old build had looped 12× on
+ `paramount-tactical-videos/_60iFE_FBPQ`; the new runner's first 429 logged `… (attempt 13).
+ _60iFE_FBPQ deferred 6h; next video after cooldown.`
+- Operator questions answered: the 429s are NOT concurrent downloads (one serialized
+ `platform:youtube` queue, 0 overlaps in 36 h; all 26 are subtitle fetches, multiplied by the old
+ re-pick loop); `downloadFilter.include` has a UI (Configure form).
+
+**Open:**
+- the owed `teamrcn` sync (step 10) and the Paramount Tactical metadata scan, queued behind the
+ youtube cooldown; then `pnpm ops keep-videos {"slug":"paramount-tactical","match":"TheQuartering"}`
+ (dry run first) — the channel was renamed from `paramount-tactical-videos` at ~13:29;
+- the evening watch: `grep -h 'deferred 6h' transcripts/.jobs/*.log`; the scan-error refresh
+ proof needs a second restart within 24 h;
+- the 410 re-read (step 11), not observed today;
+- candidate: YouTube `--sleep-requests` in `common/ytdlp/platformArgs.mjs` — not applied;
+- worktrees to remove (`one-core-r7-{pacing,cli,keep}`, `one-core-r5-*`, `one-core-r6-followups`,
+ `one-core-phase-4-s1`);
+- `thequartering-X`'s transcripts manifest goes live at the next jeralyzer build + deploy.
+
+**Next:** Phase 4 slice 3 (config + docs, `doctor`, `run`, `mcp`; `PUBLISH.md` absorbing
+`DEPLOY_DOCKER.md` + `DEPLOY_CLOUDFLARE.md`, and the two stale `archilyzer.pages.dev` hub hints C
+left: `SettingsForm.tsx:48`, the `homepage.ts:31` comment).
+
+**Last updated:** 2026-09-25 (early morning). **Release 5 is live; release 6 is merged.**
+- Release 5 (`f4da04a9` → `93dcb532`): slice R (`one-core/r5-rumble` → `3adaea9b`): one yt-dlp arg
+ builder with a platform table (Rumble: `--impersonate chrome --sleep-requests 1` on every spawn), a
+ 429 mid-sweep is "incomplete" (paged walk + platform cooldown, never a listing, never a stamp), a
+ bare 403 backs the platform off. Slice X (`one-core/r5-exports` → `93dcb532`): `transcriptDownloads`
+ (absent = on) on `site.json` AND `homepage.json`, gating the three per-video export controls on
+ the export site; the site and hub forms carry the checkbox. Final suites on `93dcb532`: editor
+ 628/628 (no flake), export 192/192, hub 8/8. Record: [`release-5.md`](releases.md).
+- Rollout: ONE restart; smoke green; boot rewrote nothing; proof sync of `rekietalaw-rumble` and
+ the first complete `the-quartering-rumble` sweep in 44 days (8,045 listed, was 7,866, paced past
+ page 300 with no 429; the job finished 01:50 with 97 videos archived, 0 errors, both stamps set;
+ its 4 maybe-missing checks are upstream 410s that read `error` until the follow-ups' 410→deleted
+ fix is rolled out); exports off on the five published sites (form → build-index → build-deploy
+ each, verified at the public URLs; Anilyzer's owed production deploy rode along, now at spec 4).
+- Release 6 (overnight, operator-approved): follow-ups (410 → deleted, umtool gets the platform args
+ through ONE table in `common/ytdlp/platformArgs.mjs`, atomic remote-transcript write, stale comment,
+ measure-nav routes) and Phase 4 slice 1 (`buildDeployCore.ts` → `common/publish/build.ts`, aws-sdk
+ deps to common; the move only — entry points, docker scripts and build:hub wait for the CLI slice).
+ Record: [`release-6.md`](releases.md). 188 orphan `*.tmp-*` files deleted (filtered).
+- Found and filed, not fixed: [`youtube-lane-pacing.md`](acquisition-and-pipeline.md) — the evening's
+ three YouTube cooldowns were ONE Short retried 12× from the head of the queue; the fix is a 6-hour
+ per-video quarantine (small slice, recommended next), plus `metadataScanStore.ts:249-252` (scan
+ error timestamp never refreshes → 142 members-only videos re-scanned every runner start).
+
+**Next:** Phase 4 slice 2 (`common/bin/archilyzer.ts` + the rest of spec item 1), the pacing slice,
+then the release-6 rollout (one restart) with the pacing fix riding along if it is ready.
+
+**Last updated:** 2026-09-24 (evening). **Release 4 is on `main` @ `e172749b`, and one-core
+Phase 3 is COMPLETE. Phase 4 is next.** The prelude was plans only: `4130aca1` (the rollout
+record) and `bbad0977` (the owed sync sweep). The three plan files `77f63356`, `42caf3cc` and
+`cc89abfa` were filed during the release. Three worktrees were cut off `4130aca1` and merged
+in this order:
+- `one-core/phase-3-p` → `77a32de2`;
+- `one-core/phase-3-w` → `ddad13f4`, which merged P and re-gated as `44dd843f`;
+- `one-core/phase-3-s3b` → `e172749b`.
+
+Release record:
+[`one-core-phase-3.md`](../one-core-phase-3.md#release-2026-09-24-evening--rollout-prelude-slice-p-slice-w-slice-3b),
+with the P, W and 3b "as shipped" sections above it. What is still open is in
+[`one-core-phase-3.md`](../one-core-phase-3.md#next--phase-4). Anchors are in
+[`FACTS.md`](../FACTS.md#one-core-phase-3-release-4--slices-p-w-3b-verified-2026-09-24-main--e172749b).
+Previous: release 3, slices 3a and 4b, on `main` @ `ef88ac4d`
+([record](../one-core-phase-3.md#release-2026-09-24--rollout-slice-3a-slice-4b)), live on :3001
+as `9ab10d77`.
+
+- **Slice P: /channels rack polish.**
+ - One layer ladder (`channels/components/rackLayout.ts`: popover > thead > group header >
+ identity, plus the deck). Channel rows no longer paint over a group's station buttons.
+ - Four audit fixes: pinned group controls, an Advanced panel that scrolls into view, the
+ section rule as an inset shadow, and the region as `isolate`.
+ - The Transcribe station counts `downloadedNoTranscript` + `downloadedAutoSubsOnly`, minus
+ exclusions, for every handling, and queues exactly those ids as two bucket jobs.
+ - No number moved (`phase3-view-numbers.ts`, diff empty).
+- **Slice W: one write idiom.**
+ - `writeFileAtomic` / `copyFileAtomic` sit under `writeJsonAtomic`, with one per-path chain
+ and one unique temp name.
+ - 26 sites were folded (19 JSON, 7 text/binary), and both per-module-copy write counters
+ are deleted. A failed write no longer leaves a temp file behind.
+ - No byte moved (`phase3-writers-numbers.ts`: 315 samples equal the old idiom's bytes, diff
+ empty).
+- **Slice 3b: the video page's chore cards, one module each.**
+ - `VideoPanel.tsx` went from 1,839 to 455 lines, the assembly only. It now draws 15 modules
+ under `videos/[id]/components/cards/`, pinned by `lib/videoChoreCards.ts` and its test.
+ - The stage half needed nothing: the flow work had already made `computeStageStatuses` /
+ `computeChannelFlow` the one fold.
+ - Labels are identical (126 entries, same md5).
+
+**Gates.**
+- On `e172749b`, re-run for the record: editor unit 72/72.
+- On 3b's merged tip `2e322e37`, whose tree equals `e172749b`'s: tsc clean, common 1738,
+ scripts 156 + 1 skip, both builds green, the 19 video-page specs 108/108.
+- On W's merged tip `44dd843f`: mcp 219, the 20 writer specs 140/140.
+
+Full e2e on `e172749b`: editor **624 passed + 1 load flake (`lane-runner.spec.ts:361`, rerun 3× green)**; export **188/188** (worktree
+`one-core-phase-3-s3b` detached at `e172749b`, ports 3311/3310, logs
+`final-e2e-r4-editor.log` / `final-e2e-r4-export.log`)
+
+**Next.**
+1. **The exports-off release**, [`site-exports-off.md`](sites-and-publishing.md): a per-site
+ option, off on the operator's five published sites, which need a rebuild and a deploy.
+2. **The Rumble slice**, [`rumble-sweep-pacing.md`](acquisition-and-pipeline.md): step 0 is
+ `--impersonate chrome` through a per-platform args table (the embed endpoint 403s every
+ download, upstream #17496); step 2 is pacing the full sweep. The operator applied step 1
+ on 2026-09-24.
+3. **One-core Phase 4** (CLI, entry points, config, docs). `buildDeployCore.ts` imports
+ nothing from `editor/**`. `PUBLISH.md` does not exist yet.
+
+The release-4 rollout and the owed one-sync sweep ride in the prelude of whichever release
+comes next.
+
+**Still owed (operator):**
+- the Anilyzer **production** deploy (the preview is up, see below);
+- the other five sites to corpus spec 4;
+- the LM chat-only tier (shipped, not configured);
+- the **188 orphan temp files** in `transcripts/`, listed by `find transcripts -name '*.tmp-*'`.
+ 175 of them are `.auto-queue/state.json.tmp-*` from the 2026-09-11 full-disk day. They are
+ safe to delete while nothing runs.
+
+**Owed (code):**
+- `transcribeOne.ts:173` writes the remote transcript with no temp. It is the one real
+ `writeFileAtomic` candidate left.
+- The export page writers `buildIndex.ts:971` / `buildStats.ts:220` need restructuring,
+ which is out of W's scope.
+- The deferred follow-ups in the phase-3 "Next" section.
+
+**Previously:** 2026-09-22 — **the release *curated-tags follow-ups + debts sweep* is on
+`main` @ `766e0873`.** Base `4ac8ceda`; three branches merged in the order
+`1a011d96` alone → `tags/rules-and-ops` (`9837f066`) → `export/tags-followups` (`cb254919`)
+→ `editor/debts` (`766e0873`). Anchors for every seam are in
+[`FACTS.md`](../FACTS.md#the-2026-09-22-release--curated-tags-follow-ups--debts-sweep-main--766e0873).
+
+**Final full-suite run on 766e0873 (docs commits after it change no code): editor 600/600 (30.0 m), export 188/188, e2e:2origin 3/3 — all detached in the release worktrees; live contracts (jeralyzer corpus.json / llms.txt, anilyzer tags.json 96/282/56) unchanged**
+
+### Curated per-video tags — shipped, reviewed, deployed to Anilyzer
+
+The plan is [`curated-tags.md`](../curated-tags.md); it is now a shipped design, not work in
+flight. `transcripts/tags.json` is the authoritative vocabulary AND every assignment, written
+through the ONE path `applyTagAssignments` (`common/lib/curatedTagsStore.ts`) by all three
+writers (editor UI, `pnpm ops`, umtool); the MCP gained a read-only `list_tags` and a `tags`
+filter and no write tool. The record field is **`curatedTags`**, never `tags`. S1.1 froze the
+model (`d8c9d252`), then S1 ‖ S2 ‖ S3; review fixes `86cbb616`, `468f3a31`; the two
+re-apply bugs `edf0e204` (it held the event loop for minutes) and `8db8a3be` (the
+assignment-only pass destructured a bare key).
+
+**Rollout, 2026-09-21 → 09-22.** Seeded through `pnpm ops tags --file` (never by hand — the
+file carries provenance). First derivation: examined 77,224, re-derived 831 in 623 s; 103
+transcript pages rewritten, 906 unchanged. **All three seed patterns were then wrong against
+the real corpus and were corrected** — the full before/after is in `curated-tags.md`'s rollout
+log, and the shape of the error is worth carrying: a bare `elfpire` matched a friends-list
+boilerplate on MommaOcco (200 false hits), `@PapaElfpire` in chat, and "Jason Angelfire" /
+"channelfireball" / "RekietaLawLive" in ASR. **ASR never spells "Elfpire"**, so the caption
+rule is a misspelling alternation with `\b` on both ends.
+
+**Anilyzer is live with Eva tags** (`4ac8ceda`), reviewed, with 21 suppressions. Two bugs the
+live data found were fixed there. Every other site stays at corpus spec 3 until the operator
+chooses to rebuild it — a pre-spec-4 site serves no `/tags.json`, which the MCP reports as
+empty-with-a-warning rather than as a silent miss.
+
+**And a rule can exclude channels** (`1a011d96`): `channelsExclude` is applied AFTER
+`channels` and **the exclusion wins**. It is part of `hashCuratedRules`, which is the trap —
+see the post-release block below (all done but the deploy).
+
+### `storage/debts-1` — merged 2026-09-21 (`7589c50c` → `e109b6ac`, fast-forward)
+
+The three things S5/S6 named and left out; two of them are now done and the plan file says so.
+`assertRelocationRootPresent` (`1fccabac`) — a move can no longer `mkdir` its destination
+under an absent mount, checked from the preview AND immediately before each copy phase, on the
+channel mover and the saved-video mover both. A `/review` section for auto-paused channels
+(`bbc1899e`) — `common/views/review.ts` `autoPausedRows`, and a channel a PERSON paused is not
+a row. **Only the per-unit reachability re-check in the two lane runners is still open**, still
+deliberately deferred to the five-minute storage watch.
+Around them: `clips/` counted in `totalMediaBytes` (`7589c50c`) so the platter's bytes stop
+lying, clip-window eviction BY AGE (`4416bb58`, `e4f9fa1f`), the relocate space check freed
+from how much RAM is free (`1271e21f`), a fan-out that says which jobs it started
+(`94b24fdf`), the full-source path (`fab61a49`), and the umtool suite SKIPPING rather than
+going red without the song data (`1ab07623` → `007c12e5`).
+Anchors: [`FACTS.md`](../FACTS.md#storage-debts-verified-2026-09-21-branch-storagedebts-1).
+
+### `feat/filtered-channel-followups` — merged 2026-09-21 (`337477d5`)
+
+Nine commits, `f142f7d9` → `c442cb60`, behind the per-channel download filter. A rejection
+takes its own prefetch directory with it; the metadata scan is DISPATCHED by the download
+lane, not waited for, and goes in the pick log like any other unit; a filtered-out livestream
+gets a third answer rather than settling forever; `videoHasAnyArtifact` turned out to be
+`isVideoDownloaded` under a second name. Review (`5c02e7da`) found the discard was a
+deny-list and four things it let through.
+Anchors: [`FACTS.md`](../FACTS.md#filtered-channel-follow-ups-verified-2026-09-21-branch-featfiltered-channel-followups).
+
+### The release itself — what each branch landed
+
+**A · `tags/rules-and-ops` → `9837f066`.** `1a011d96` (merged alone, first) `channelsExclude`.
+`dcd065e7` a site layer carries NO rules — dropped on read AND on write, so a hand-written
+site rule is removed from the file on the next save. `d653b504` `--wait` survives a failed
+poll: the log route is POLLED (`{content, nextOffset, status, …}`), a poll failure is not a
+job failure, there is an `/api/jobs/active` fallback, probe failures are bounded, a
+`--wait-timeout`, and `followJob` is importable with injected `fetch`/`sleep`. `52f5c64c`
+both build routes take `siteId` OR `siteIds` via `reqSiteIds`, and `build-deploy` fans out
+returning `{ok, jobs, skipped, jobId?}`. `6214eeb9` `wt rm` finds the directory `wt add` made
+(`worktreeDirFor`, one function for both verbs). `729f64ef` a measure-nav comment. `bad9ea43`
+the four-lane status poll reads the corpus ONCE. `d0df901b` the `typeof process` guard in
+`contract.ts`. `94750a1b` review fixes — a bad site id is 400 *before* any job, and a
+recovered poll answering `queued`/`running` is not an outcome.
+
+**B · `export/tags-followups` → `cb254919`.** `e942dc7f` tag chip groups fold (`<details>`
+per group, local state, `"n selected"` on the summary). `ce5379f2` `SearchResults`' leaf
+sections read `SCOPE_LABELS` — one scope-label table, no second copy anywhere.
+`f40c4257` + `7a38b60b` hub `/ask` prerenders, and the fix is that `AskHub` needs the WHOLE
+provider stack (`PlayerProvider` → `MultiSiteDataProvider` → `SearchSessionProvider`), never
+an opt-out; `2e13c0ab` its spec, `export/e2e-hub/ask.spec.ts`. `befd2fbf` MCP: a tag filter
+takes posts OUT of the search, reported in `postsScanned.skippedForTagFilter` and in a footer
+sentence, because posts carry no curated tags and the export UI does the same.
+
+**C · `editor/debts` → `766e0873`.** `94c965d7` + `674c976b` the channel Storage panel evicts
+that channel's clip windows (`ClipWindowsCard` with a `slug`, disabled by the panel's
+`blockedReason`, by-age caveat on screen). `d23883f7` rename and delete refuse with
+`channelMediaBusyReason`. `1b3d4837` Sync all skips a channel whose media drive is not
+mounted. `1cace934` worker auth's 503-when-unset asserted. `1e0b10a9` `.gitignore`
+`/editor/content`. **S0-pause landed** — `98fa001a` the four legacy pause fields and their
+migration deleted (`migrateHeldToLanes` gone), `27b6be0f` `held` defaults per lane via
+`defaultHeldFor` (backfill `true`, the others `false`), `ad20ffd8` the editor readers gone,
+`7d2e889a` `settingsWrite.test.ts`. Review fixes `4d2fa0ca` + `70c2443a` (**every**
+`/api/test/*` route 404s unless `EDITOR_TEST_ROUTES=1`), `8ad4ea77` (the `held` default
+asserted through `sanitizeAutoQueue`), `67f17b30`, `307c9b81`.
+
+### Gates measured for this release
+
+`tsc --noEmit` clean in `common`, `editor`, `export`, `mcp`. Unit: common **1604** (was
+1592), mcp **219** (was 216), `pnpm run test:scripts` **151 passed + 1 deliberate LIVE skip**
+(was 138). Per-branch e2e: A `tags.spec.ts ops-api.spec.ts` **24/24**; B export **188/188**,
+hub **6/6**, `e2e:2origin` **3/3**; C 20 specs **184/184**.
+
+**`e2e:2origin` is GREEN for the first time since hub `/ask` existed.** The FACTS entry
+calling it known-red on the base is closed — a red run there is a regression now, not a
+known failure to skip past.
+
+### Housekeeping
+
+Worktrees `storage-locations-s0..s4` and `s0-pause` removed. Branches deleted:
+`storage/locations-s0..s4`, `storage/debts-1`, `feat/filtered-channel-followups`,
+`one-core/phase-1`, the seven `umtool/*`, `one-core/s0-pause`. **Kept:**
+`parked/download-filter-preview`, `p1-e2e`, `worktree-duplicates-page`, `diet-series`. The
+three release worktrees and branches (`tags/rules-and-ops`, `export/tags-followups`,
+`editor/debts`) are gone — checked 2026-09-23, neither `git worktree list` nor `git branch`
+shows them. Nothing unmerged was deleted.
+
+### Post-release operator steps — done 2026-09-22 evening except the deploy
+
+Run in the order the live editor forced (its pre-release sanitizer would have dropped
+`channelsExclude`, so the restart came first):
+
+1. **Rebuilt and restarted the editor and umtool on `472d5b59`** (`:3001`, `:3050`; both
+ started with `pnpm run start -H 0.0.0.0` as before). Done.
+2. **Re-sent each Eva tag definition** via `pnpm ops tags --file`, built from the live defs in
+ `transcripts/tags.json` (presentation fields intact) with `rules[].channels` empty and
+ `channelsExclude: ["elfpire-eva", "elfpire-eva-x"]`. On disk: `channels` absent, the exclude
+ present, all **48 assignments** untouched. Done.
+3. **`pnpm ops build-index --wait`** (job `01M36471VHTYX9V7DXYZY3R6B3`, 330 s): the log said
+ `curated tags: rules 864eac5c (changed), examined 77224, re-derived 0`. Examined = the full walk
+ the hash change forces; re-derived = records whose tags MOVED, and none did, because the corpus has
+ 71 channels and the old 69-channel allow-list was already "everything but Eva's two". The exclude
+ pays off when the next channel joins. Done.
+4. **`pnpm ops build-site --json '{"siteId":"anilyzer"}' --wait`** (job `01M364J54CA4ENG1SXQV865GM7`):
+ composed into `export/public` and exported to `export/out`; `tags.json` counts **96 / 282 / 56**,
+ byte-identical to live. No new false positive to suppress. Done — **built, not deployed**.
+
+**2026-09-23 — preview deployments shipped (`ef4a9f6d`, branch `deploy/preview`, 9 commits, Sonnet-reviewed):**
+`preview: "<branch>"` on the new `deploy-site` route (deploy-only of `export/out`, which now refuses a
+bundle built for another site), on `build-deploy`, on `pnpm ops`, and as a "Deploy preview" control on
+the site's Publish tab. Cloudflare Pages makes any non-production branch a Preview environment at
+`https://<branch>.<project>.pages.dev`. Anilyzer's release build is up at
+**https://tags-exclude.anilyzer.pages.dev** (deployment `2fafe052`, Environment = Preview); production
+is untouched (last production deploy still `4ac8ced`). Its data is byte-identical to production
+(96/282/56) — what differs is the export UI of this release (folding tag-chip groups, leaf-section
+labels). Editor restarted on `ef4a9f6d`; umtool unchanged. See `DEPLOY_CLOUDFLARE.md` "Preview deployments".
+
+**Still owed: the production deploy** — `pnpm ops build-deploy --json '{"siteId":"anilyzer"}' --wait`, then
+`curl https://anilyzer.pages.dev/tags.json | jq '.tags[].count'` and
+`list_tags {source:"remote:https://anilyzer.pages.dev"}`. The operator chose to hold it. Other sites
+stay at corpus spec 3 until the operator chooses.
+
+**Out of scope, decided:** hub tag federation. A tag filter works per site; the hub does not
+aggregate `/tags.json` across members.
+
+**Previously:** 2026-09-20 — **storage locations S5 + S6 shipped** on branch
+`storage/locations-s5-s6` (worktree `/home/user/Projects/storage-locations-s5-s6`, off `main`
+@ `60183f0`; **merged since — the "unmerged" below is stale, and the three things it names
+as left out are down to one, see the 2026-09-22 block above**). The operator's two asks that evening — *"disk space and current storage
+volume as columns on the channels menu, and let me filter by volume"* and *"progress on
+relocate jobs since rsync gives progress"* — plus the four things around them: per-channel
+media bytes in the snapshot (`totalMediaBytes`), the corpus volume as a first-class `/storage`
+row (`internal`, synthetic), the saved-video store made movable (`relocateDir.ts` is the
+channel mover's factored core; `relocateSavedVideos` is new), and a five-minute drive watch
+that auto-pauses a channel whose drive went away and restores its tier when it comes back
+(`ChannelPriorityEntry.autoPaused`). Slice record and what was deliberately left out:
+[`storage-locations.md`](../storage-locations.md#s6--the-storage-surfaces-the-operator-asked-for-shipped-2026-09-20).
+Seams: [`FACTS.md`](../FACTS.md#storage-locations-s5s6-verified-2026-09-20-branch-storagelocations-s5-s6).
+**Left out, named:** `assertRelocationRootPresent` (a move can still `mkdir` under an absent
+mount), a `/review` section for auto-paused channels, and the per-unit reachability re-check in
+the two lane runners.
+
+**Previously:** 2026-09-15 (Phase 3 slice 1 and the rack landed; see the Next block) — 2026-09-13: **gate A passed and `main` moved; the interlude shipments and one-core Phase 2 are all merged
+on one branch**, `integrate/2026-09-storage-priority`, tip **`bd3d4ec`**, unmerged. Off
+`e74f005`: `relocate-channel-media` (from `storage/relocate-media`), then `channel-priority`
+(from `channel-priority/s5`), then Phase 2's five slices in the order their reviews cleared —
+`7f86aef` S1, `b7a351c` S2b, `858aabc` S2c, `9026007` S3, `bd3d4ec` S2a. The branch waits on
+**operator gate A**, then a fast-forward to `main`. The two resolutions that are not a union
+of both sides — `listChannelMeta`'s return shape and the pair of bulk bars at the foot of
+`ChannelsTable` — are pinned in
+[`FACTS.md`](../FACTS.md#the-storage--priority-integration-verified-2026-09-12--where-the-two-branches-collide);
+Phase 2's seams are in
+[`FACTS.md`](../FACTS.md#one-core-phase-2-verified-2026-09-12-branch-integrate2026-09-storage-priority)
+and the slice-level record is
+[`one-core-phase-2.md`](../one-core-phase-2.md#phase-2--shipped-2026-09-12).
+
+**The release-candidate gates on `bd3d4ec`, measured 2026-09-12 from the integration worktree
+(`/home/user/Projects/integrate-2026-09`, worktree #8 — editor 3801, test 3811, export 3810,
+export-e2e 3820), e2e behind the machine-global queue lock, one worker:** `tsc --noEmit`
+clean in all 7 workspace packages; `common` **1159/1159**; `mcp` **205/205**;
+`pnpm test:scripts` **78 passed / 1 skipped**; editor and export `next build` clean; the
+compose-site fixture byte-identical except `generatedAt` and the four `_headers` lines S2c's
+CORS change added, with the composed hub's `_headers` byte-identical to the pre-S2c literal;
+export e2e **172/172**, hub **5/5**, the editor suite **533/533** in 23.1 min with neither
+known flake firing, and umtool **129 passed / 40 failed / 2 skipped** — the same 40
+environmental failures S2b measured, spec for spec; and
+`curl https://jeralyzer.pages.dev/corpus.json` byte-identical to
+`plans/tools/jeralyzer-corpus-2026-09-12.json` (12,380 bytes) — which says the snapshot is
+still current, not that a rebuild would match, because jeralyzer has not been rebuilt.
+`e2e:2origin` was not run: it shells `build:hub`, whose `/ask` prerender is red on the base
+and predates Phase 2.
+
+**The operator runbook below is unchanged and still the sequence to follow** — the
+channel-priority migration first, with the editor stopped, then the platter mount, then the
+saved-video store, then the channels. Nothing in Phase 2 touches it.
+
+**Previously:** 2026-09-08 — **one-core Phase 1 shipped** on branch `one-core/phase-1`
+(`7f294df` → `81a663f` plus a docs commit, 36 commits, not merged): **dispatch is one scheduler, and the lane is the
+noun.** The slice-level record — every sha range, every divergence, both operator gates — is
+[`one-core-phase-1.md`](acquisition-and-pipeline.md); the umbrella is
+[`one-core.md`](../one-core.md) and the anchors are
+[`FACTS.md`](../FACTS.md#one-core-phase-1-verified-2026-09-08). **No live number moved**: the
+before/after diff of `plans/tools/phase1-numbers.ts` over the real 78,000-video corpus is
+EMPTY for 1.1, 1.2, 1.4 and 1.5, and for 1.3 is 18 added lines / 0 removed — the two sweeps'
+scopes migrating into lane trees, both `enabled: false`.
+
+- **1.1 — four lanes in the model.** `AutoQueueKind` is `transcription | download | digest |
+ backfill`, exported as `LANES`, and `PauseLane` is an alias of it. `retainLeaves` was
+ DELETED rather than de-moded: `pending[leaf]` is what the leaf drew, so a post-hoc filter
+ over it can only re-apply a rule the draw already applied. The rule moved into the draw.
+- **1.2 — the runner runs operations.** `digestBatch.ts` (647) + `backfillBatch.ts` (937) →
+ one `controller/operationBatch.ts`. The status poll costs ~150 ms more for the two new
+ lanes and a `(mtime, size)` parse memo gives ~140 ms of it back. Three runner-only bugs
+ review found (a spend cap a 60 s TTL could reset, a context swapped under an in-flight
+ unit, a dead engine re-probed every tick) and one the e2e spec found: **every runner held
+ its own copy of `.auto-queue/state.json`, which is serialized whole**, so each persist
+ clobbered the other lanes' pick log. They share one object now.
+- **1.3 — the sweeps and the arbiter retire.** Arming is tree authoring; ten settings fields
+ migrate on read (`common/lib/laneMigration.ts`, a pure function tested through the
+ sanitizer) and are then deleted with their sanitizers and forms. `reach` and
+ `digest.recencyOrder` are RETIRED, not migrated, and the note says why. The one rendered
+ change in the whole phase is here and was kept on purpose: the /jobs strip's four lane rows
+ fold `gateHeld` now, so a held transcription row reads *Holding* where it read *Idle*.
+- **1.4 — pause is lane state.** One key, `autoQueue[lane].held`, behind the unchanged
+ `isGateHeld` / `withGateHeld`. The four legacy fields survive as `legacyGateHeld`'s
+ read-time input in `lib/laneMigration.ts` — NOT in `pauseGates.ts`, which would have pulled
+ the operation registry into every reader of settings.json. The transcription
+ intent-vs-pool asymmetry is intact.
+- **1.5 — one work list per lane in the snapshot.** `backfill.download` and
+ `backfill.transcription` are the fold of each lane's default buckets, so
+ `snapshot.backfill[op].ids` is where all four lanes' work lives; the runner reads it and
+ falls back to the same fold, which is the migration (nothing is regenerated).
+ `plans/tools/phase1-worklist-check.ts` checks all 68 live snapshots read-only: **OK**,
+ download 9, transcription 882, zero already carrying an entry. The 882 is the
+ POLICY-FREE work list; the transcription lane still draws **2,754** today, because the
+ live `autoQueue.transcription.replaceAutoSubs` is `true` and `defaultDrawsForPolicy`
+ appends `downloadedAutoSubsOnly` (1,872) at the tail of the draw.
+
+**Two operator gates are outstanding, and one of them gates a merge.**
+
+- **Gate A** — the digest lane's runner drives a production pass and comes back after a
+ restart. Run it from **`one-core/phase-1-gate-a`** (`0438a72`), which is the code as 1.2
+ left it; the step-by-step runbook, including the exact `settings.json` block and the
+ channel to point it at, is in `one-core-phase-1.md`'s "Operator gate A" section. It gates
+ the MERGE of 1.3 onward, not their authorship, which is why the branch exists.
+- ~~**Gate B** — before the backfill lane is ever `enabled` in production, decide
+ `backfill.allowRedownload` and the channel scope. As configured today it would re-fetch
+ audio for ~66,540 videos. The migration left the lane disabled; the tree's channel leaves
+ are the scope from now on.~~ — **DONE 2026-09-23: reachable media only**
+ (`allowRedownload: false`, lane held, still disabled). Record:
+ [`one-core-phase-1.md`](acquisition-and-pipeline.md).
+- ~~**The four legacy pause fields go only once the live `settings.json` carries all four
+ `held` keys**~~ — **DONE 2026-09-22 (S0-pause, in `editor/debts`).** The four fields
+ (`transcriptionsPaused`, `downloadsPaused`, `digest.digestsPaused`, and the inverted
+ `backfill.enabled`) are deleted from `SiteSettings`, from every sanitizer and from
+ `writeSettings`' merge literal, so a file that still spells one loses it on the next write;
+ `legacyGateHeld` and `migrateHeldToLanes` are gone. The warning this bullet carried was
+ heeded: `defaultHeldFor(lane)` is `lane === "backfill"`, so **backfill defaults `true`**,
+ and the invariant is asserted where a reader actually hits it — through `sanitizeAutoQueue`
+ in `common/jobs/autoQueuePolicy.test.ts`, not through a unit test of the default itself.
+ The backfill lane is now off twice over on a fresh install, unarmed AND held, which is gate
+ B kept as two deliberate acts.
+
+**All four e2e flakes are fixed** (`plans/deflake-e2e.md`, `a32612a` → `fae99f1`), and the
+first three's class is worth remembering: **a debounced write survives a test boundary
+until the next reset.** `video-page.spec.ts:216` ("Delete directory wrong-id confirmation")
+asserted a video directory still existed after a refused delete and found it gone — nothing
+deleted it, `reconcileVideoDirs` RENAMED it. Snapshot generation moves `data/<name>` to
+`data/<extractVideoId(webpage_url)>` when the two differ, and the
+`one-youtube-channel-with-data` fixture was the only directory in the tree where they did;
+the previous test armed the debounced regen, and `resetData` copied the fixture back in
+BEFORE it invalidated, so the regen renamed the fresh copy. The fixture's id now matches its
+directory and `resetData` quiesces first (that route's `resetSnapshotScheduler()` clears the
+armed timer; a regen already past the debounce is not awaited and keeps walking, which is
+why the fixture fix is the half that actually closes it), so the two halves of the hazard
+are both closed. The export "no FOUC" theme
+tests read `data-theme` after a `waitUntil: "commit"` reload that does not promise the head
+script has run — the script now marks itself `data-theme-ready` and they wait for it. And
+ask-chat's "Stop aborts mid-sweep" raced a 500 ms route timer; the test holds batch 2 open on
+a latch it releases itself. No retries, `test.slow`, or serial markers were added anywhere.
+
+**The fourth is fixed too, and it was never the batch** (`fae99f1`,
+[`attribution-batch-hang.md`](acquisition-and-pipeline.md)). `attribution.spec.ts:346` "Run from
+the video page runs that video and no other" failed 1-2 runs in 10 waiting the full 90 s for
+the batch's "1 done". Instrumented at `fea2996` — `console.error` with ISO timestamps, never
+through the job's own `onLog` — it reproduced 3 times in 25, and every failure reads the same:
+
+```
+[TRACE 2026-09-08T20:25:21.661Z] attributeOne.post-write attrvid0002
+[TRACE 2026-09-08T20:25:21.661Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=4 closed=false :: Attribute attrvid0002 (text-only): 2 speaker(s)…
+[TRACE 2026-09-08T20:25:21.662Z] runPool returned attribution-channel
+[TRACE 2026-09-08T20:25:21.662Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=5 closed=false :: Backfill attribution-channel: 1 done, 0 already current…
+[TRACE 2026-09-08T20:25:21.663Z] fn.finally job=01M21B4PDQZC6YWGZH38WYV37N status=done
+Error: locator.getAttribute: Test timeout of 120000ms exceeded.
+ - waiting for getByLabel('Run Speaker names (from the transcript) output')
+```
+
+The job finished in **65 ms**, wrote all five lines including "1 done", enqueued every one of
+them with `closed=false`, and finalized `done`. **All five hypotheses the plan ranked are dead,
+H1's mechanism included** — no `stream.cancel` fired in 240 instrumented tests, so the early
+SSE teardown H1 described (and the log-file polling it prescribed) was never happening; all
+that held of H1 was its disposition, server innocent and failure client-side. The real cause is
+a sixth mechanism outside the table: the log panel was **gone** — not stale, not short, absent.
+The failure snapshot shows the record body and the Run button and no `<pre role="log">` at all.
+`AttributionBody` returned two fragments of different SHAPES (`[p, RunOne]` with nothing on
+disk, `[dl, ul, p, RunOne]` with a record; `DiarizationBody` the same at `[dl, p, RunOne]`), so
+`reconcileChildrenArray`'s index pass broke at 0 and found `ul`/`p` where the UNKEYED `RunOne`
+had been — a positional type mismatch, which is what unmounts a child and takes
+`StreamActionLog`'s `log` state with it. React preserves state across a KEYED move, so a key
+alone or a fixed position alone would each have sufficed; the fix ships both. The
+refresh that lands the record is the one `StreamActionLog` fires itself when the run ends, so
+the panel is wiped at the instant the summary line reaches it, and the spec could only pass in
+the ~200 ms window before that. **The earlier note here — "the job never reaches a terminal
+state", "the hang is in the BATCH" — was the artifact, and so was "the log FILE has no more
+than the panel": the file had everything, and no reconcile could have helped a component whose
+state had been destroyed** — nor would the plan's own H1 fix have helped, for the same reason.
+Do not trust either claim again. Both bodies are one two-child list now, RunOne last and keyed;
+the spec asserts the log still says "1 done" AFTER the pill reads "current", which is red on
+every run at `fea2996` (5/5) and green at the fix. `attribution.spec.ts --repeat-each 20`:
+**20/20**. The durable rule — **a component carrying a `StreamActionLog` must not be UNMOUNTED
+when the record its run produced lands**, whether by an unkeyed move or by a parent branch
+swap — is in `FACTS.md`.
+
+**Those instances are now closed, and a fourth with them** (`c19098b`, follow-ups in
+`12d1778`; the specs that catch them in `b207e84`). `SourceVideoSection` early-returned the
+persisted view once the pointer landed; `IncompleteTranscriptBanner` and `ShortAudioBanner`
+were dropped by the parent when the run cleared their condition; and `PerFileTranscribeRow`
+swapped its panel for "Transcribe disabled — transcript already present." the moment its own
+run wrote transcript.json. All four are the same shape now: message and run panel in separate
+fixed slots, a `ranHere` flag set when a run starts there keeping the panel mounted across the
+refresh, and `StreamActionLog`'s existing `disabled` prop fed the now-cleared condition so a
+kept panel is not a second Run button. The banners' `role="alert"` and warning aria-label are
+conditional on the flag, so the box that outlives the warning does not keep announcing it.
+`PerFileTranscodeRow` was checked and is **not** an instance: its condition is the file's
+extension against a static format list, which a transcode cannot change. Each fix has an e2e
+case that reads the log's closing line only AFTER the state the run produced is on screen; all
+four are red without the fix and green with it, and `--repeat-each 10` over the four specs is
+340/340.
+
+**The last full suite: 518 passed, 0 failed of 518, 31.8 min** from a worktree of `12d1778`
+(one worker behind the queue lock). Previously **515/515 in 24.6 min at `65abc11`**, the
+de-flake tip; the three added cases are the difference. The four flakes are closed and the
+suite is clean end to end. Previously, at `2133d94`, it was 514/1 — slice 1.5's own new band
+assertion, and it was right: writing the two new snapshot entries doubled `/channels`' Download
+and Transcribe coverage, because that page passes the external ids into `buildOperationBands`
+and `addRegistryEntry` folded them on top of `addExternalBands`. Fixed in `d8754d2`.
+
+**2026-09-11 — [`relocate-channel-media.md`](../relocate-channel-media.md) SHIPPED**, all three
+slices, on branch `storage/relocate-media` (`4059dad` → `affe525`, 24 commits off `61eae05`,
+**unmerged**; the suite is **523/523 in 22.3 min** at `affe525`, and
+`common` is 971/971). A channel's `data/` can be an absolute symlink to
+another drive with `config.dataDir` recording the target, moved by a Storage panel on the
+channel page or in bulk from `/channels`; four guards plus a `needsMedia` flag on the job kind
+stand between an unmounted drive and a re-download, and the low-disk gate now measures the
+volume the bytes are going to and latches per volume. **Nothing on disk moved** — the mechanism
+shipped, the bytes did not. The slice table, the two review rounds and eight divergences are in
+that plan's "As shipped (2026-09-11)"; the anchors are in
+[`FACTS.md`](../FACTS.md#one-core-phase-1-verified-2026-09-08).
+
+**2026-09-11 — channel priority shipped** on branch `channel-priority/s5`
+(`28bfee3` → the tip below, four merge commits plus eight of its own, **not merged**):
+**one tier per channel, one focus, four COMPILED lane trees.** S0 (`28bfee3`) is the model;
+S1 (`2710195`) dispatch; S2 (`76c5784`) sync; S3 (`88da736`) the `/channels` UI and the one
+writer; S4 (`9fcc8b4`) the banner and the read-only tree; S5 merged all four in order (no
+conflicts — the slices touched disjoint files), closed the twelve parked review findings, ran
+the migration's dry run against the live corpus and deleted `excludeFromSync`. Anchors:
+[`FACTS.md`](../FACTS.md#channel-priority-verified-2026-09-11); the record with every divergence
+is [`channel-priority.md`](../channel-priority.md)'s "as shipped".
+
+- **The model compiles, it is not consulted.** `settings.channelPriority` → `prio-focus` >
+ `prio-normal` > `prio-low` > `prio-all`, all strict, per lane. No dispatch code changed: a
+ focus holds the rest because strict descent already does, re-asked on every grant. An absent
+ document is today's behaviour byte for byte.
+- **The data-loss find.** `backfillReacquire.decideKeep` asked `policyDrawsBucket` on the
+ transcription root — on a COMPILED root a channel paused for transcription has no leaf, so
+ it would have answered "no-leaf" and unlinked the re-acquired audio of exactly the channels
+ an operator had just put on hold. The pause is asked first and KEEPS. A hold is never a stop.
+- **The order that nearly went.** The bypass is all-or-nothing, so the first tier click on
+ `/channels` stops the stored trees being dispatched from — and the two hand-made 9+9 lane
+ orders live only there. The one writer now seeds from `channelPriorityFromLegacy` when the
+ stored document says nothing and the stored roots are not already compiled. And a corpus
+ whose roots ARE compiled recompiles even for a default document, or ending a focus would
+ leave `prio-focus` at the head of a tree the runner is bypassing to.
+- **One writer of `root` too.** `saveAutoQueueAction` and `armLaneAction`-with-a-scope refuse
+ server-side while a model exists; `prioritizeChannelDownloadAction` is a priority edit;
+ create/delete recompile.
+- **`excludeFromSync` is deleted** — field, sanitizer clause, action, toggle, and all five
+ legacy reads. `excludeFromBuild`/`excludeFromCleanup` untouched.
+
+**The full editor suite at `a8e908a`: 528 passed, 0 failed of 528, 22.9 min** from this
+worktree behind the queue lock (518 + the 10 new priority cases). Three specs went red on
+the way and all three were right: `channel-priority.spec.ts:172` caught End focus leaving a
+stale `prio-focus` at the head of the stored tree, and `new-channel-onboarding.spec.ts:111`
+was still reading "Add to top of auto-queue" as a hand-written leaf.
+
+**Two flakes cost a suite run and are named so the next session does not re-chase them.** An
+earlier run at `a8e908a` was 526/528: `no-subs-fallback.spec.ts:114` failed on an `EEXIST`
+inside `resetData`'s `cp` (a filesystem race in the harness, 3/3 green on re-run), and
+`backfill.spec.ts:457` failed on `uncheck()` not changing a controlled checkbox — the
+`PolicyTreeEditor` adopt-effect race, where the 3 s status poll calls `setForm` between the
+click and its assertion. Measured after: 1 failure in 6 runs of that case at `a8e908a`, 0 in
+9 at `4d256a2`, and the clean 528/528 above. Its payload path for a DEFAULT priority
+document is unchanged by this branch, so it reads as the known adopt race rather than a
+regression — but the sample is small, and it is the case to look at first if it recurs.
+
+**⚠ THE MIGRATION MUST RUN BEFORE THE FIRST BOOT OF THIS CODE, not after it.**
+`excludeFromSync` is deleted and `parseChannelConfig` drops the key, so on a corpus that has
+not been migrated the 15 channels that carried it read as *saying nothing about sync* — and
+four places act on that the moment the editor starts: `syncScheduler.ts:132` (selection),
+`:259` (`autoSyncEligible`, so the projection changes on sight),
+`channels/actions.ts:524` (*Sync all*) and `channelGroupSections.ts:140` (a group's Sync).
+The automatic tick is the one thing that does NOT fire on the live box — its
+`heartbeatSeconds` is 0 — but *Sync all* or a group Sync in that window sweeps every channel
+the operator had excluded. Nothing else moves: no lane's membership, no download, no
+transcription. **Order: stop the editor → run the migration → start it.** The script takes
+its own timestamped `settings.json.pre-priority-<ISO>` backup beside the file before its
+first write (refusing to overwrite an existing one), so the backup is not a step anyone can
+skip.
+
+**IT HAS NOT BEEN RUN — that is the operator's step at rollout.**
+`common/bin/migrate-channel-priority.ts --dry-run` against a READ-ONLY copy of the live
+`settings.json` (no config.json or settings.json mtime moved) says: **68 channels, 28
+entries, 14 ranked, 15 pinned `sync=paused`, no focus, every base tier `normal`**, and all
+four compiled roots `prio-normal(68) > prio-all`. The ranked order is
+`quartering-live, the-quartering-rumble, the-quartering, HasanAbiVODs3, nuxanor, hasanabi,
+darlingstrawb, rekietalaw-rumble, chibi-reviews, nux-taku, destiny, omnivods-odysee,
+leaflit-rumble, piratesoftware` — dense 0–13, merged index then the transcription lane's
+order then slug. No lane's membership moves; only `sync` loses anyone.
+
+**The rollout is the operator's, and the two shipments share one sequence. The migration
+goes first, because it is the only step that must happen before this code ever boots.**
+
+1. **Run the channel-priority migration, with the editor stopped.** `excludeFromSync` is a
+ deleted field, so an unmigrated corpus reads its 15 channels as saying nothing about sync
+ the moment the editor starts. Order: **stop the editor →
+ `pnpm -C common exec tsx bin/migrate-channel-priority.ts` → start it again.** Run
+ `--dry-run` first; the real run takes its own timestamped
+ `settings.json.pre-priority-<ISO>` backup beside the file, and is a no-op on a second run.
+ Never run it against a live editor: a running one holds settings in memory and writes them
+ back on its own schedule.
+2. **Mount the platter.** `sdb1` (1.8 T, ext4) at `/mnt/platter` with `nofail` in fstab;
+ create `/mnt/platter/archilyzer-media` and `/mnt/platter/archilyzer-saved-videos`, owned by
+ `user`. Nothing below works before this, and no code needed it.
+3. **The saved-video store, by hand** — the relocate plan's runbook: rsync
+ `transcripts/saved-videos/` out, verify with `--dry-run --itemize-changes`, move the
+ original aside, symlink the store root, restart, then delete the original. **That is the
+ step that frees the 130 GB**, it needs no code at all (every pointer carries an absolute
+ `dir` and nothing walks the store root), and it goes before the channel moves because a
+ 100 %-full `/home` is a hazard to every unrelated writer while they run.
+4. **Channels through the UI, largest deprioritized first.** Storage panel per channel, or tick
+ rows on `/channels` and use the bulk bar; `omnimirror` (130.3 GB) is the obvious first move.
+ Sizes are in the relocate plan's table — they are sizes, not priorities.
+
+**The gates, all run on the merged tip from the integration worktree
+(`/home/user/Projects/integrate-2026-09`, worktree #8 — editor 3801, test 3811, export 3810):**
+`tsc --noEmit` clean in all six packages; `common` **1051/1051**; `mcp` **205/205**;
+`pnpm test:scripts` **71 passed / 1 skipped**; `next build` clean; the editor suite
+**533 passed, 0 failed of 533, 24.2 min** behind the queue lock, one worker. No fix commit was
+needed — the six conflicts were the whole of the work.
+
+**Both suite totals are the sum of the branches', which is how we know nothing was dropped in
+the conflicts.** `common` is 908 at `e74f005` + 63 relocate (971 at `bc62248`) + 80 priority
+(988 at `996f182`) = **1051**. The editor suite is 518 at `12d1778` + 5 relocate (523) + 10
+priority (528) = **533**. Neither known flake reappeared: `backfill.spec.ts:457` (the
+`PolicyTreeEditor` adopt race) was green on its first run, and so was every video-page case.
+
+**The merge review (2026-09-12, on `c7f7b90`) found nothing above low.** Every conflicted
+file reproduces both parents' deltas line for line, and the six auto-merged files are exact
+unions; the sanitizer carries both branches' new keys on read and write. Three notes, none a
+blocker: (1) with rows ticked on `/channels`, BOTH bulk bars render — storage first, then
+priority — each announcing its own count and Clear, sharing one selection; no e2e on either
+branch could see the pair. (2) The relocate plan's "Step 0 / Step 1" labels are stale
+against the order above — the store rsync targets the platter, so the mount comes first; the
+runbook above is the one to follow. (3) `syncAllChannelsAction` skips paused channels but
+not unreachable ones (`channels/actions.ts:536-543`); an unmounted channel is refused inside
+`syncAction` by the `needsMedia` guard and surfaces as a failed sync, not a skip reason.
+Pre-existing on the relocate branch.
+
+**Gate A PASSED 2026-09-13** on the production editor (record in
+[`one-core-phase-1.md`](acquisition-and-pipeline.md)), and **`main` is
+fast-forwarded to `241d357`** — the integration, Phase 2 and the gate record. Every merged
+branch and worktree is deleted; what remains is `one-core/phase-1` (the primary checkout,
+until it switches to `main`), `one-core/s0-pause` (parked for the next release),
+`diet-series`, `p1-e2e` and `worktree-duplicates-page`.
+
+**The `/channels` rack shipped 2026-09-14** and `main` is fast-forwarded to **`1bc8765`**
+(`64b5573` → `1bc8765`, forked from `a1058d0`; tsc clean, common 1159, editor e2e **533/533**
+on the identical tree — the fast-forward got a `tsc --noEmit` smoke, not a second 25-minute
+suite). One deck, a sticky rack and a meter bridge; the record is
+[`editor-channels-rack.md`](editor-ia.md). The worktree and branch are deleted.
+It merged BEFORE the rollout's channel moves on purpose: those go through the `/channels`
+bulk deck, which the rack rewrote, so the operator does them on the merged page. **One-core Phase 3 slice 1 SHIPPED 2026-09-15** — `main` `1faa987` → **`838da4a`**, fifteen
+code commits in four fast-forwarded sub-slices (A serial, B ∥ C, D serial), record in
+[`one-core-phase-3.md`](../one-core-phase-3.md#slice-1--shipped-2026-09-15). Every payload the
+editor draws is a pure function in `common/views/` handed its singletons, readings and
+clock; the layer guard proves it (allow-list **11 → 10**, two new tests, a textual ban on
+getters, readers and `Date.now`); common **1264/1264**, the full editor suite **533/533**.
+Nothing rendered, routed or serialized moved; the one live change is `/operations` reading
+`.auto-queue/state.json` once per poll instead of four times. **Next, in parallel:** the
+rollout below (operator-physical), then S0-pause one boot later, then **Phase 3 slice 2**
+(unplanned; `one-core.md` §Phase 3 — the plan file's "What slice 2 inherits" is the start). Phase 3 slice 3 rewrites `ChannelsTable.tsx` again;
+landing the rack first keeps that a rebase-free rewrite of one file.
+
+**The rollout:** the **O2–O9 rollout**, editor stopped. **The migration script only exists on
+`main`**, so the checkout switches first; the rule is "migrate before the first BOOT", not
+before the switch. Done 2026-09-13: `git switch main`, then the migration for real — 67
+channels (one fewer than the 68 planned), 27 entries, 14 ranked, 14 `sync=paused`, no focus,
+all `normal`, backup `settings.json.pre-priority-2026-09-13T14-34-26-361Z`. Still to do:
+`pnpm install --frozen-lockfile`, the platter mount and the saved-video store rsync,
+`pnpm --filter editor exec next build`, start with `-H 0.0.0.0`, the channel moves through
+the UI, then `git branch -d one-core/phase-1`.
+
+**Then S0-pause lands, in the release AFTER this one.** The branch `one-core/s0-pause`
+(`2aeb358`) is ready and reviewed — it deletes `transcriptionsPaused`, `downloadsPaused`,
+`digest.digestsPaused`, `backfill.enabled` and `legacyGateHeld`. It is held back for a
+sequencing reason, not a quality one: a main-era `settings.json` has never carried
+`autoQueue.<lane>.held`, that key first appears when merged code writes settings back, and the
+same release cannot both introduce the writer and delete the read-time migration that covers
+every file written before it. An install taking it straight from an older release loses its
+pauses — transcription, downloads and digests come up running and the backfill lane comes up
+held. Boot this release once, confirm all four `held` keys are in the live `settings.json`,
+then take it.
+
+**Then the rest of one-core Phase 3** — views in the core, editor as shell, four slices
+([`one-core.md`](../one-core.md) §Phase 3); slice 1 shipped (above), **slices 2 and 4a shipped
+2026-09-23** (see the head of this file), slices 3 and 4b are the next release. Read `common/architecture.test.ts`'s allow-list
+first: it is the shortest accurate statement of what is still tangled. Phase 2 left it at
+**eleven entries, byte-identical to the base**, while ADDING `"components"` to
+`FORBIDDEN.lib` — the forbidden list grew and the debt ledger did not.
+
+**Previously:** 2026-09-07 — **one-core Phase 0 shipped** on branch `one-core/phase-0`
+(`df5eb48` → `1691c4f`, six commits, not merged): **guardrails and dead weight**, every item a
+deletion, a move or a guard. `common/architecture.test.ts` is the layering (back-edges 16 → 12,
+the list can only shrink); `scripts/report-to-video` → `umtool/report-to-video`;
+`common/package.json` has an `exports` map; one `pageFileName` and one `CONTRACT`. **Nothing on
+disk in a corpus changed and nothing on the wire changed** — proved with a fixture corpus
+composed through `build-index` + `compose-site` before and after, identical apart from
+`generatedAt`. Detail: "Phase 0, as shipped" in [`one-core.md`](../one-core.md); anchors in
+[`FACTS.md`](../FACTS.md#one-core-phase-0-verified-2026-09-07).
+
+**Previously:** 2026-08-31 — **the transcode operation is removed** (`904f1a9` → `f717a36`): it never fired in production. The census over 68 channels found the `untranscoded` bucket empty in every one, both `failed-transcodings` files 0 bytes, and only four channels even passing the stage's gate — and `resolveAudioFile` falls back to any real audio file anyway, so transcription never needed it. Gone: four controllers, four job kinds, the channel stage and station, the catalog entry and with it `appliesTo`/`operationApplies` (catalog 8 → 7). Kept: `transcodeAudio` and the download path, the per-file *Transcode …* rows, both wrong-format sweeps — whose bucket is `wrongFormatAudio` now. The slice-5 leftovers rode first (`measure-nav.mjs`, `BUILD_KINDS`, `EditorAliasesClient`). Plan: [`editor-transcode-removed.md`](editor-ia.md).
+
+**Previously:** 2026-08-30 — **editor IA slice 5 shipped** (`140212a` → `df9b839`):
+**a site has tabs, and the family has one page.** Charts, Search aliases, Deploy, Build and
+Homepage were five sidebar entries beside *Sites*, three reading the site from a `?site=`
+param the picker had to seed, one about no site at all, one about the family's own hub.
+`/sites/<id>` is now **Settings · Charts · Search aliases · Publish** — a layout, the site
+named in the PATH, and the picker reading that path through a new pure `siteIdFromPathname()`
+so the two can never disagree (it writes it to storage, so Dashboard and Channels follow).
+`/sites` is the family page: the list, *Release notes*, *Build all sites* with the
+Basic/Docker mode, the *Hub*, and the *Pool* — the corpus-wide jobs — under a disclosure.
+The five routes 307, and a `?site=<id>` bookmark rides a `has` rule to that site's tab.
+`build/` and `deploy/` — already one module in two directories — are `sites/lib` +
+`sites/components`. The nav is **eleven**, the IA doc's end state, held by `nav.test.ts`; the
+IA doc's UI slices are complete. **Nothing on disk changes.** See "Slice 5, as shipped" in
+`editor-operations-ia.md`.
+Previously: 2026-08-30 — **editor IA slice 8c shipped** (`2226680` → `21feed3`):
+**`/jobs` is one list, and slice 8 is complete.** The design question #12 asked first — what
+is a ROW — is answered *a row is one job*, whichever of three places knows about it: a registry
+record, a `.log` + sidecar the registry has forgotten, or a scheduler slot whose record was
+evicted (a phantom). One `JobRowView`, one builder, one adapter per source, merged VIEWS by id
+with the live row winning. The page is one `<table>` with no mode: the live head (running,
+queued in queue order, anything that finished in the last half-minute) polled at 1 s while any
+row is non-terminal, the paged history below it on the global pulse. **The scheduler's drift
+check rides the live payload**, so every surface that draws work — `/jobs`, the dashboard, the
+widget, `/api/jobs/active` — frees a running slot whose record is terminal or gone, after
+drawing it once; `/api/pulse` does not build it and must not. `/jobs/active` and `/jobs/queue`
+307; the sidebar's *Active* entry and its running badge are gone. The five pages that
+hand-rolled a six-field copy of a running job now call `liveJobRows`, so their cards show the
+progress bars they used to drop. **Nothing on disk changes.** See "Slice 8c, as shipped" in
+`editor-operations-ia.md`.
+Previously: 2026-08-29 — **editor IA slice 8a+8b shipped** (`ea04b4e` → `fecac0f`):
+**sync is a catalogued operation and the schedule is its page.** `OperationDescriptor` gains
+`scope` ("video" | "channel") and `trigger` ("backlog" | "cadence"), `SYNC_OPERATION` is first
+in `operationCatalog()`, and `/operations/sync` — today's `/scheduler`, which 307s — is the
+per-channel cadence table with the **whole `syncScheduler` block** below it. Two things the IA
+doc's wording could not buy: `runner` is typed `AutoQueueKind` and the heartbeat is not one, so
+the console is chosen off `trigger`; and a band's populations are videos, so the rail row is a
+composed `SyncRailRow` rather than a hollow band. `saveSchedulerSettingsAction` is the block's
+one writer (it had two), `WorkersField` and a new `WorkersConfigForm` move to `/workers` with
+`saveWorkersAction` as *its* one writer, and the worker-tag vocabulary is the first consumer to
+filter on `scope === "video"`. The four lane-note strings are one `sweepLaneNote` beside
+`deriveLaneState` — they were two copies and a paraphrase, and nothing pinned them.
+The two Storage chores that ride the heartbeat (keep-latest check, saved-video backup) are
+labelled as such everywhere they show; **no tick logic, no settings key and nothing on disk
+changed**. The `/jobs` fold — the last third of slice 8 — is its own plan. See "Slice 8a+8b, as
+shipped" in `editor-operations-ia.md`.
+Previously: 2026-08-28 — **editor IA slice 6 shipped** (`6986efc` → `d5ca90a`): the
+video page shows one panel per registry operation. `common/controller/videoOperations.ts` is
+the reader — one `readVideoFiles`, one `resolveTarget` and one `state()` per entry, never
+re-derived — and `digestSectionStates` in `lib/digest.ts` is now the ONE per-section fold the
+digest operation's `state()` and the panel both count through, so the page's duplicate of it
+is gone. `DigestPanel` is the digest's BODY inside a generic `OperationPanel`; diarization and
+both attribution operations get bodies of their own, each with a **Run** that runs that one
+video on the speaker lane (`ids` now threads through `runBackfillChannelJob` →
+`countBackfillWork` → the batch, and rides in `spec.params` so a replay stays scoped). A
+record whose feature is switched off is still shown, marked *switched off*. `hasDigest` was
+the channel COUNT's helper, not the page's — it is now private to `channels.ts`;
+`hasAttribution` was dead and is deleted; `hasDiarization` is the live cleanup guard and
+stays. Every digest aria-label is byte-identical; the heading is "Digest" rather than "AI
+digest"; nothing on disk changed. See "Slice 6, as shipped" in `editor-operations-ia.md`.
+Previously: 2026-08-28 — **editor IA slice 7 shipped** (`c924f73` → `685cba3`): one
+pause. `common/lib/pauseGates.ts` is the only place the four gates' polarity is known
+(`backfill.enabled` is inverted), `pauseLaneAction` / `resumeLaneAction` replace eight
+actions in two files, and `components/lanes/pauseControl.tsx` is the one control every lane
+surface draws — the dashboard, the widget, `/workers`, `/jobs/active`, both sweep panels and,
+new, the runner pages, where it sits beside Start/Drain/Stop. The gate is keyed by LANE, not
+by operation: three speaker operations share one backfill queue and therefore one pause. A
+held runner lane can read *Holding* on the operations rail for the first time, and
+`/operations/transcription` says "transcriptions are paused" rather than "no enabled worker
+to run it" (`pauseAll` disables every worker, so the runner could not tell the two apart).
+Every aria-label is byte-identical; nothing on disk changed; the widget wire fields
+`digest.paused` and `backfill.enabled` are both `held` now. See "Slice 7, as shipped" in
+`editor-operations-ia.md`.
+Previously: 2026-08-28 — **editor IA slice 4 shipped** (`a623958` → `43c4e26`, docs
+`808e3fc`, e2e follow-up `97ee12a`): `/actionable` is gone and redirects to `/operations`. Its per-operation
+sections are the channel-work tables on `/operations/download|transcription|digest`, report
+freshness and the two refresh controls are on `/channels`, the two cleanup tables are on
+`/cleanup`, and duplicate clusters plus media-integrity findings are a new `/review` under
+Corpus. The nav is twelve. The dashboard's "No digest" is "Digest to do" — a rename, not a
+re-sourcing: `actionableNoDigestCount` already returned the digest band's `reachable`, so no
+number on any screen moved. The widget wire field is `digestReachable`. Nothing on disk
+changed. See "Slice 4, as shipped" in `editor-operations-ia.md`.
+Previously: 2026-08-28 — **the re-acquire hand-off shipped** (`e450c2c`, `f661677`,
+`bec4775`): re-acquired audio on a subtitle channel is no longer
+deleted under a transcription that the auto-queue policy would have started on it. It is
+handed over when `autoQueue.transcription` would draw the video from
+`downloadedAutoSubsOnly`, kept while a transcription task is running on it, and removed
+otherwise; audio that vanishes mid-transcription is now a skip rather than a permanent
+`failed-transcriptions` entry; and speaker attribution records which transcript the names
+were made from, so an ASR→whisper replacement goes stale (for records written from now on).
+Runbook item 2 **step 4 is resolved** — see below. Previously: 2026-08-27 — **the `deferred` cause is found and fixed** (`fed4b01`,
+`ca42f7b`): a backfill re-acquire on a `handling: "youtube"` channel was running the channel's
+own subtitle download, so it re-fetched captions, landed no audio, and left ~16,000 videos'
+`transcript.cues.json` stale by mtime. It now forces a per-video transcribe override and
+re-normalizes after every fetch. The census is in FACTS.md; the operator's four remaining
+steps are item 2 of "Recommended next". Previously: 2026-08-26 (late) — **unified-ops step 1 landed**: `buckets.noDigest` is
+deleted and `snapshot.backfill.digest` is the one digest work list. No rendered number moved
+(the fallback's migration was already complete on disk, 68/68), and **IA slice 4 is now
+unblocked**. One finding for the operator: corpus-wide `deferred` is **16,156**, against 1 on
+08-10 — see the dated section below. Earlier the same day: **editor IA slice 3 landed**: an operation's settings live on its operation page, and the four `*FormPresent` markers are gone. See the dated section below. Earlier the same day: **the vocabulary pass landed**: the registry is
+`operations.ts` and says `Operation`, the three id spaces slice 2 handed it say "speakers",
+"unit" has one meaning, and `transcode` is a registry entry. See the dated section below.
+Earlier the same day: editor IA slice 2 (speakers are a real stage; one runner path) landed,
+and slice 1 was committed with it. Previously: 2026-08-24 — **`main` is green again, `feat/channel-groups` is merged, and
+this file caught up with two sessions it had no entry for.** The 2026-08-12 session below
+landed in `7d32438` on 08-18; everything from 08-19 to 08-24 — recency ordering, the
+arbiter, lane guards, the pipelines band, worker tags and slots, LLM fan-out, unit
+executors, the sweep scope console — shipped on `main` with no STATE.md entry. The
+context-clear protocol in [`README.md`](../README.md) was skipped twice; this block is the
+catch-up. Commit bodies are the primary record and carry the measurements — read them
+with `git log -1 --format=%b <sha>` rather than trusting a paraphrase here.
+
+**Later the same day (16:xx).** Operator decision: the homepage does NOT link to the hub for now (`3dad5944`, `homepage/app/page.tsx` `HUB_LINK_ENABLED = false`; the URL stays in `homepage.json` for the hub's own build; redeployed as https://e04f6dd7.archilyzer.pages.dev — 0 "Search all archives" on the live page). Next: a ground-up homepage refresh (describe the project; the five sites as "Official instances"; plain copy, fewer subtitles) on a preview branch for review.
+
+## What landed 2026-08-18 → 08-24
+
+- **Chapter-boundary quality metric** (`7d32438`) — the 08-12 narrative below, committed.
+ `lib/boundaryScore.ts`, `--score-existing`, and the READ-RECALL-NOT-PRECISION finding.
+- **Recency ordering, four commits** (`74f8e51` → `efea56f` → `72745fe` → `bddae39`). A
+ per-runner `order` (listed | newest | oldest) sorts within a rule; `digest.recencyOrder`
+ and `backfill.order` do the same inside a batch; `reach` ("channel" | "corpus") extends it
+ to the CHANNEL plan. The date comes from a layered key: a key-only scan of `index.mdb`'s
+ `byChannel` (~300 ms for 78,583 videos, but only videos WITH a transcript — 122 of 870
+ pending), then an 8 KB tail read of `metadata.info.json` (868/870, 0.19 ms each,
+ memoized), then playlist position marked `estimated`. **Directory name ≠ metadata id on
+ ~14.5% of this corpus** (`the-quartering-rumble/data/v1007ay` holds `vxe1ae`), so the
+ index lookup is scoped to the owning channel or channel A's dir name inherits channel
+ B's date. Measured: 11,329 candidates ordered in 118 ms; the sweep re-plans in ~1.5 s.
+ `/auto-queue` became a dispatcher board saying what it would run next and why.
+- **Operation leaves, lane guards, the arbiter** (`3299a53`, `09d4598`, `ab68635`) —
+ [`unified-operations-model.md`](../unified-operations-model.md) steps **2, 3, 4 DONE; 1, 5,
+ 6 open**. (That file's "designed, not built" header is stale by three steps; its step
+ list is current.) `AutoQueueMatch.operation` beside `bucket`, claim key
+ `${operation}\0${id}` so digest and diarization cannot steal each other's work;
+ `common/controller/laneGuards.ts` holds digest's six rules as a preflight (throws) and a
+ per-pull gate (holds, never stops); `common/controller/arbiter.ts` runs on `queueKey ""`,
+ one unit per lane per pass, one job per channel, re-plans every pass, and REFUSES beside
+ an armed sweep. Not persisted across restart — that is step 6's.
+- **The console and the band** (`1f2b7c2`, `43173c8`, `7fa975d`) — `/auto-queue` is one
+ comparison rail over four pipelines; `components/pipelines/` holds the five-population
+ band (reachable / needs-media / blocked / deferred / present — never summed, ~91× apart on
+ this corpus). `band.ts` must stay directive-free and value-import-free: a server component
+ calls its pure readings, and `"use client"` on it 500s every channel page at request
+ time while `pnpm build` passes — caught by e2e, now pinned by a unit test.
+- **/channels, `group`, `costBasis`, and a word that was three things** (`4d57a5e`,
+ `a5c4e48`, `07227ea`) — six bands per channel row; on the live corpus every row draws the
+ same stripe and that uniformity IS the finding. Operations declare `group` and
+ `costBasis`. **The fact that hid: `attribution-text` is ON, reachable on 11,337 videos of
+ one channel, its unit is the transcript CHUNK (~194,000 model calls corpus-wide), and it
+ has completed ONE video** — it read as a quiet row because "11,337 reachable" looks the
+ same whether the unit is an audio pass or a per-chunk call. "Backfill" no longer names a
+ figure anywhere; it is a queue key, listed with its members only where the shared pause
+ and sweep live.
+- **Workers: tags route, slots multiply, endpoints fan out, executors run units**
+ (`1ff2256`, `549c77b`, `2fcd08f`, `16004ac`, `eee3a07`). `Worker.tags` is consulted
+ (`common/lib/workers.ts`); a remote is N slots, blank N filled from its own
+ `/api/worker/health` through `controller/remoteCapacity.ts`; `WorkerKind "llm"` is a box
+ running nothing but `ollama serve`, leased per call with only `baseUrl` swapped (outside
+ the freshness identity → zero churn), verified against `/api/tags` for the exact model
+ tag; every backfill kind declares `inputs / outputs / applyResult` and
+ `/api/worker/unit` runs one unit on a corpus-less box (`controller/remoteUnit.ts`,
+ `workerServer.startWorkerUnit`), refusing anything that is not a backfill kind. Executor
+ deployment is in RUNNING_IN_DOCKER.md. `worker-unit.spec.ts` 6/6.
+- **Sweep scope console** (`dee7500`, `215d4e3`) — pick operations and channels before
+ arming; scope is written by the ARM action only; a read-only "also runs on …" line per
+ row derived through the same `workerMatches` the pool grants by.
+- **Channel groups on /channels** (`66ec9eb`, `421a13c`, merged 2026-08-24 from the
+ `feat/channel-groups` worktree, which had sat uncommitted since 08-11). One table
+ sectioned by the site's authored groups, each header carrying that group's slice of the
+ pipeline as stations whose figure IS the button. Rebased over `4d57a5e`: the branch's row
+ component now renders main's `PipelineCell` columns, sections join to rows by slug, and
+ the header's `colSpan` is `8 + columns.length` rather than a literal.
+
+**Housekeeping, 2026-08-24.** `common` had failed `tsc` since `dee7500` (three test
+fixtures missing the widened `SweepKindCounts` fields; the node runner does not typecheck,
+so 821/821 hid it) — fixed in `6ea5ea2`. The `flexsearch-spike` worktree
+(`feat/client-flexsearch-index`, last touched 06-27, superseded by
+`common/components/searchIndex.worker.ts`) was **abandoned at `b4dee06`** — reflog only.
+74 already-merged local branches deleted; the empty May stash dropped.
+[`relocate-channel-media.md`](../relocate-channel-media.md) is now tracked: designed and
+verified against the tree, **not started**, and its real prerequisite is operational —
+`sdb1` (1.8 T platter) is not mounted. **Not covered here:** `umtool` (27 commits on 08-18,
+a separate workspace package) is documented in `umtool/docs` and AGENTS.md.
+
+### 2026-08-26 — speakers become a real stage, and there is one way to run an operation
+
+Six commits, `1da6f22` → `1058b98`, each its own reviewable diff.
+[`editor-operations-ia.md`](../editor-operations-ia.md) has the full "Slice 2, as shipped"
+section; [`FACTS.md`](../FACTS.md) has the invariants. Slice 1 is committed too (`9b65b83`) —
+it had been sitting uncommitted as 50 changed files, which would have made slice 2 one
+unreviewable diff.
+
+**Two live bugs fell out of the refactor, neither of them the point of it:**
+
+- **The arbiter never called diarization's `laneFor`.** `laneForOperation` special-cased
+ digest and returned the DECLARED `.lane` for everything else, so a sortformer/vulkan
+ diarization reserved as `contendsFor: "cpu"` while holding ~4.4 GB of the same 8 GB card
+ the transcription engine wants. Diarization has declared a `laneFor` since it was written;
+ nothing asked it. Now one resolution off the kind's own declaration, and digest gains the
+ `laneFor` it should always have had.
+- **`/operations/<id>` decided what to render from four hardcoded id tests.** A registered
+ `transcode` — external, no runner — would have drawn the BACKFILL SWEEP'S console under a
+ "Transcode" heading, with a live Start button arming a corpus-scale GPU commitment. The
+ descriptor states it now (`runner?`, and `sweepLaneIdFor` off `lane.queueKey`), and **null
+ is a real answer** rendered as a "no console here" panel.
+
+**One runner path.** `common/controller/operationJobs.ts`. There were four copies of "run one
+operation over one channel" and no two agreed: the editor's backfill summary line printed
+`deferred` and `blocked`, the sweep's printed `skipped`, and neither printed the other's — so
+"what did that run actually do" depended on which button started it.
+
+**The load-bearing decision in it: the runners do NOT drain.** Draining is the SWEEP's
+property, and the editor consumes the same stream client-side to draw a live log — a runner
+that drained would leave every stage card's log dead. The three callers that want sequencing
+drain at their own call site. This is the thing most likely to be "fixed" back.
+
+**`StageId "backfill"` → `"speakers"`.** It was a queue key wearing a stage's name; nobody can
+arm, pause or run "a backfill". `?stage=backfill` still resolves (`STAGE_ALIASES`) — an unknown
+`?stage=` falls back to the overview, which is right for a retired stage and wrong for a
+renamed one. **Two assertions would have passed vacuously after the rename** and were caught:
+a `notEqual` against a value the union can no longer hold, and a count-0 against a label
+nothing renders.
+
+**Decisions worth keeping:**
+- **`laneFor` must stay OPTIONAL.** `backfillBatch.ts` reads its PRESENCE as the marker for
+ the GPU idle-only rule, so "give every kind a `laneFor` defaulting to `lane`" is not a no-op
+ — it enrols every kind in that rule and revives a recorded regression.
+- **`laneForOperation` asks `getBackfillKind`, not `operationCatalog()`.** A catalog lookup
+ would hand download and transcription a lane and the arbiter would start a backfill channel
+ job for work no backfill kind can do.
+- **NOT one `OperationStage.tsx`**, which is what the slice plan said. The two cards overlap
+ in presentation and diverge in everything that acts; merging them means a component
+ branching on its own identity. `OperationWork.tsx` is the presentational half, and the
+ criterion is written into the file.
+- **The `/channels` backfill group button is the LANE, not one operation**, so it does not go
+ through the dispatcher.
+- **The population aria-labels still say "backfill"** — 16 spec lines, deliberately left for
+ the vocabulary pass to keep them out of this slice's e2e risk. *(Done later the same day —
+ they say "speakers"; see the entry above.)*
+
+**Recommended next**, with unified-ops step 1 (the old #2) now shipped:
+
+1. **GPU yield on a quiet box** — still the gate on arming the sweep, still unmeasured.
+2. **The operator runbook for the 16,156 `deferred`** — **CAUSE FOUND AND FIXED 2026-08-27**
+ (`fed4b01` the fix + units, `ca42f7b` the e2e and the wording). It was **neither
+ accumulation nor a regression in the cues gate**: it was one armed backfill sweep. With
+ `allowRedownload: true`, every video on a `handling: "youtube"` channel is diarization
+ `missing-input`, which dispatched a re-acquire that ran the channel's OWN
+ `--skip-download --write-subs --write-auto-subs` download — rewriting
+ `metadata.info.json`, landing no audio, and leaving `transcript.cues.json` stale by mtime.
+ ~16,000 videos on eight channels, 2026-08-22 → 08-26, zero diarizations. Census, trail and
+ numbers: FACTS.md "Verified 2026-08-27 — why `deferred` was 16,156". The fix forces a
+ per-video transcribe override and re-normalizes after every fetch. **Four operator steps
+ remain, and none was run from that slice:**
+
+ 1. Keep `sweepEnabled: false` until `fed4b01` is on the running editor. (It is off now.)
+ 2. **Clear the 16,081**: Digest stage card → *Normalize transcripts* on the-quartering,
+ destiny, chibi-reviews, nux-taku, leaflit, kirsche, quartering-live, HasanAbiVODs3 (and
+ shondo-vods, 22). Pure re-parse, no network; identical cues in 230/240 sampled cases;
+ digests are not invalidated (`isSectionFresh` is provenance-keyed). Expect corpus
+ `deferred` → ~76, the `missing`/`no-meta` tail.
+ 3. **Re-affirm `allowRedownload` knowing what it now does.** With the fix the sweep will
+ *really* fetch audio for the **66,540** youtube-handling `missingInput` videos
+ corpus-wide, deleting each file after use (or handing it to auto-transcribe — step 4).
+ The walk is **channel-major, in the configured order, with no inter-download sleep**:
+ `sleepBetweenDownloadsSeconds` is the channel SYNC path's setting and the backfill
+ sweep does not consult it (`backfillSweep.ts:55, 335-368`), so the earlier "30 s
+ between downloads → ≥ 23 days" figure here was wrong. Scope it with `sweepChannels`, or
+ turn the flag off, before arming. That is a policy decision, not a code one.
+ 4. ~~**A known interaction, flagged not fixed**~~ — **RESOLVED 2026-08-28 by `e450c2c`.**
+ The interaction was real: `autoQueue.transcription` is enabled with
+ `replaceAutoSubs: true` and picks from snapshots that regenerate ~1 s after a download
+ finishes, so a re-acquired `audio.mp3` on an ASR-only video is exactly what it looks
+ for — and the backfill's `finally` would delete it mid-whisper, which is not "a failed
+ unit, nothing lost" but a video appended to `failed-transcriptions`, honoured
+ permanently by the manual per-channel batch. Now the backfill hands the file over
+ instead (`decideKeep`), vetoes cleanup while a transcribe task is running on the video,
+ and `transcribeOne` treats vanished audio as a `no-audio` SKIP on both the local and the
+ remote path. **The operator no longer needs to turn `replaceAutoSubs` off for the corpus
+ run**; the trade is that handed-off audio persists like any other download until a
+ Clean-audio sweep. Mechanics and the file:line trail: FACTS.md "Verified 2026-08-27 —
+ the re-acquire / auto-transcribe hand-off".
+3. ~~**Editor IA slice 4** (`/actionable` dissolves)~~ — **DONE 2026-08-28**, `a623958` →
+ `43c4e26`. Plan: [`editor-ia-slice-4.md`](editor-ia.md); outcome: "Slice 4, as
+ shipped" in `editor-operations-ia.md` and the FACTS section "Verified 2026-08-28 — editor
+ IA slice 4 seams".
+4. **Relocate `omnimirror`'s media** once the platter is mounted (131 GB off a 94%-full SSD).
+5. **Phase 6 Ollama `/ask`** — genuinely independent; a good parallel task.
+6. Decide `attribution-text`'s fate on that one channel: ~194,000 chunk-level calls is a
+ sweep-sized commitment that was never priced.
+7. ~~**Unified-ops step 1**~~ — **DONE 2026-08-26**, `efb0cf9` → `00b1c8a`. Plan:
+ [`unified-ops-step-1.md`](editor-ia.md); outcome: the dated entry below and the
+ FACTS section "Verified 2026-08-26 — unified-ops step 1".
+8. ~~**Editor IA slice 3** (per-operation settings)~~ — **DONE 2026-08-26**, `9515083` →
+ `43bb519`. Plan: [`editor-ia-slice-3.md`](editor-ia.md); outcome: the dated entry
+ below and "Slice 3, as shipped" in `editor-operations-ia.md`.
+9. ~~**Editor IA slice 7** (one pause)~~ — **DONE 2026-08-28**, `c924f73` → `685cba3`. Plan:
+ [`editor-ia-slice-7.md`](editor-ia.md); outcome: "Slice 7, as shipped" in
+ `editor-operations-ia.md` and the FACTS section "Verified 2026-08-28 — editor IA slice 7
+ seams". It is also **half of unified-ops step 5**: one definition and one writer among the
+ controls, but the four settings fields are still four settings fields — step 6 moves the
+ storage behind `isGateHeld`/`withGateHeld`.
+10. ~~**Editor IA slice 6** (the video page: one panel per operation)~~ — **DONE 2026-08-28**,
+ `6986efc` → `d5ca90a`. Plan: [`editor-ia-slice-6.md`](editor-ia.md); outcome:
+ "Slice 6, as shipped" in `editor-operations-ia.md` and the FACTS section "Verified
+ 2026-08-28 — editor IA slice 6 seams". The registry's per-video reader is
+ `common/controller/videoOperations.ts`, and a fifth operation now needs no page.
+11. ~~**Editor IA slice 8a+8b** (sync is an operation; its settings and the workers' live on
+ their pages)~~ — **DONE 2026-08-29**, `ea04b4e` → `fecac0f`. Plan:
+ [`editor-ia-slice-8ab.md`](editor-ia.md); outcome: "Slice 8a+8b, as shipped" in
+ `editor-operations-ia.md` and the FACTS section "Verified 2026-08-29 — editor IA slice
+ 8a+8b seams".
+12. ~~**The `/jobs` fold — the last third of slice 8**~~ — **DONE 2026-08-30**, `2226680` →
+ `21feed3`. Plan: [`editor-ia-slice-8c.md`](../editor-ia-slice-8c.md); outcome: "Slice 8c, as
+ shipped" in `editor-operations-ia.md` and the FACTS section "Verified 2026-08-30 — editor
+ IA slice 8c seams". The design question was answered **"a row is one job"** — and because
+ it was, there is no mode: one list, live head and paged tail, one `<tr>` per job. Slice 8
+ is complete.
+13. ~~**Editor IA slice 5** (Sites absorb the five)~~ — **DONE 2026-08-30**, `140212a` →
+ `df9b839`. Plan: [`editor-ia-slice-5.md`](editor-ia.md); outcome: "Slice 5, as
+ shipped" in `editor-operations-ia.md` and the FACTS section "Verified 2026-08-30 — editor
+ IA slice 5 seams". A site has tabs and the family page has the globals; the five satellite
+ routes 307. **The nav is eleven** — the IA doc's end state — and the IA doc's UI slices are
+ complete.
+14. ~~**The transcode operation**~~ — **REMOVED 2026-08-30**, `904f1a9` → `f717a36`. Plan:
+ [`editor-transcode-removed.md`](editor-ia.md); census in FACTS "Verified
+ 2026-08-30 — transcode: what it was, what stayed". The band question is closed by
+ deletion; `EXTERNAL_BAND_IDS` is two — and since one-core 1.5 it is two because it is
+ `EXTERNAL_OPERATIONS.map(o => o.id)`, so a third external pipeline would join the rail
+ by being declared rather than by editing that constant.
+
+**Recommended next (editor IA).** The UI slices are done and the transcode band is no longer a
+candidate. What is left is **Phase 6** and **slice 9**, which is gated on the sweep running in
+production.
+
+---
+
+### 2026-08-26 (late) — unified-ops step 1: the digest work list has one definition
+
+Three commits: `1db30c3` (the plan), `efb0cf9` (the deletion), `00b1c8a` (de-specialising the
+readers), plus this docs commit. Plan: [`unified-ops-step-1.md`](editor-ia.md);
+measurements in [`FACTS.md`](../FACTS.md) under "Verified 2026-08-26 — unified-ops step 1".
+
+1. **The migration was already over, so the step was a deletion, not a rewiring.** All **68 of
+ 68** snapshots on disk carry `backfill.digest` with a numeric `eligible` (`generatedAt`
+ 08-11 → 08-26), so `digestWorkOf`'s `"bucket"` branch was reading nothing. **No rendered
+ number moved.** The "published coverage percentage will change" warning in the step's own
+ text had already happened, silently, between 08-11 and 08-26.
+2. **The two counters disagreed by 11,777 videos** (bucket 59,159 vs entry 47,382) and could
+ not have been reconciled: on 65 of 68 channels the delta is exactly `deferred`, because the
+ registry gates on a current `cues.json` and the bucket did not. Deleting the bucket is what
+ makes there be one definition — the registry's `state()`, which is also what the runner
+ dispatches from.
+3. **No regeneration, and no regen CLI.** Old snapshots keep a stray `noDigest` key until
+ their next routine regen; `normalizeBuckets` picks only the keys it knows and there is no
+ snapshot schema version. An offline writer would race the live editor's
+ `snapshotScheduler` on the same files, and there is nothing it would need to do.
+4. **The `noDigest` view-model names were deliberately kept** — `DashboardChannel.noDigest`,
+ the `/api/widget/actionable` wire field, `actionableNoDigestCount`, `DigestStage`'s
+ `noDigestIds`. They mean "videos with no current digest", which is still what they hold;
+ renaming a wire field is its own change. **Renamed in slice 4** (2026-08-28): the first
+ three are `digestReachable` / `actionableDigestReachableCount`, because the number is the
+ digest band's `reachable` and the honest name says so. `DigestStage`'s `noDigestIds` is
+ untouched — it is a list of ids, not this count.
+5. **The transcode band was NOT taken with this step.** Three docs filed it "with step 1" only
+ because both were thought to need one regeneration of the snapshots; step 1 needs none, so
+ the coupling is void. It is its own snapshot-shape change (the writer recording a transcode
+ population, `appliesTo(config)` and a kept-media denominator) and its own plan.
+6. **Digest is no longer special to any reader.** Four `id === DIGEST_OPERATION_ID` fallbacks
+ went (`buildBands.ts`, `sweepPreview.ts` ×2, `sweepRecency.ts`). No entry now means for
+ digest what it means for diarization: no work known, coverage unknown — an unfilled band
+ outline, never a filled 0 %.
+
+**THE FINDING TO ACT ON: corpus-wide `deferred` is 16,156.** It was **1** on 2026-08-10, right
+after the normalize pass. `destiny` 3,869, `the-quartering` 3,762, `chibi-reviews` 2,699,
+`nux-taku` 1,802, `leaflit` 1,612, `kirsche` 1,197. That is 16,156 videos the digest lane will
+not touch, and it was invisible to a reader of the old bucket.
+
+> **Corrected 2026-08-27.** The "either accumulation or a regression" framing above was wrong
+> on both counts, and it is left here only because the census that settled it started from
+> these numbers. It was ONE ARMED BACKFILL SWEEP re-acquiring media on subtitle channels with
+> the channel's own subtitle-download config: metadata rewritten, no audio landed, cues stale
+> by mtime. Fixed in `fed4b01` / `ca42f7b`; the census and the file:line trail are in FACTS.md
+> under "Verified 2026-08-27 — why `deferred` was 16,156", and the operator runbook is item 2
+> of "Recommended next" above. The Digest card's **Normalize transcripts** button is still
+> what clears the 16,081 already on disk — deliberately NOT run from either slice.
+
+---
+
+### 2026-08-26 (evening) — editor IA slice 3: an operation's settings are on its page
+
+Five commits: `9515083` (the plan, with the two uncommitted doc files), `f14ceb5` (the
+seams), `43bb519` (the move), `b303817` (copy, the `/settings` pointer, docs) and `7c34bc5`
+(the one collision the move created — see 6 below). The as-shipped record is in `editor-operations-ia.md`
+("Slice 3, as shipped") and the new file paths are in `FACTS.md` under the seams census;
+this entry is the decisions.
+
+1. **The markers were the deletion.** Four hidden `*FormPresent` inputs gated the four
+ settings blocks, and every one existed because ONE form saved everything: an unchecked
+ checkbox is absent from a FormData, so a submit from a form lacking a block would read
+ that block's every switch as off — a disarmed corpus sweep, a dropped diarization capture
+ lane, `allowRedownload` on against a full disk, ~194,000 model calls armed. One form per
+ block makes that structural. 562 lines out of `SettingsForm`, 171 out of its action.
+2. **The lane block is per LANE, not per operation** (the decision recorded while scoping,
+ and it held). `settings.backfill` governs `BACKFILL_QUEUE`, shared by diarization and both
+ attribution operations, so `LaneSettingsForm` renders beside `SweepLane` in
+ `SweepOperationView` — one definition, three renders, exactly where the shared pause and
+ sweep already are.
+3. **`settingsBlock` is on the descriptor**, a closed union, switched over exhaustively —
+ never a table keyed by operation id. Both attribution operations get one form because they
+ declare one block. Same rule slice 2 set for `runner` and `sweepLaneIdFor`.
+4. **The `role="status"` boundary is now written down.** `SaveBar`'s "only role=status on
+ this page" means RUNNER pages (`auto-subs-replace.spec.ts:415` depends on it); sweep-fed
+ pages have settings forms with their own status regions and no policy tree.
+5. **Two blocks gained their first form-driving spec.** Attribution and the lane had none —
+ which is how the most expensive switch in the console went untested from a browser. The
+ new `operation-settings.spec.ts` also proves structurally what the markers used to buy:
+ saving the diarization form beside the lane form leaves `backfill.enabled` alone. 7/7.
+
+6. **Moving a component moves its SENTENCES into someone else's selectors.** The lane form's
+ paragraph still said "…so it lives with the plan it produces", and `The plan` is the
+ heading of the sweep console now directly above it inside the same `section[data-lane]`.
+ `backfill.spec.ts:484` scopes `getByText("The plan")` there and `getByText` matches
+ substrings, so it resolved to two elements. Reworded, with a comment marking the phrase
+ off-limits in that file. (The same commit keys the two server-built settings slots: an
+ element created in a Server Component and rendered by a client component warns on React's
+ dev key validation, naming a render method that did not create it.)
+
+Verified: tsc in all six packages, `common` 828/828, editor units 85/85, the new spec 7/7,
+and a fixture check of every operation page (digest → one form; diarization and both
+attribution pages → operation form then lane form; download/transcode/transcription → none;
+`/settings` down to its four remaining fieldsets and one `<form>`, carrying the pointer).
+The affected e2e specs ran twice: 104/107 then, after the fix, 28/28 on the three that had
+failed — two of those three (`auto-subs-replace.spec.ts:394`, `cadence-ui.spec.ts:212`) were
+timeouts and passed on a re-run untouched.
+
+Deliberately not done: the three other file-local `Field` copies; `WorkersField` (slice 8);
+the pause trio (slice 7); `/actionable` (slice 4). No persisted key or field `name` changed,
+and no route retired.
+
+### 2026-08-26 (later) — the vocabulary pass: the registry says "operation"
+
+Three commits after `e0703b4`, sized so the 60-file identifier sweep is reviewable on its own.
+The mapping table, the "unit" rule, the list of what deliberately still says "backfill" and
+the transcode-band boundary are in `FACTS.md` ("Verified 2026-08-26 — the vocabulary pass");
+this entry is the decisions.
+
+1. **Mechanical rename.** `backfillKinds.ts` → `operations.ts`, ~25 `Backfill*` exports →
+ `Operation*`, tsc-verified, zero behaviour change. The rule: "backfill" survives where it
+ names the LANE and its persisted contracts, goes where it named the kind. So
+ `laneBackfillKinds` became `backfillLaneOperations` — the lane word moved to the front
+ rather than vanishing, because once `Lane` is generic "the lane's operations" must say
+ which lane. Persisted keys (`snapshot.backfill`, `settings.backfill`, `kindIds`,
+ `sweepKinds`, the job kinds) are untouched; "kind" was not chased outside the export table.
+2. **The id spaces.** `StationId "backfill"` → `"speakers"` on `/channels`, with the label
+ **derived** (`speakersLabel`, "Derived data" under default settings) rather than the
+ literal "Speakers" — the same rule the stage title already follows, so a button never
+ claims work its lane is not doing. `/actionable`'s section id → `speakers`, count column
+ "reachable". `BackfillStage` → `SpeakersStage`, and its populations say "speakers" (15 spec
+ lines). `PauseBackfillButton.tsx` deleted (zero importers). "unit" is one word: dispatch
+ keeps it, cost is "cost basis", the `Figure({unit})` prop was a population label and says so.
+3. **`transcode` registered**, with the registry's first `appliesTo(config)` replacing three
+ verbatim copies of `handling === "transcribe" && !!audioFormat`. `/operations/transcode`
+ is the no-console panel slice 2 built. **Its band is not registered**: a snapshot carries
+ no `handling`/`audioFormat`, so a pure band cannot tell "never transcodes" from
+ "finished" — that waits for the snapshot writer to record it (unified-ops step 1).
+ **Removed 2026-08-30** — see item 14 above.
+
+**Decisions worth keeping:**
+- **The station label is derived, not "Speakers".** `channel-stage-selection.spec.ts` pins
+ "Derived data" as the honest fallback; `channel-groups.spec.ts` now asserts the same string
+ on the group button.
+- **`backfill*Action` names stay** — `backfillChannelAction` and
+ `start|stopBackfillSweepAction` run or gate the LANE, and their aria-labels
+ (`pause backfill`, `start backfill sweep`) are asserted by specs that test the lane.
+ (`pause|resumeBackfillAction` were named here too; **slice 7 deleted them** along with the
+ other seven pause actions — the aria-labels stayed, which is the part that mattered.)
+- **Plans docs were not search-replaced.** They are dated history; FACTS carries the mapping
+ and a line saying earlier sections are pre-rename.
+
+### 2026-08-25 — the editor gets its noun: `/operations`, and a nav with four groups
+
+**The backend found its organizing noun — the operation — and the UI had not.** Counted
+rather than estimated: 28 pages behind a 19-link nav whose "Pool" group held ten unrelated
+tools, four channel tables, four job lists, three renderings of lane state, and four
+different answers to "what needs doing". Digest and attribution are first-class in the
+REGISTRY and were second-class in the UI: no route, no stage, no per-video view, two settings
+fieldsets for one concept.
+
+[`editor-operations-ia.md`](../editor-operations-ia.md) is the UI half of
+[`unified-operations-model.md`](../unified-operations-model.md), written down whole — the four
+nouns (Corpus, Operations, Sites, Machine), the seven places "operation as the noun" honestly
+breaks and what to do about each, the nav end state, the reconciliations with unified-ops
+steps 5/6, PLAN.md Phase 11a and relocate-channel-media §6, and **nine slices, each
+shippable, each deleting something**.
+
+**Slice 1 shipped.** `git mv app/auto-queue app/operations`; `/operations` is the board (the
+rail, the arbiter, a sync row) and `/operations/<id>` is one operation, resolved against
+`operationCatalog()` so an unknown id 404s and a NEW registry entry gets a page with no route
+work. `/auto-queue` redirects. The **lane `<select>` is deleted** — with one lane per page
+there is no switch to lose policy-edit state across, which was the only reason the
+non-selected lanes stayed mounted. The runner section's ~1,200-line structural e2e contract
+survived the move verbatim (`RunnerOperationView.tsx` states every clause of it). Nav is four
+groups; *Monitor* left it (the widget is a projection of the board payload, reached from the
+dashboard's pipeline band).
+
+**Decisions worth keeping:**
+- **The sweep scope is NOT pre-ticked to the operation being viewed.** The scope is written
+ at arm time, so a per-page default would arm a narrower sweep than the operator sees.
+- **A speaker operation's page draws its OWN band** (the shared panel could only say "this
+ lane covers several operations"), and says in a sentence that the lane, sweep and pause are
+ shared. A per-operation page is not a per-operation switch.
+- **The arbiter is the BOARD's control**, not a lane's — it decides *between* lanes.
+- **Retired routes redirect, never 404**, and the nav cap is umtool's rule, quoted in
+ `nav.ts` so two consoles do not drift into two nav philosophies.
+
+**Recommended next** (supersedes the list under "Pre-sweep decisions", which still
+describes the reasoning):
+
+1. **GPU yield on a quiet box** — still the gate on arming the sweep, still unmeasured.
+2. **Unified-ops step 1**: collapse `noDigest` into `snapshot.backfill.digest` — the step
+ Phase C skipped, and now the arbiter can act on the result.
+3. **Relocate `omnimirror`'s media** once the platter is mounted (131 GB off a 94%-full SSD).
+4. **Phase 6 Ollama `/ask`** — genuinely independent; a good parallel task.
+5. Decide `attribution-text`'s fate on that one channel: ~194,000 chunk-level calls is a
+ sweep-sized commitment that was never priced.
+6. ~~**Editor IA slice 2**~~ — **DONE 2026-08-26**, see the section above. What it planned
+ and what shipped differ in three places (`laneFor` is not universal, there is no single
+ `OperationStage.tsx`, the backfill group button stayed the lane); the reasons are in
+ [`editor-operations-ia.md`](../editor-operations-ia.md).
+
+---
+
+## Session 2026-08-12 — landed in `7d32438` on 2026-08-18
+
+See [`bakeoff/speakers-round1-notes.md`](../bakeoff/speakers-round1-notes.md) and
+[`digest-context-review.md`](../digest-context-review.md).
+
+**EVERY METRIC THE BAKE-OFF HAD WAS A DEFECT COUNTER.** `zeroYieldRate`,
+`chaptersPerHour`, `rejectionRate`, `maxGapSeconds`, `genericTitleRate`,
+`duplicateTitleRate` — all say how malformed the output is, none says whether a boundary
+is in the right place. `lib/boundaryScore.ts` (new, 12 unit tests) scores generated
+chapter starts against the **uploader's own chapter marks**, an oracle the model never
+sees. Boundaries are facts, so scoring against them reproduces nothing; the uploader's
+chapter *titles* are expression and are never scored against. The t=0 mark and
+boilerplate marks are dropped, and matching is one-to-one closest-pair-first so
+over-segmentation is punished rather than rewarded.
+
+**THE ORACLE IS FAR BIGGER THAN THE SPEAKER DATA IT WAS BUILT TO JUDGE.** Measured, not
+sampled: **14,923** video dirs carry a non-empty `chapters` array; **12,139** of those
+also have a transcript and >=4 marks, across **43 channels**. Nothing in the codebase read
+`metadata.info.json.chapters` before this. Against that, only **34** videos in the whole
+archive have audio + transcript + >=4 marks — the plan's figure, confirmed exactly,
+including its channel split.
+
+**FIRST BASELINE, FOR FREE, AND IT FOUND A BUG.** `--score-existing` scores digests
+already on disk with no model calls and no writes. Over the 15 scorable ones:
+**P@30 10.8%, R@30 26.1%, R@60 35.9%, F1@30 15.2%** across 153 uploader marks; per-video
+F1 spans 0–50%, so the metric discriminates. It immediately caught
+`omnibased/3fl_uRFXxLk`: video runs 0–5119 s, uploader marked throughout, digest emitted
+chapters only between 3184–4865 s — the head two-thirds unsummarized.
+
+**READ RECALL, NOT PRECISION — and there are now three samples proving it.** A generated
+run over a fresh 12-video / 8-channel sample at the production config
+(`chunk-local`/8192/600) gives **R@30 21.5%, P@30 5.6%, F1@30 8.8%**, median offset 109 s,
+163 marks, 87 chunks. Against the free `--score-existing` run (R@30 26.1%, P@30 10.8%) and
+a short/medium subsample (R@30 12.2%, P@30 20.8%): **recall stays in a narrow band across
+three samples sharing no videos, while precision swings 5.6%→20.8% on the same engine
+purely with the duration mix.** The digest targets 1 chapter/4 min, so on short videos it
+emits fewer boundaries than the uploader (24 vs 41) and on 8-hour VODs far more (149 vs
+9). F1 inherits the swing. **Compare candidates on recall with `chaptersPerHour` beside
+it**; a variant that "improves F1" by matching the sample's density has improved nothing.
+
+Same run's guard rails: 8.1% zero-yield, 14.8% rejection, 16.5% generic titles,
+47 s/audio-hour → 43.1 projected sweep days (same order as `digest-plan`'s 53.8).
+
+**THE SWEEP WAS PAYING AN 8× CONCURRENCY TAX.** The live `digest-channel-local` job was
+running at **~200 s/chunk against `MEASURED_SECONDS_PER_CHUNK` of 24.7** — `ollama ps`
+read `85%/15% CPU/GPU`, i.e. memory pressure had pushed the model mostly onto CPU
+(prefill ~43 tok/s). With the sweep and backfill paused and memory freed, the identical
+model loads **100% GPU**. The 53.8-day projection was on the order of 400+ days at the
+contended rate. This dwarfs every prompt-level improvement currently under discussion.
+
+**TWO PRODUCTION FILES TOUCHED, BOTH ADDITIVE, BOTH BYTE-IDENTICAL WHEN UNUSED, NO
+`PROMPT_VERSION` BUMP.** `transcriptToMarkdown.prefixForCue` (the speaker label must sit
+OUTSIDE the `[HH:MM:SS]` bracket — the prompt tells the model to copy those markers
+verbatim and `HMS_PATTERN` rejects an echo) and `ChapterPromptInput.speakerRoster`
+(deliberately NOT `contextNote`, which is per-channel and hashed into `contextHash`).
+The shipped lane sets neither, so sweep output is unchanged — the same argument that let
+`timestampMode` in at version 1. Both pinned by tests; 701/701 common tests pass, `tsc`
+clean in common/editor/export.
+
+**THE SPEAKER A/B DID NOT RUN, DELIBERATELY.** Sample built (`bakeoff/speaker-sample.json`,
+12 videos / 27.3 audio-h / 178 marks) and the pipeline proven end to end on one video, but
+the plan's own precondition — confirm the box is not loaded — failed: a second sherpa
+process alongside the operator's already-running `diarize-channel` took the box to
+**262 MB free, 14.1 GB swapped, memory-pressure full-stall 2.6%**. Stopped rather than
+corrupt both the operator's job and the bake-off beside it. Exact resume command is in
+the notes file.
+
+**WHAT THE ONE DIARIZED VIDEO SHOWS, AND IT IS NOT ENCOURAGING.** `shondo/OWuZuOrbQ10`:
+8 clusters → 3 speakers, 98.8% of cues labelled, speaker changes on 16.9% of cues,
+**prompt inflation only 4.4%** (well under the ~10% budgeted, because labels are emitted
+on speaker CHANGE only). But (a) the labels are ROLES — "Host", "Caller", "Interviewer" —
+so the title-quality half of the hypothesis is untestable on this material, there is no
+name to put in a title; and (b) they **invent speaker changes**, splitting one continuous
+narration across two labels. False changes are anti-signal for boundary detection. n=1,
+but both facts were invisible before the render existed, and both say the A/B must be
+read for harm as carefully as for benefit.
+
+**ELEVEN CHANNEL CONTEXT NOTES DRAFTED, NONE PROMOTED.** `digest-context.suggested.md` for
+the 11 heaviest channels by remaining sweep work (~113k of 188,269 chunks, ~60%). A note
+only reaches the prompt as `digest-context.md`, and only a human renames it — auto-applying
+model-authored context stays forbidden. `omnibased`'s note is the strongest: 11 of 150
+sampled descriptions carry the channel's OWN segment taxonomy (`AFK:`, `Chatting:`,
+`Gaming:`, `Clicking Links:`, `Watching:`, `Debate:` …), so that note transcribes the
+channel's vocabulary rather than inferring one. Provenance and a review checklist are in
+`digest-context-review.md`.
+
+**2026-08-09 (later)** — **Phase D step 1: the digest counters collapsed into the
+operation registry.** Branch `feat/digest-in-registry`, off a fast-forward merge of
+`feat/diarization-oom-wall` into `main` (8 commits, no conflicts).
+
+**THE DIGEST KIND'S `state()` WAS CALLED BY NOTHING, AND NOW IT IS THE ONLY DEFINITION.**
+`channelSnapshot` iterated `laneBackfillKinds()`, which excludes digest by queue key, so
+Phase C registered the operation and changed no number anywhere. It now iterates
+`allBackfillKinds()` — a work list the snapshot does not carry is a work list nothing can
+count, select or schedule, and that is the prerequisite for every later step.
+
+**THE HAZARD WAS REAL AND IS CLOSED BY DECLARATION, NOT BY AN ID CHECK.** Four surfaces summed
+`Object.values(snapshot.backfill)` on the assumption that the map WAS the backfill lane
+(`stageStatus.ts`, `loadActionable.ts` ×2, `api/widget/sync`). All four now use
+`laneEntriesOf()`, which filters on `lane.queueKey === BACKFILL_QUEUE` asked of the registry —
+so the next operation on its own lane does not re-arm the same trap. `backfill.spec.ts` has a
+spec that asserts BOTH halves: that `snapshot.backfill.digest` exists with the right ids, and
+that the Backfill card still reads 1 while the Digest card reads 2. Asserting only the second
+half would have passed vacuously if the entry were never written.
+
+**MEASURED, AND IT CONTRADICTS THE PLAN'S PREDICTION.** The plan expected the corpus digest
+count to RISE by ~1,530. It FALLS by 414, and the decomposition closes exactly:
+
+| | videos |
+| --- | --- |
+| old `noDigest` total (54 channels that have the bucket) | 75,613 |
+| + the 11 pre-bucket channels, now counted | +1,516 |
+| − newly `deferred` (no current `cues.json`) | −1,933 |
+| = new reachable | **75,199** |
+
+`deferred` is far larger than the plan assumed and it is CONCENTRATED: **`piratesoftware`
+alone has 1,683**, so 94% of that channel's 1,797-video apparent digest backlog was work
+`digestVideo` would have taken and immediately put back.
+
+**FOLLOW-UP, 2026-08-10 — the `deferred` bucket is now CLEARED, and the reason for it was
+wrong.** Splitting it by cause showed 1,942 videos with NO `cues.json` at all against 47
+genuinely superseded ones, so "the raw transcript changed underneath, and the normalize pass
+clears it" described 2.4% of the bucket and self-resolution described none of it: nothing
+automatic ever runs `normalizeTranscript` for a channel that downloads its subtitles. Fixed in
+`426ae51` — `isCuesJsonFresh` returns a `reason`, `normalizeAllTranscripts` takes
+`channelSlugs`, `normalize-transcripts` is a registered job kind, and the Digest card carries a
+**Normalize transcripts** button next to the count. Run over the 11 affected channels: **1,991
+written, 0 failed**; measured with the real `digest.state()` afterwards, corpus `deferred`
+**1,987 → 1** and reachable **75,406 → 77,392**, with `piratesoftware` going **~114 → 1,797**.
+`blocked` stayed at 1,626, unchanged, which is the point — those are waiting on transcription
+and normalize was never going to touch them. Full split and the `omnimirror` finding in
+FACTS.md. Everything else the plan stated held:
+`blocked` = **1,631** exactly (the untranscribed count), `eligible` = 78,885 of 78,963 videos,
+i.e. exactly **78** untranscribable. Coverage is **122** digested at the current identity.
+
+**COST GATE PASSED, SO THE OPTIMIZATION WAS NOT DONE.** `digest.state()` adds
+`isCuesJsonFresh()` per video: **0.34 ms/video** on a 125-video channel, **0.38 ms/video** on
+a 773-video one — 0.7x to 1.2x the `readVideoFiles` call the snapshot already pays, ~30 s
+across the whole corpus spread over 67 regenerations. `isCuesJsonFresh` re-lists a directory
+the caller already listed; folding that into `files.entries` is deliberately NOT done, because
+at this cost it would be an optimization with no measurement behind it.
+
+**A FIFTH STATE: `partial`.** Digests are generated per SECTION and `digestVideo` regenerates
+only the sections that are not fresh (`digestVideo.ts:158`), so "has chapters, needs tags" is
+a fraction of the cost of "has neither" and the two were both reported as `stale`. It is
+summed into `reachableBackfillWork` — the split is about what work COSTS, never about whether
+it is reachable — and it made the `never` check in `candidateAction` fire, which is exactly
+what that check is for. Not reachable on the live corpus today (`sections: ["chapters"]`), and
+it becomes the dominant case the moment the pre-sweep decision to enable tags lands: every
+already-digested video goes part-done at once, and without the split that reads identically to
+a `PROMPT_VERSION` bump that invalidated everything.
+
+**TWO THINGS THE PLAN GOT WRONG, CORRECTED IN PLACE:**
+
+- **`backfillSweep.ts:382` was never comparing on `" "`.** It already joins on a LITERAL NUL
+ BYTE and was correct. The plan misread it because a raw NUL makes the file binary to `grep`
+ — which is the actual defect. Both that line and `backfillBatch.ts:282` now use the
+ `\u0000` escape (`digestSweep`'s form), so neither file needs `grep -a` any more.
+- **`present` is NOT available from `BackfillCounts`** — `addBackfillState` discards it by
+ design, so the plan's "the registry now gives it directly" was false. Fixed by storing
+ `eligible` (videos the operation had an opinion about) on `BackfillSnapshotEntry`, keeping
+ the counts a pure work list; `presentBackfillWork()` derives present from it and returns
+ **null**, never 0, on a snapshot that predates the field.
+
+**TWO LATENT DEFECTS FOUND ON THE WAY, BOTH FIXED.** `countBackfillWork` re-spelled the
+reachable rule instead of sharing it and had ALREADY drifted — it classified `blocked` and
+then counted it nowhere, so a channel of prerequisite-waiting videos reported three zeroes and
+read as finished. It now folds through `addBackfillState` + `reachableBackfillWork`. And the
+runtime backstop list in `backfillBatch.test.ts` was missing `"blocked"` — the one test whose
+job is to catch a state nobody wired up had itself missed one.
+
+**STEP 4 IS NOT DONE AND CANNOT BE DONE FROM HERE.** Regenerating the 66 snapshots only takes
+effect through an editor running this code, and the live editor on :3001 is a PRODUCTION build
+(`pnpm start`) serving the old one, currently supervising a diarization. It needs a restart on
+the new build, then a regen. The `noDigest` fallback in `digestWorkOf()` is what makes the
+interim safe: an un-regenerated channel reports its old bucket rather than reading as fully
+digested.
+
+> **STALE — corrected 2026-08-26.** It got done on its own. The live editor was restarted on
+> the new build some time after 08-10 and the snapshot scheduler regenerated the rest: **68 of
+> 68** snapshots carry `backfill.digest` (and a numeric `eligible`), `generatedAt` spanning
+> 08-11 → 08-26. So the fallback was reading nothing, and unified-ops step 1 deleted it along
+> with the bucket — see the 2026-08-26 (late) entry.
+
+**ALSO SHIPPED, ASKED FOR MID-SESSION: a diarization progress bar.** A `backfill` task got the
+DOWNLOAD parser, which matches nothing in diarization output, so a 40-minute windowed
+diarization showed an indeterminate bar while the job bar sat at "0/9 videos". `diarize-sherpa.py`
+was already printing `window 3/9 ... in 210.3s` and nothing read it.
+`createDiarizeProgressParser` turns that into a fraction plus an ETA measured from the windows
+already done, chained AHEAD of the download parser so a re-acquiring backfill keeps its
+download progress. Short files take the non-windowed path, print no per-window line, and stay
+indeterminate on purpose.
+
+**Coordination note:** NO pause was needed this time and none was taken. The plan's instruction
+to pause the backfill assumed a `next dev` server that hot-reloads; the live editor is
+`next start`, which serves a compiled build and cannot pick up source edits at all. The
+backfill sweep ran throughout (`sweepEnabled: true`), untouched, and `settings.json` was read
+but never written.
+
+---
+
+
+**Previous session:** 2026-08-08 — **the OOM wall is gone, and it was removed rather
+than worked around.** Branch `feat/diarization-oom-wall`, four parts, all verified.
+
+**THE WALL: windowed diarization.** 6 of 10 videos over 6 hours were being killed by the
+kernel mid-run, ~40 minutes of CPU each, producing nothing. Two independent memory sinks,
+both now closed by the same change: `sherpa_onnx` clustering holds an O(n²) pairwise matrix
+over speech segments, and `subprocess.run(stdout=PIPE)` buffered the whole decoded stream.
+Long files are now processed in 45-minute windows (`--window-after-minutes 90`, `0` disables
+windowing) with per-window decode straight into a preallocated array. Cross-window identity
+is real, not hand-waved: each window's local speakers are reduced to an averaged, normalized
+`SpeakerEmbeddingExtractor` centroid and those are clustered globally with `FastClustering`
+at the same threshold. Both APIs verified live against the installed 1.13.4.
+
+| gate | result |
+| --- | --- |
+| (a) short file unchanged | **PASS** — `ObviousRises-rumble/v6z1o2g` re-ran byte-identical: 51 turns, 13 speakers, every non-volatile field equal, no `windowing` key |
+| (b) the file that OOM'd | **PASS** — `hasanabi/2834644359` (6h12m) completes: 3,433 turns, 96 speakers, 46 min, **peak RSS ~2.0 GB vs the 10.5 GB kernel kill** (`/proc/<pid>/status` VmHWM; GNU `time` is not installed) |
+| (c) quality | **PASS** — windowed vs whole-file on `v6z1o2g`: speech total **−0.1%**, identical wall-clock coverage, identity MORE concentrated (top-1 88.2% vs 73.1%, 6 speakers vs 13) rather than fragmented |
+
+**A REAL DEFECT WAS FOUND BY CHECKING, NOT BY READING.** The first seam merge joined only
+CONSECUTIVE turns in the sorted list, which silently leaves the same speaker overlapping
+THEMSELVES when two local speakers map to one global one — 35 self-overlaps and 24 sub-gap
+splits on the 6h12m file, which would double-count talk time in every downstream consumer.
+Now a per-speaker interval union; re-verified at 0 and 0. Cross-speaker overlap is left
+alone, because that is genuine overlapping speech the whole-file path emits too.
+
+**The cap shipped and is already switched off.** `settings.diarization.maxAudioHours` landed
+at 4h as the stopgap and now defaults to **0** — windowing removed the thing it was for. It
+stays as a knob for a smaller machine. Over-cap videos report as a new `deferred`
+`BackfillState`: a THIRD number, never summed into `reachableBackfillWork`, so a capped
+corpus can never read as finished. The dangerous line was `backfillBatch`'s candidate pull,
+which handled the states it knew and FELL THROUGH TO DISPATCHING everything else, with no
+exhaustiveness check anywhere in the repo. It is now a pure `candidateAction()` with a
+`never` default — a compile error instead of a silently-diarized six-hour video.
+
+**The detection bugs are fixed, and the fix is a shape, not a longer denylist.**
+`isRealAudioFile` / `isSourceMediaFile` / `isPartAudioFile` are anchored single-segment
+matches over `AUDIO_EXTS ∪ VIDEO_CONTAINER_EXTS`, in a new pure `common/lib/mediaFiles.ts`
+(`videoStatus.ts` re-exports, so no import site changed). An extension allowlist alone would
+NOT have been enough — this repo's own `audio.tmp-<pid>.<fmt>` carries a valid audio
+extension. Three more sites carried private copies of the old denylist and are folded in.
+Safety is provable: `audioFilesToRemove` is monotone in the predicate, so the delete set can
+only shrink.
+
+**THE MEDIA SCAN FOUND MORE THAN IT WAS WRITTEN FOR.** 953 media files across 68 channels in
+**83 seconds**, tier 1 only:
+- the known 4.0 GiB unreadable `nuxanor-kick/.../source-media.temp.mp4` (`moov atom not found`)
+- **3 zero-byte `audio.mp3`** in `leaflit-rumble` (`v6v9mq3`, `v6v9o25`, `v6v9r2r`) — these
+ read as "downloaded", so the pipeline never re-fetches them, and `v6v9r2r` has a real
+ `audio.aac` beside it that the mp3-first read preference would pass over. Newly visible.
+- **39 `transcript.m4a` in `community-notes`, 1.17 GiB** — audio under a name nothing in the
+ app recognizes (not audio, not a subtitle: `SUB_FILE_RE` needs two segments). Present but
+ invisible.
+- **7 duration mismatches** (up to 5h) awaiting the opt-in tier-2 decode.
+
+**STILL YOUR CALL, nothing done:** deleting anything the scan found; whether
+`community-notes`' 39 `transcript.m4a` files should be renamed into place (that is a WRITE to
+the corpus and it is not mine to make); and re-running the 4 previously-`failed` diarizations
+that were really `no-audio`.
+
+**One editor e2e spec is RED and it is NOT this branch's doing.**
+`auto-queue.spec.ts:208` ("strict priority") fails on a quiet box — and fails
+identically on `main` at `b6280a2`, checked by detaching to it and re-running. It is a
+race in the test, not in the app: `recordPick` fires at DISPATCH
+(`controller/autoRunner.ts:436`), so `picks.length === 4` means four videos were handed
+out, and the spec then asserts all four transcripts already exist on disk. Suite is
+449/451; the other red (`jobs-batch-tasks-drain.spec.ts:269`) passed on re-run and is a
+genuine flake.
+
+**Coordination note:** `settings.backfill.enabled` was set to false (the same field the Pause
+button writes) while `backfillKinds.ts` / `backfillBatch.ts` were edited, and restored after.
+A backfill job that was already running keeps the OLD code until it is stopped and started
+again — server modules hot-reload under `next dev`, but a job in flight holds its closure.
+---
diff --git a/plans/attach-dates.md b/plans/attach-dates.md
@@ -1,47 +0,0 @@
-# Attach dates — ISO dates in description.txt; `fillDates` (lane `lane/attach-dates`)
-
-Asked by the operator on 2026-10-22: the index logs "Skipping the-incredible-salt-mine/VcFA_LOnQoc: no
-upload_date" and "…/xLgf_MGQzXk: no upload_date" — "can we fix that?".
-
-## Findings
-
-- Both records were made by `attach-media` with `createRecords` from the local archive
- `…/v1-torrent/Uploads/YouTube.zip` (folders `064 - … - (VcFA_LOnQoc)` and `173 - … - (xLgf_MGQzXk)`).
-- Their description.txt reads `Published on 2019-10-31` and `Published on 2024-06-21`. `publishedDateFromText`
- read only `July 13th 2018` / `March 1, 2019`, so the record got no `upload_date`, while `descriptionFromText`
- still dropped the line.
-- They are the only two local-archive records in the corpus without an `upload_date` (counted 2026-10-22).
-
-## Rulings
-
-1. `publishedDateFromText` (common/lib/attachMediaPlan.ts) reads three spellings: `July 13th 2018`,
- `March 1, 2019`, and ISO `YYYY-MM-DD` / `YYYY/MM/DD` (one separator, used twice). A date that is not on the
- calendar (`2019-02-30`, `2019-13-01`, `February 30th 2019`) is no date, in every spelling.
-2. `attach-media` gains `fillDates` (`"fillDates": true` on `pnpm ops attach-media`, `--fill-dates` on
- `archilyzer media attach`). It dates a HELD record only when all three hold:
- - its `saved-video.json` origin kind is `"local-archive"` (attach-media made it);
- - its `metadata.info.json` has no `upload_date` (absent, null or empty);
- - its folder in the source has a description.txt that yields a real date.
-3. The date is merged by `patchMetadataInfo` (lib/metadataHistory-server.ts) — `upload_date` alone, appended at
- the tail, by `"local-archive"`, requested by `"attach-media"` — so `metadata.history.json` records it. Nothing
- else in the record is touched.
-4. A record that has a date, or whose pointer is not local-archive (a download's), is never touched. A candidate
- whose description.txt gives no date (or that has none) is listed as `undated` and left alone.
-5. The log has one `dated <id> ← upload_date <YYYYMMDD> (<description.txt path>)` line per record (an `undated`
- line per candidate without one); the `summary:` line carries `dated` (and `undated` when non-empty) only
- when `fillDates` was asked. `dryRun` lists the same and writes nothing.
-6. The fill runs before the attach work and alongside it: `fillDates` does not stop the run attaching what it
- would attach anyway, so a fill-only run is narrowed with `match` (or `items`).
-7. A job that dated something is not failed for "none attached"; the dated videos' pages are revalidated.
-
-## Backfill (the orchestrator, after merge)
-
-Dry run, then the run:
-
-```sh
-pnpm ops attach-media --json '{"slug":"the-incredible-salt-mine","source":"/run/media/user/09b598d2-b765-40bd-9466-06d8e16cb119/v1-torrent/Uploads/YouTube.zip","match":"\\((VcFA_LOnQoc|xLgf_MGQzXk)\\)","fillDates":true,"dryRun":true}' --wait
-pnpm ops attach-media --json '{"slug":"the-incredible-salt-mine","source":"/run/media/user/09b598d2-b765-40bd-9466-06d8e16cb119/v1-torrent/Uploads/YouTube.zip","match":"\\((VcFA_LOnQoc|xLgf_MGQzXk)\\)","fillDates":true}' --wait
-```
-
-Expected: both rows `already-attached`, `dated` 20191031 (VcFA_LOnQoc) and 20240621 (xLgf_MGQzXk), summary
-`"dated":["VcFA_LOnQoc","xLgf_MGQzXk"]`, `0 to attach`. Then the index build reads them.
diff --git a/plans/attribution-batch-hang.md b/plans/attribution-batch-hang.md
@@ -1,183 +0,0 @@
-# Root-cause the attribution batch hang
-
-## Context
-
-The de-flake job (2026-09-08, `a32612a`→`fea2996` on `one-core/phase-1`) fixed three of four
-e2e flakes. The fourth reproduces: `editor/e2e/attribution.spec.ts:349` "Run from the video
-page runs that video and no other" fails 1-2 in 10 under `--repeat-each 10`, waiting the full
-90 s for the batch's closing "1 done" line. It runs through `runOperationBatch`, the runner
-Phase 1.2 introduced, so a batch that never finishes after its unit's write is a candidate
-production bug and could surface on operator gate A. The operator chose to root-cause it
-before merge. Land on `one-core/phase-1` (same branch as the de-flake commits; cherry-picks
-to `main` cleanly).
-
-## What is known, and why it does not add up
-
-Recorded in `plans/STATE.md` ("The fourth REPRODUCED") from the earlier experiment:
-
-1. Server log on every failure ends on three lines: the "Backfill attribution-channel …"
- header, "Attribute attrvid0002: 120 cues → 1 chunk(s), text-only.", and the ollama
- timing line. The unit's closing "Attribute attrvid0002 (text-only): …" line never appears.
-2. The freshness pill reads "current", so `attribution.json` was written.
-3. `/api/pulse` answered with an unchanging `rev` for 90 s, so the job record never moved.
-
-The code says these three cannot all be true. `common/controller/attributeOne.ts:306-314`:
-`await writeAttribution(...)` then `log(...)` are adjacent statements; `log` is
-`opts.onLog` = `task.onLog` (`operationBatch.ts:1768`) → `taskHooks.ts:87-104` forwards first
-→ the job's `onLog` (`common/jobs/streamCommand.ts:311-315`) which is a synchronous
-`fileStream.write` + `safeEnqueue`. `writeAttribution` (`common/lib/attribution-server.ts:40-48`)
-is `writeFile(tmp)` + `rename`, no lock, no hook. So if (2) then the closing line reached the
-log FILE, even if the SSE stream was already closed (`safeStreamController.ts:28-41` drops
-silently after `cancel()` → `markClosed()`, `streamCommand.ts:289-295`). The two panel-side
-"reconcile against the file" attempts were reverted with "the file has no more than the
-panel" — that reading was taken when the stream ended, which under hypothesis 1 below is
-BEFORE the batch continues. At least one of (1)–(3) is a measurement artifact; the plan's
-first job is to find which.
-
-## Code path (verified 2026-09-08 at `fea2996`)
-
-1. Button: `editor/app/channels/[slug]/videos/[id]/components/SpeakerBodies.tsx:246-252` →
- `runOperationForVideoAction` (`operationActions.ts:26-56`: `kindIds:[op]`, `ids:[videoId]`).
-2. Client: `common/components/StreamActionLog.tsx:127-163` reads the stream until `done`,
- then `setRunning(false)` and `router.refresh()` (`:163`). The 1 s status poll (`:101-126`)
- runs only while `running`.
-3. Job: `common/controller/operationJobs.ts:78-152`, `runManagedFunction` on
- `BACKFILL_QUEUE`; the "N done" summary is `:128-146`, after `runOperationBatch` returns.
-4. Stream/registry: `common/jobs/streamCommand.ts:264-370`; finalize `:338-362` →
- `registry.finalize` (`common/jobs/registry.ts:202-218`).
-5. Batch: `common/controller/operationBatch.ts:1544`; `next()` `:1682-1710`; `runOne`
- `:1751-1785`; `runPool` call `:1799-1826` with `limit()` `:1801-1824`, `finite: true`.
-6. Pool: `common/jobs/concurrentRunner.ts:82-133`. If `limit()` reads 0 when the last unit
- settles, `:92-93` waits forever and the finite-exhaustion break (`:104-108`) is
- unreachable. Every 0 from `backfillLaneLimit` (`operationBatch.ts:313-410`) carries a
- `hold` whose message is logged edge-triggered at `:1806-1812` — a line the failures
- do NOT show, which argues against this path unless that log was also lost.
-7. Unit: `runOperationUnit` `:947-1058` → `executeUnit` `:1066-1110` (`acquireLlmSlot`
- `:1086`, `op.run` `:1090`, release in `finally` `:1106-1110`) → `attributeOne.ts:124`;
- engine call `common/lib/digestApps.ts:168-270` (`await res.json()` at `:220` precedes the
- timing log at `:255`, so the body is drained; stub `editor/e2e/fixtures/ollama-stub.mjs:204-221`).
-8. Pulse: `editor/app/api/pulse/route.ts:65-118` folds `id:status:startedAt:endedAt:
- draining:progress:tasks.length` per job off `globalThis.__yttJobRegistry__`.
-
-## Hypotheses, ranked, each with the observation that decides it
-
-| # | Hypothesis | Blocking point | Decided by |
-|---|---|---|---|
-| H1 | The SSE stream is torn down early (RSC/action teardown from a pulse-driven `router.refresh()`); the batch finishes normally but the panel froze, so the test's 90 s wait on the panel text never sees "1 done". Pill reads "current" because `router.refresh()` at `:163` re-rendered. (3) was misread. | none in the server | server-side: closing line + summary present in the job log FILE with timestamps after the client's `cancel()`; `record.status` becomes `done` |
-| H2 | `limit()` returned 0 at the wake after the unit settled; `runPool` idle-waits forever. | `concurrentRunner.ts:93` | per-wait trace shows `target=0, inFlight=0, drain=false`; hold line at `operationBatch.ts:1806` in the file |
-| H3 | The unit promise never settles after `op.run` returns (LLM slot release, `task.end()`, `reportProgress`). | `operationBatch.ts:1106-1110` or `:1779-1783` | `runOne`'s `finally` timestamp missing while `attributeOne.ts:314` timestamp present |
-| H4 | Finalize skipped or registry global replaced, so pulse folds a stale/empty list while the batch is actually done. | `streamCommand.ts:338-362`, `invalidate-cache` route | `/api/jobs/<id>/log` status after the failure: `done` vs `running` |
-| H5 | A late abort (previous test's `cancelLiveJobs`) fired `opts.signal`, `runPool` broke without the summary. | `runPool` exit | `signal.aborted === true` at pool exit |
-
-## Step 1 — Instrumented reproduction (worktree only, never committed)
-
-Worktree of `fea2996` per `plans/FACTS.md` (composed fixture site copied into
-`export/public`; add-by-path rule irrelevant since nothing is committed from it). Set
-`stdout: "pipe"`/`stderr: "pipe"` on the editor webServer in the worktree's
-`editor/playwright.config.ts`. All instrumentation goes to `console.error` with an ISO
-timestamp and the job id, never through the job's `onLog` (which is part of what is under
-test):
-
-- `common/controller/attributeOne.ts:306` and `:315` — before `writeAttribution`, after the
- closing `log` call.
-- `common/jobs/streamCommand.ts:311` — per `onLog`: line counter, `safe.isClosed()`,
- first 60 chars. `:289` — the `cancel()` with timestamp. `:338/:351/:362` — which settle
- branch ran and `record.status`.
-- `common/jobs/concurrentRunner.ts:88-93` — per wait iteration: `target`, `inFlight.size`,
- `drainSignal.aborted`, `signal.aborted`, `finite`.
-- `common/controller/operationBatch.ts:1783` (unit `finally`) and `:1826` (after `runPool`).
-- `editor/e2e/attribution.spec.ts:349` — on failure only (wrap the "1 done" expect in
- try/catch, rethrow): fetch `/api/jobs/<id>/log` (job id from the panel's `data-*` or the
- status poll URL, see `StreamActionLog.tsx:101-126`) and `/api/pulse`, print status, line
- count and the last five lines to the test output; then rethrow.
-
-Run: `node ../scripts/queue-lock.mjs --ports PORT:3011,EXPORT_PORT:3010,OLLAMA_STUB_PORT:11435
--- pnpm exec playwright test attribution.spec.ts --repeat-each 15` from the worktree's
-`editor/`, detached, watched with Monitor. Expected 1-3 failures. Collect, for each failure,
-the ordered stderr trace for that job id and the test's failure dump, and decide H1–H5 by
-the table. If 15/15 pass, run once more with `--repeat-each 25`; if still clean, the
-instrumentation changed the timing — drop the `concurrentRunner` trace (the noisiest) and
-re-run 15. Stop after three attempts and record "unreproduced under instrumentation" with
-the run log paths.
-
-## Step 2 — Fix at the cause (one commit, with a test that fails before it)
-
-Exactly one of these, chosen by Step 1; do not ship a fix for a hypothesis the trace killed.
-
-- **H1 (test/UI-side):** the product is correct (the batch finished, disk is right), the
- panel is not: after the stream ends `StreamActionLog` must show the job's terminal state.
- Fix in `common/components/StreamActionLog.tsx:141-163`: when `reader.read()` returns
- `done` and the job is not terminal per the status poll, keep polling `/api/jobs/<id>/log`
- until it is, and render its tail (the file has every line, `streamCommand.ts:311`). Test:
- a unit test for the reconcile (or an e2e route mock that cancels the stream early) that
- fails at `fea2996`. Also fix the trigger if it is ours: if the teardown comes from the
- pulse-driven refresh re-rendering the panel, gate that refresh while a run is streaming.
- (The de-flake implementer tried two reconcile variants and measured no change — but its
- measurement read the file at stream end, before the batch continued. A reconcile that
- keeps polling until terminal is a different fix; verify against the trace, not the memo.)
-- **H2:** find why `backfillLaneLimit` (or `isGateHeld`) reads 0 after the unit — the trace
- says which term. Fix that term (e.g. a settings read racing the test's `writeSettings`, or
- `transcriptionActivity()` seeing a stale worker). Do NOT change `runPool`'s hold
- semantics ("a zero limit is a hold, never a stop", `operationBatch.ts:22-25`). Add a
- `concurrentRunner.test.ts` case only if the runner itself is at fault.
-- **H3:** the pending await in `executeUnit`'s `finally` or `runOne`; fix and add a unit test
- in `common/controller/` that runs a unit whose engine call resolves and asserts the pool
- exits.
-- **H4:** make finalize unconditional (`streamCommand.ts:338-362`, a throwing `onLog` in
- `.catch` must not skip `registry.finalize`) or stop `invalidate-cache` from replacing the
- global registry under a live job. Unit test in `common/jobs/`.
-- **H5:** `resetData` ordering / `cancelLiveJobs` aborting a record the next test owns;
- fix in `editor/app/api/test/invalidate-cache/route.ts` or `editor/e2e/helpers.ts`.
-
-Remove every instrumentation line before committing; `git diff fea2996 --stat` in the
-primary checkout must list only the fix, its test, and the plan records.
-
-## Step 3 — Records
-
-- `plans/STATE.md`: replace "The fourth REPRODUCED, is NOT fixed" with what it was, the
- discriminating trace excerpt (≤ 8 lines), and the fix sha. If the earlier claim "the log
- file has no more than the panel" was the artifact, say so, so nobody trusts it again.
-- `plans/deflake-e2e.md`: a "### 4, as shipped" section with the same.
-- `plans/FACTS.md` one-core Phase 1 section: one paragraph on the runner/stream fact
- learned (whichever hypothesis held), file:line pinned to the fix sha.
-
-## Not in scope
-
-- Any change to lane hold semantics, `retries`, `test.slow`, or serial markers.
-- The homepage theme test's early read (`homepage/e2e/theme.spec.ts:47`), noted in the
- de-flake review as a weakened assertion, not a flake.
-- Phase 2 of one-core.
-
-## Verification
-
-- `tsc --noEmit` in common, export, editor; `pnpm --filter yt-dlp-transcript-common test`
- (the new test fails at `fea2996`, passes at the fix — show both runs).
-- `attribution.spec.ts --repeat-each 20` from a worktree at the fix sha, no instrumentation:
- 20/20 (baseline was 1-2 failures per 10, so 20 clean runs is the bar, not 10).
-- Full editor e2e from the worktree at the final sha, detached, Monitor-watched: 515/515.
-- Commit shape: (1) the fix + its test, message carrying the trace excerpt and the 20/20;
- (2) `plans:` records. Trailers as on the de-flake commits. Never `git add -A`
- (`editor/content` symlink).
-
-## Execution
-
-Per the standing cadence: one Opus general-purpose implementer with the fish/`commit -F`,
-no-boot-against-`transcripts/`, detached-e2e and DO-NOT-POLL (Monitor) instructions;
-report contract = commit shas, exact gate outputs, the decisive trace lines, which
-hypothesis held and which were killed, every divergence. A second Opus agent reviews the
-diff before the final full e2e.
-
-## Outcome (2026-09-08, `fae99f1`)
-
-The cause was none of H1–H5 but a sixth mechanism outside the table: the job finished normally
-in 65 ms with every line written and `done` recorded, and React then UNMOUNTED the log panel —
-`SpeakerBodies.tsx`'s two branches put the unkeyed `<RunOne>` at different child indices, so
-the record landing (on the `router.refresh()` `StreamActionLog` fires itself) hit a positional
-type mismatch and destroyed `StreamActionLog`'s state, `<pre role="log">` and all. H1's
-disposition held (server innocent, failure client-side) but its mechanism did not, and the
-log-file-polling fix prescribed for it was NOT shipped and would not have worked.
-
-Fixed by giving both bodies one two-child list with `RunOne` last and keyed; the spec now
-asserts the log still reads "1 done" after the freshness pill reads "current" (red 5/5 at
-`fea2996`, `--repeat-each 20` green at the fix). Full record, trace and the durable rule:
-[`deflake-e2e.md`](deflake-e2e.md)'s "### 4, as shipped" and `FACTS.md`.
diff --git a/plans/backfill-reacquire-subtitle-channels.md b/plans/backfill-reacquire-subtitle-channels.md
@@ -1,306 +0,0 @@
-# Backfill re-acquire on subtitle channels — fetch audio, and keep the cues fresh
-
-## Context
-
-**Every fact here was verified read-only against the tree at `9ffa437` (clean) and the real
-corpus on 2026-08-26/27.** Corpus-wide digest `deferred` is 16,156. A census with the real
-`isCuesJsonFresh` over all 78,128 transcribed video dirs: **16,081 `stale`** (cues.json older
-than a rewritten `metadata.info.json`; in 7,849 of those a re-fetched VTT too), 75 `missing`,
-1 `no-meta`. The stale ones sit on eight `handling: "youtube"` channels, written in contiguous
-serial blocks 08-22 → 08-26 (the-quartering 3,762, nux-taku 1,802, quartering-live 805,
-destiny 3,869, leaflit 1,612, kirsche 1,197, HasanAbiVODs3 348, chibi-reviews 2,699), each
-dir's `download-outcome.json` recording a `metadata-prefetch` + `primary` attempt with
-`handling: "youtube"`.
-
-**The mechanism** (`settings.json`: `backfill.reach: corpus`, `order: newest`,
-`allowRedownload: true`, diarization enabled): the sweep walked those channels; every video on
-a subtitle-downloading channel is diarization **`missing-input`** (no audio, by design of that
-handling — `operations.ts:679`); `allowRedownload` turns that into `dispatch`
-(`backfillBatch.ts:194-196`); `reacquireMediaFor` then calls `downloadOneManaged` with the
-channel's **unmodified** config (`backfillReacquire.ts:116-133`) — there is no `handling`
-check anywhere in that file — so yt-dlp ran `--skip-download --write-subs --write-auto-subs`,
-rewrote metadata (+ VTT when YouTube served one), landed no audio, "nothing usable landed",
-next video, ~12/min. ~16k wasted fetches (with firefox cookies), zero diarizations, and every
-touched video now reads `deferred` to the digest lane and `no-transcript` → `skipped` to
-attribution (`attributeOne.ts:139`, `operations.ts:983`), because both gate on cues freshness.
-
-**Two defects, and the fix needs both:**
-
-1. **Re-acquire on a subtitle channel can never yield audio with the channel's own config.**
- The precedent for the fix is already in the tree: `autoRunner.ts:996-1010` forces
- `{ ...rawConfig, handling: "transcribe" }` for one video so a youtube-handling channel
- downloads audio, "the channel's stored config untouched"; `downloadOneManaged`'s own
- no-subs fallback (`:932-950`) does the same thing under the same name. This is also the
- operator's stated model: no channel is truly subs-only — when subs are not what's needed,
- fall back to audio.
-2. **Every re-acquire rewrites `metadata.info.json`** — the metadata prefetch
- (`downloadOneManaged.ts:517-548`) runs before any attempt, and the transcribe download
- needs that info json (`reuseInfoJson`). So even a *correct* re-acquire leaves
- `transcript.cues.json` stale by mtime (`normalizeTranscript.ts:243`), which makes the
- very next lane in the same sweep (`attribution-diarized`) skip the video with
- `no-transcript`, and the digest lane defer it, until an operator runs Normalize. The
- precedent for the fix is `transcribeOne.ts:236-243`: normalize right after the thing that
- changed the inputs. It is cheap (returns `fresh` when nothing moved), and it invalidates no
- digest — `isSectionFresh` (`digest.ts:513-534`) is provenance-keyed (app/model/prompt/
- contextHash), not cues-mtime.
-
-**Content is still correct:** 230 of 240 sampled re-fetched VTTs parse to byte-identical
-cues (the 10 differ by a few cues of YouTube ASR drift); the 8,231 metadata-only cases never
-touched the transcript. So the 16,081 are an mtime false positive that one Normalize pass
-clears — an operator action, not this slice's.
-
-**Not running now:** `sweepEnabled: false`, no editor process; the newest outcome files are
-ordinary sync. **If re-armed unfixed:** 66,540 youtube-handling videos are diarization
-`missingInput` corpus-wide (chrissie-mayr 3,514, nuxanor 3,211, rev-says-desu 2,770 next in
-`newest` order, plus ~7,500 unvisited on the-quartering).
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/backfill-reacquire-subtitle-channels.md` and commit it
-alone: `plans: backfill re-acquire on subtitle channels planned`. (Tree is clean at
-`9ffa437`; nothing else goes in.)
-
-## Order: three commits
-
-1. **The fix** — `reacquireMediaFor` forces transcribe handling and re-normalizes after the
- fetch; diarization's `state()` reads the duration cap before dispatching a download.
- Units for each.
-2. **The e2e and the wording** — a backfill spec on a youtube-handling channel; the four
- places whose prose says "re-acquire" without saying "audio".
-3. **Docs** — FACTS, STATE (correct the wrong framing in place), CHANGELOG, memory.
-
-tsc in all six packages + `pnpm -C common test` + editor units after each. e2e once after
-commit 2, **detached** (memory `e2e-run-detached`; the queue lock is serial and a Bash call
-caps at 10 min): `setsid nohup … pnpm e2e -- backfill.spec.ts auto-subs-replace.spec.ts`.
-Edit nothing while it runs. If port 3011 is held by another session's server, run on an
-offset block (`PORT=3111 EXPORT_PORT=3110 OLLAMA_STUB_PORT=11535`) — do not kill it.
-
-## Commit 1 — the fix
-
-### `common/controller/backfillReacquire.ts`
-
-- Add a **pure, exported** helper, and use it for the config passed to *both*
- `findVideoSourceUrl` (`:96`) and `downloadOneManaged` (`:118`), the way autoRunner passes
- the overridden config to both:
-
- ```ts
- // A backfill wants AUDIO. A `handling: "youtube"` channel's own download is
- // --skip-download --write-subs --write-auto-subs: it would re-fetch the captions
- // the video already has and land nothing a diarizer can read — which is exactly
- // what happened to ~16,000 videos on eight channels, 2026-08-22 → 08-26. Same
- // override, same reason, as autoRunner's replaceAutoSubs unit and
- // downloadOneManaged's own no-subs fallback: transcribe-handling for this one
- // video, the channel's stored config untouched.
- export function reacquireConfigFor(config: ChannelConfig): ChannelConfig {
- return config.handling === "transcribe"
- ? config
- : { ...config, handling: "transcribe" };
- }
- ```
-
- Log the override once per video when it applies (`Re-acquiring media for <id> — subtitle
- channel, downloading audio (handling override: transcribe)`), so a run log says what it
- did. `resolveCookiePolicy(settings, config)` is unaffected either way (it reads cookie
- fields only) — pass it the same overridden config for consistency.
-- After `downloadOneManaged` has run — **whether it returned or threw** (the prefetch wrote
- metadata before any failure; that is the 16,081) — re-normalize:
-
- ```ts
- // The fetch rewrote metadata.info.json, which the cues embed and which
- // isCuesJsonFresh compares against. Without this the very next lane in the
- // same sweep (attribution) skips the video as no-transcript and the digest
- // lane defers it, until an operator runs Normalize. Same step transcribeOne
- // takes after a transcription, for the same reason. Cheap: `fresh` when
- // nothing moved. Digest freshness is provenance-keyed, so this invalidates
- // nothing.
- ```
-
- Implement as a small non-exported `refreshCues(videoDir, channelSlug, config, videoId,
- log)` that calls `normalizeTranscript({ videoDir, channelSlug, configName: config.name,
- log })` (the shape `archiveTranscripts.ts:191` uses), logs `wrote` at info and any throw
- as a warning (never rethrow — this runs on the failure path too). Call it right after the
- `try/catch` around the download, before the "nothing usable landed" check. It is not part of
- `cleanup()`: cues.json is a record, not media, and `buildCleanup` deliberately never touches
- non-media files (`:158-165`).
-- Header comment (`:1-29`): add the fifth guard — "AUDIO, NOT THE CHANNEL'S DEFAULT" — with
- the 2026-08-22→26 measurement, and a line for the re-normalize. Reword the `:129-130`
- comment ("Audio now, container discarded") to note the handling override is what makes
- there be audio to extract on a subtitle channel.
-
-### `common/lib/operations.ts` — the cap before the download
-
-`state()` for diarization (`:679-689`) returns `missing-input` *before* it reads the duration
-cap, deliberately (the cap read parses metadata and `countBackfillWork` runs `state()` per
-video). But with `allowRedownload` armed, `missing-input` dispatches a *download*, and
-`diarizeOneVideo` does not enforce the cap itself — so a 10-hour VOD over the cap would be
-fetched and diarized. One metadata read is nothing next to a download:
-
-```ts
-if (!(await hasDiarizableInput(videoDir, files))) {
- // Read the cap here ONLY when this branch can dispatch a download: with
- // re-download armed, missing-input is a fetch, and diarizeOneVideo does not
- // enforce the cap. Otherwise stay cheap — this runs per video per job start.
- if (
- settings.backfill.allowRedownload &&
- (await isOverDiarizationCap(videoDir, settings.diarization))
- ) {
- return "deferred";
- }
- return "missing-input";
-}
-```
-
-On this corpus `maxAudioHours` is 0 (cap off), so no count moves today; say so in the commit
-body. Update the `:680-689` comment, which currently says the cap is read "ONLY here" in the
-would-be-`missing` branch.
-
-### Tests (commit 1)
-
-- New `common/controller/backfillReacquire.test.ts` (the file has none; `backfillBatch.test.ts`
- tests only pure functions and the repo does not module-mock — keep to the pure surface):
- `reacquireConfigFor` returns the same object for transcribe handling; returns a copy with
- `handling: "transcribe"` and every other field intact (`audioFormat`, `name`, `platform`,
- `cookies…`) for youtube handling; never mutates its input.
-- For the re-normalize, a tmp-dir test in the same file **if** `normalizeTranscript` can be
- driven on a synthetic dir the way `normalizeAll.test.ts` does (check its fixture shape
- first): write `metadata.info.json` + `transcript.en.vtt` + an older `transcript.cues.json`,
- bump the metadata mtime, call `refreshCues` (export it for the test, or test through
- `normalizeTranscript` directly if exporting is churn), assert `isCuesJsonFresh` is true
- after. If `normalizeAll.test.ts` shows this needs more scaffolding than a dozen lines,
- drop it and rely on the e2e in commit 2, and say so in the report.
-- `common/lib/operations.test.ts`: diarization `state()` on a transcribed video with no
- audio → `missing-input` with the cap set but `allowRedownload` off; → `deferred` with both
- set and `duration` over the cap; → `missing-input` with both set and duration under the cap
- or absent. Find the existing diarization `state()` cases in that file and follow their
- fixture shape (`files`, `settings`, a tmp `videoDir` with `metadata.info.json`).
-
-Commit message: `backfill: re-acquire fetches audio on a subtitle channel and keeps the cues
-fresh`. Body: the mechanism, the census numbers (16,081 stale / eight channels / dates), the
-two precedents, the cap guard and that it moves nothing at `maxAudioHours: 0`.
-
-## Commit 2 — the e2e and the wording
-
-### `editor/e2e/backfill.spec.ts` — a new numbered case after (10)
-
-"(11) THE RE-DOWNLOAD ON A SUBTITLE CHANNEL: audio, not captions." Seed a
-`handling: "youtube"` channel the way `auto-subs-replace.spec.ts` `seedChannel` (`:83-130`)
-does — `config.json` with `handling: "youtube"`, `audioFormat: "mp3"`, a `playlist` line per
-id, per video `metadata.info.json` (with `automatic_captions`) + `transcript.en.vtt` and **no
-audio** — copy the helper locally rather than importing across specs unless `helpers.ts`
-already has one. Also write a `transcript.cues.json` older than the metadata, or simply omit
-it (either way the assertion below holds). Then, with
-`backfillSettings({ backfill: { allowRedownload: true } })`, open the channel's speakers stage
-and click "Run speaker work" as cases (4)/(5) do. Assert:
-
-- `diarization.json` lands (the fake yt-dlp writes `audio.mp3` for a transcribe-handling
- invocation — `fixtures/bin/fake-ytdlp.mjs:167-198`, the same path auto-subs-replace relies
- on at its `:203`);
-- the audio does not survive (`audioFiles(id)` → `[]`), as in case (4);
-- `transcript.en.vtt` is byte-identical to what was seeded (no subtitle re-fetch);
-- `download-outcome.json`'s last attempt has `handling: "transcribe"`;
-- `transcript.cues.json` exists and its mtime ≥ `metadata.info.json`'s — the property the
- 16,081 lost.
-
-If the fake yt-dlp's prefetch branch (`:621+`) needs the youtube URL shape to write metadata
-for a transcribe-handling invocation, check auto-subs-replace's fixture ids first; it already
-exercises exactly this override end to end.
-
-### Wording — four places that say "re-acquire" without saying "audio"
-
-- `common/lib/settings.ts:325-331` (`allowRedownload` doc comment): add that on a
- `handling: "youtube"` channel this downloads **audio** with a per-video transcribe
- override — the channel's config is not changed.
-- `editor/app/operations/components/settings/LaneSettingsForm.tsx:96-112` (the checkbox
- hint): one sentence, same content, operator-facing.
-- `editor/app/channels/[slug]/components/stages/SpeakersStage.tsx:165-167`: "re-download is
- on, so this run will fetch **audio** and then delete it …".
-- `common/lib/operations.ts:178-186` ("backfillReacquire answers it by fetching AUDIO") is
- now true; leave it, but the `:786-790` sentence ("What it needs re-acquiring media for is
- already controller/backfillReacquire.ts") can stay as is.
-
-Commit message: `backfill: the subtitle-channel re-acquire is pinned end to end`.
-
-## Commit 3 — docs and memory
-
-- `plans/FACTS.md` — new dated section "Verified 2026-08-27 — why `deferred` was 16,156":
- the census (16,081 stale / 75 missing / 1 no-meta; 8,231 meta-only vs 7,849 meta+VTT;
- dates; eight channels with counts; per-channel redownloads ≈ deferred ≈ a slice of
- `missingInput`), the mechanism with the file:line trail, the content check (230/240),
- `isSectionFresh` being provenance-keyed (why normalize is safe), the 66,540 exposure, and
- the two precedents for the override.
-- `plans/STATE.md` — **correct the finding in place, dated**: the "Recommended next" #2
- (`:152-160`) and the "THE FINDING TO ACT ON" paragraph (`:211-218`) both frame it as
- accumulation-vs-regression; it is neither. Replace with: cause found, fix shipped (shas),
- and the operator runbook below. Keep "GPU yield on a quiet box" as #1.
-- `editor/CHANGELOG.md` [Unreleased]: re-acquiring media for the speaker lane on a
- subtitle-downloading channel now downloads audio (per-video transcribe override, channel
- config unchanged) instead of re-fetching captions; a re-acquire re-normalizes the transcript
- so the digest and attribution lanes do not defer the video; a video over the diarization
- duration cap is deferred before any download is spent on it.
-- Memory: update `slice-3-chosen-next.md` ("CAUSE FOUND" paragraph → fixed, shas); index
- line to match.
-
-Commit message: `plans: the deferred cause is fixed and recorded`.
-
-## Operator runbook (for STATE.md — not the agent's work, and NOT run from this slice)
-
-1. Keep `sweepEnabled: false` until commit 1 is on the running editor. (It is off now.)
-2. **Clear the 16,081**: Digest stage card → *Normalize transcripts* on the-quartering,
- destiny, chibi-reviews, nux-taku, leaflit, kirsche, quartering-live, HasanAbiVODs3 (and
- shondo-vods, 22). Pure re-parse, no network; identical cues in 230/240 sampled cases;
- digests are not invalidated. Expect corpus `deferred` → ~76 (the `missing`/`no-meta`
- tail — the same button on their channels clears those; the census script lists them).
-3. **Re-affirm `allowRedownload` knowing what it now does.** With the fix, the sweep will
- *really* fetch audio for the 66,540 youtube-handling `missingInput` videos in `newest`
- order across the corpus (sleep 30 s between downloads → ≥ 23 days of network before any
- diarization time), and delete each file after use. Scope it with `sweepChannels`, or turn
- the flag off, before arming — that is the policy decision, and it is yours.
-4. **A known interaction, flagged not fixed:** `autoQueue.transcription` is enabled with
- `replaceAutoSubs: true`, and it picks from snapshots that regenerate ~1 s after a download
- finishes. A re-acquired `audio.mp3` on an ASR-only video is exactly what it looks for, so
- during a long diarization it may start whisper over the auto-captions; the backfill's
- `finally` then deletes the audio under it (a failed unit, nothing lost) — or whisper wins
- first and the video gets a better transcript. Worth deciding whether that is wanted before
- a corpus-wide run.
-
-## Verification
-
-1. After each code commit: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export
- homepage umtool mcp`; `pnpm -C common test` (827 → +N new); editor units
- `pnpm -C editor exec tsx --test "app/**/*.test.ts"` (85 → ±0).
-2. Grep gates after commit 2: `grep -n "handling" common/controller/backfillReacquire.ts`
- shows the override; `grep -rn "reacquireConfigFor" common editor/app` → definition, two
- call sites, tests.
-3. e2e as above, detached, once: `backfill.spec.ts` (all cases, including the new (11)) and
- `auto-subs-replace.spec.ts` (the override's precedent must still pass).
-4. **Read-only corpus check, no editor boot** (AGENTS.md): nothing in this slice writes under
- `transcripts/`; the only corpus figure to re-state is the one already measured. Do not
- re-run the census; do not run Normalize.
-5. Manual, on the e2e fixture (`PORT=3021 pnpm dev:test`): the speakers stage on a
- youtube-handling channel with re-download on says it will fetch audio; kill the server,
- remove `editor/test-transcripts` and `editor/test-settings.json`, `git status` clean.
-
-## Out of scope
-
-- Running Normalize over the eight channels (operator button, runbook step 2).
-- Any change to `isCuesJsonFresh` — a metadata rewrite *is* staleness (the cues embed the
- summary); the fix is to re-normalize at the one place that rewrites metadata under a
- transcript, not to loosen the gate.
-- The auto-transcribe interaction (runbook step 4).
-- Scoping/throttling the corpus-wide re-download (runbook step 3). A per-channel
- "re-acquirable" flag or a third handling value — the binary `handling` is a deliberate
- invariant (`channelConfig.ts:11-13`).
-- The `deferred` count for `attribution-*` lanes on those videos: it resolves with the
- normalize pass; nothing to build.
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`). It spawns one
-`general-purpose` agent, `model: "opus"`, with: the plan path (after step 0, which the agent
-commits), the fish-shell caveat (commit via `git commit -F <file under $CLAUDE_JOB_DIR/tmp>`;
-quote `[slug]` paths; `cd` persists), never boot against `transcripts/`, e2e detached, tmp
-files under `$CLAUDE_JOB_DIR/tmp`, and the report contract: commit shas with one line each;
-exact tsc/test outputs; e2e pass/fail per spec with any retry; every divergence from the plan
-and why; anything undone. Fable reviews on return (`git log --oneline 9ffa437..`, the hunks in
-`backfillReacquire.ts`, `operations.ts` and the new spec; re-runs grep gates + `pnpm -C common
-test` + editor units, not e2e), sends fixes to the same agent via SendMessage, and reports.
diff --git a/plans/brand-and-themes.md b/plans/brand-and-themes.md
@@ -3,7 +3,7 @@
Status: SHIPPED to main 2026-09-25 (S0 `7c9e3bdf`, S1 `575ae1d4`, S2 `b9772e53`, S3 `85cf6e81` + its
`plans:` records), not rolled out. Worked on `brand/found-line` (worktree `../brand-found-line`,
pnpm wt block #1), with S1 and S2 as `brand/mark` and `brand/themes` off S0's tip. The release is
-[`release-10.md`](release-10.md); the operator's runbook is `~/reports/release-10/RUNBOOK.html`.
+[`release-10.md`](archive/releases.md); the operator's runbook is `~/reports/release-10/RUNBOOK.html`.
S4 (Archilyzer Media, the YouTube channel) was built after the release-10 cut on `brand/media`
(worktree `../brand-media`, block #3) and is not part of the site rollout; see "Slice S4, as shipped".
@@ -778,7 +778,7 @@ The hex-only `parseAccent` fallback, which S0 flagged at `:19`, is gone.
`pickFamily`, right after `page.reload({waitUntil:"commit"})` + `themeReady`. The shot shows
Selenized applied and the menu closed: the click landed before hydration. `themeReady` is set by
the pre-paint script, not by React.
- - It is the same reload timing `plans/deflake-e2e.md` §2 fixed for the read, which still races the
+ - It is the same reload timing `plans/archive/acquisition-and-pipeline.md` (entry `deflake-e2e.md`) §2 fixed for the read, which still races the
click after it.
- S1 touches no theme code.
- S2 deletes this spec.
@@ -1251,7 +1251,7 @@ must-fix and should-fix were in the runbook). `main` was fast-forwarded to `5a43
The runbook is `~/reports/release-10/RUNBOOK.html` (generated by `make-runbook.py` beside it, which
also writes the rollout scripts to `scripts/`); the release record is
-[`release-10.md`](release-10.md). The commands below were checked against the repo (S3).
+[`release-10.md`](archive/releases.md). The commands below were checked against the repo (S3).
0. Cut `export/CHANGELOG.md`'s `[Unreleased]`: it is rendered on every site's public `/changelog`.
`/sites` → Release notes → Cut release; untick "Commit changelog" while the primary has untracked
@@ -1585,5 +1585,5 @@ release 11 O5).
the one umtool app line is a `neededBy` label no spec reads.
**Merged** to `main` 2026-09-26 as `dcb04f61` (S4, then L2, then L1), and gated with L1 and L2 on the
-merged tree: [`release-10.md`](release-10.md), "Integration (S4 + L1 + L2), as merged". Its rollout step
+merged tree: [`release-10.md`](archive/releases.md), "Integration (S4 + L1 + L2), as merged". Its rollout step
is the optional umtool rebuild (`~/reports/release-10/scripts/r10-umtool.sh`).
diff --git a/plans/cut-release-cli.md b/plans/cut-release-cli.md
@@ -1,88 +0,0 @@
-# Cut a release from the CLI (release 10 slice P)
-
-Written 2026-09-26 (night). Operator: "Are you able to cut releases with the CLI ops? add that ability
-if not." Answer today: NO. The only cutter is the `/sites` page's "Release notes" form
-(`editor/app/sites/components/CutReleaseForm.tsx` → `editor/app/sites/lib/cutReleaseAction.ts`), and
-the runbook's step 0 ("re-cut the release notes first") is a click. Anchors verified on `main` 5f577437.
-
-## What exists (verified)
-
-- `common/lib/changelog.ts`: `cutRelease(source, version, dateISO)` (:58-88; semver + date checks,
- `## [Unreleased]` → `## [<v>] - <date>`, refuses when nothing is pending), `getLatestReleasedVersion`
- (:26), `suggestNextVersion` (:31), `extractUnreleasedSection` (:40), `CutReleaseError`.
-- `cutReleaseAction.ts` (the server action, "use server"): form fields `workspace` (editor|export),
- `version`, `commit`; the dirty-tree guard (`listDirtyPaths`, `common/lib/git.ts:24` — refuses to
- commit when anything but the changelog is dirty), `readFile` → `cutRelease(…, todayISO())` →
- `writeFileAtomic` → optional `commitPath(root, relPath, "Release <workspace> <version>")`
- (`git.ts:36`), then `revalidatePath("/")`, `/changelog`, `/sites`. Paths:
- `getPaths().editorChangelogFile` / `.exportChangelogFile`, `monorepoRoot`. Returns
- `{ok:true, version, committed} | {ok:false, error}`. Version strings in `package.json` are never
- bumped (all 0.1.0) — the changelog heading IS the version; there are no git tags (0).
-- Release commits so far are one-line heading edits: `0e0d8f59 Release editor 0.9.0`,
- `31798769 Release export 0.9.0`.
-- Two CLIs: `pnpm ops` (`scripts/archilyzer-ops.mjs`, plain node, HTTP-only: `ACTIONS` :88-110 →
- `POST /api/ops/<action>` with `Bearer WORKER_TOKEN`, usage :277; tests `archilyzer-ops.test.mjs`
- :15-45 pin "an action becomes a POST to its route" and the refused-unknown-action list) and
- `archilyzer` (`common/bin/archilyzer.ts`, a table of local tsx verbs over `_cli.ts`; tests
- `_cli.test.ts`; e.g. `index`, `compose:site`, `sync tick`, `settings-example`).
-- Ops API routes: `editor/app/api/ops/<action>/route.ts` on `ops(request, allowedKeys, handler)`
- from `_lib.ts` (worker-token auth, JSON body, `OpsInputError` → 400, `optString/optBool/reqSlug`,
- `actionResponse`); `refresh-report/route.ts` is the model for a synchronous (non-job) action.
-- e2e: `editor/e2e/cut-release.spec.ts` (:53, :74, :95) drives the form against the fixture's
- changelog copies. Ops routes' e2e precedent: grep `api/ops` in `editor/e2e/*.spec.ts`.
-
-## Decisions (made)
-
-1. **One writer.** New `common/controller/cutRelease.ts`: `cutReleaseForWorkspace({workspace,
- version, commit, date?})` = the body of `cutReleaseAction` verbatim (guard, read, cut, atomic
- write, commit), returning `{ok:true, workspace, version, committed, commitSha?, heading} |
- {ok:false, workspace, error}`. `version: "next"` resolves through
- `suggestNextVersion(getLatestReleasedVersion(source))` (patch bump) — `"next-minor"` bumps the
- minor. `cutReleaseAction` becomes a thin FormData adapter over it (keeps `revalidatePath`; the
- form's fields, labels and `cut-release.spec.ts` unchanged). `workspace: "all"` (CLI/API only) =
- editor then export with the SAME version, two commits in today's message form; stops at the first
- failure and reports what was done.
-2. **Local verb, the primary path**: `archilyzer release cut <editor|export|all> <version|next|next-minor>
- [--commit] [--date YYYY-MM-DD]` in the `archilyzer.ts` table; prints one line per workspace
- (`editor: ## [0.10.0] - 2026-09-26 (committed 1a2b3c4d)`), exit 1 on any failure. Plus
- `archilyzer release show [editor|export]`: the latest released version, its date, and how many
- bullets are pending under `[Unreleased]` — the runbook's step-0 check. Works with NO editor running
- (this rollout's step 0 precedes step 1's restart, and the live editor is a pre-brand build).
-3. **Ops verb, the remote path**: `pnpm ops cut-release --json '{"workspace":"editor","version":"next",
- "commit":true}'` → new `editor/app/api/ops/cut-release/route.ts` (synchronous, `ops()` +
- `OpsInputError` for a bad workspace/version, `actionResponse`-style body `{ok, results:[…]}`),
- `ACTIONS` + usage gain `cut-release` (usage says what the body takes and that `all` cuts both).
- Same controller. Note in usage: the route exists only on an editor running this release or later.
-4. No version bump in `package.json`, no git tag (neither is a convention here — say so in the record).
-5. `--date` is for a re-cut of an already-dated release only; default today (local time, as the
- action does).
-
-## Implementation (one Opus slice, branch `cli/cut-release`, its own worktree)
-
-1. Controller + `cutRelease.test.ts` (temp git repo via `git init`/`commit` in a temp dir: cut →
- heading + commit message; `next` → patch bump of the latest heading; `next-minor`; nothing pending →
- error; dirty tree with `commit: true` → refused naming the file; `all` stops at the first failure
- and reports the first as done; `--date` used verbatim; NEVER touches the real repo — every test
- passes an explicit root).
-2. `cutReleaseAction.ts` → adapter; `cut-release.spec.ts` must pass unchanged.
-3. `archilyzer.ts` verbs + `_cli.test.ts` cases (parse, usage listing).
-4. `/api/ops/cut-release` + `ACTIONS` + usage + `archilyzer-ops.test.mjs` (+1: the action posts to
- its route; the unknown-action list includes it) + one editor e2e in the ops style (POST with the
- worker token against the fixture changelogs → 200 with the heading; a bad workspace → 400).
-5. Docs: `README.md`/`AGENTS.md` only where they mention cutting a release (grep "Cut release",
- "re-cut"); the runbook is the parent's. Record `### Slice P, as shipped — cut a release from the
- CLI (2026-09-26)` in `plans/release-10.md` before `## Rollout`; one `[Unreleased]` bullet in
- `editor/CHANGELOG.md`.
-
-## Gates (worktree root)
-
-tsc; common tests (1,987 baseline on this main → new count); editor unit (85); `pnpm run test:scripts`
-(173 + 1 → new count); mcp 269 unchanged; `pnpm --filter editor exec next build`; editor e2e detached +
-queued: `cut-release.spec.ts` + the new ops e2e + every spec that greps `api/ops` (list them).
-Numbers tool: none.
-
-## Rollout (parent)
-
-The runbook's step 0 becomes `pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts
-release show` then `… release cut all next --commit` (or an explicit version) from the primary, before
-step 1's restart. Prove `pnpm ops cut-release` after the restart on a throwaway: `release show` only.
diff --git a/plans/deck-finale.md b/plans/deck-finale.md
@@ -1,53 +0,0 @@
-# Deck finale — the timeline in primary view (lane `lane/deck-finale`, K3)
-
-Asked by the operator on 2026-10-22 for the Huck seizure-timeline video: "For the finale we can move the
-timeline into primary view, and prominently show our totals as well as 'seizures per year' and maybe
-'incidents per year'." Scope narrowed the same day to what the render needs (the Huck video's first release).
-
-## Rulings
-
-- A timeline clip's `layout: "finale"` (default `"clip"`) marks the finale. The marked clips are ONE run of
- consecutive clips, with at least one clip before it and no clip after it; a card, still or teaser may follow.
- `validateFinaleEntries` (finale.mjs) refuses anything else — the build, the lint, `structureErrors` and
- `updateClip` (`umtool set <p> <clip> layout=…`; a write that adds a run problem is refused).
-- `render.chrome.deck.finale`: `video` side|corner|hidden (side), `motion` grow|cut (grow), `totals` (true),
- `stats` ≤ 8 `{label ≤ 32, value ≤ 16, note? ≤ 60, color?}`, `statsTitle` ≤ 40, `railLabels` all|nodes (all).
- Validated in `validateChrome` (unknown keys refused); no default is filled into `DECK_DEFAULTS`.
-- Geometry at 1080p (`finaleGeometry`, scaled with the frame): the rail across y 36–412, rail labels 28 px
- and dates/marker labels 24 px (floor 24), totals numbers 128 px (floor 96), pips 2.5× the footer's (floor
- 2×); the clip 768×432 at (1104, 448) ("side"), 538×302 bottom right ("corner"), none ("hidden").
-- Rail labels: each pip's deck title (else its date); consecutive equal labels share one, anchored between
- their pips over a span line; a date the label already says is not repeated; one row, else two, else turned
- 35°/50°/65° and hung down-left of the pip (the track starts far enough in for the first to read whole).
-- The schedule (`deckSchedule`): `segments[i].finale`, `finale {segments, video, motion, start, at, grow,
- cover, hide, from, to, out?, box, footage, dates}`; each finale clip's footage moves into the box through
- `schedule.moves` (the existing footage move, at the join, so `--chrome-only` changes it) — the first over
- 0.8 s from `at` ("grow"), the rest from their first frame; "hidden" moves nothing.
-- "grow": `at` = start + max(D, D/2 + 0.08 + deck.motion.in) — the deck hands its words over to the first
- finale clip as to any clip, then goes at `at`; the page draws the deck's ground, words, rail, tally and QR
- where it stood and moves them up; the ground's hole shrinks with the footage on the move's smoothstep.
- "cut": the page dissolves in over the run's first dissolve; the deck goes once it is covered.
-- A claim stamped on a finale clip counts at the finale's start (`landed` = `start`) and is not drawn
- (`stamp: false`, `finale: true`): the finale's totals are final.
-- Popup posts on a finale clip are not drawn (no hold, no move); the feed keeps its column (covered).
-- The finale page is a full-frame window region (`finaleRegions`, compose-chrome `--region finale`), laid last.
-- Absent a valid finale run the schedule, the deck page and the graph are the bytes they were, `deck.finale`
- set or not (finale.test.mjs).
-
-## Owed (deferred by the scope change)
-
-- `umtool/components/projects/FinaleEditor.tsx` (deck.finale fields, the stats list editor, a per-clip
- "Finale layout" toggle list through `updateClip`'s `layout`), its one-line mount in OnscreenSection.tsx, and
- OnscreenSection's `saveSettings` carrying `deck.finale` through (today a deck-settings save there drops it;
- `umtool look deck.finale=…` and `PUT /api/report/chrome` keep it).
-- An umtool e2e spec for the editor.
-- umtool's live On-screen preview (`/api/report/chrome/preview`, `previewSchedule`) does not compose the
- finale page; a build or `--chrome-only` renders it. A still: `compose-chrome.mjs --region finale --still`.
-- `verify-build` checks the finale window's frame count; the Huck cut has not been rebuilt here.
-
-## Files
-
-`umtool/report-to-video/`: `finale.mjs`, `chrome-finale.mjs`, `finale.test.mjs` (new); `deck.mjs`,
-`chrome-deck.mjs`, `compose-chrome.mjs`, `build-video.mjs`, `verify-build.mjs`, `lint.mjs`, `package.json`
-(`./finale`). `umtool/lib/report/manifest.mjs` (`updateClip`'s run guard, `structureErrors`),
-`lib/report/knobsCli.test.mjs`. Docs: `umtool/docs/knobs.md`.
diff --git a/plans/deflake-e2e.md b/plans/deflake-e2e.md
@@ -1,218 +0,0 @@
-# De-flake the e2e suites
-
-Pinned to `d1acca7` (`one-core/phase-1`). Written 2026-09-08.
-
-## Context
-
-Phase 1 of one-core shipped on `one-core/phase-1` (`7f294df` → `d1acca7`, closing e2e
-515/515). Across that job's sixteen e2e runs one editor spec reddened once without a code
-cause (`video-page.spec.ts:216`), one attribution spec timed out once in a run that was later
-killed, and memory records three export-site specs that flake on the baseline (the two
-"no FOUC" theme tests and ask-chat "Stop aborts mid-sweep"). The operator asked to fix the
-flake and any others we can. A read-only investigation (2026-09-08) root-caused three of the
-four; the fourth is unattributed and gets a bounded experiment.
-
-Branch: commit on top of `one-core/phase-1`. Nothing here touches the lane model. The same
-commits cherry-pick cleanly onto `main`, since every file involved exists there.
-
-## Findings, one per flake
-
-### 1. `editor/e2e/video-page.spec.ts:216` "Delete directory wrong-id confirmation" — root-caused, fixture + helper
-
-Failure: `pathExists(".../channels/test-youtube/data/20240101_test1234567")` is `false` at
-`:237` right after test `:196` ("Delete file") in the same file. The directory is not
-deleted, it is **renamed**: every snapshot generation calls `reconcileVideoDirs`
-(`common/controller/channelSnapshot.ts:606-611` → `common/controller/reconcileVideoDirs.ts:133-145`),
-which renames `data/<name>` to `data/<extractVideoId(webpage_url)>` when they differ. The
-fixture's `metadata.info.json` for that video has `webpage_url` ending `watch?v=test1234567`,
-the only directory in the whole fixture tree whose canonical id ≠ directory name. Test `:196`'s
-delete-file action ends with `requestChannelSnapshot` (`videoActions.ts:413`), arming the
-debounced regen; `resetData` (`editor/e2e/helpers.ts:34-63`) does `rm` + `cp` of the fixture
-FIRST and only then calls `/api/test/invalidate-cache`, so a regen that fires in the gap
-renames the freshly copied directory. The page still renders because
-`app/channels/[slug]/videos/[id]/page.tsx:44-54` swallows the readdir failure. Solo runs pass
-because nothing arms the scheduler beforehand. Product behaviour is correct; the fixture is
-inconsistent with it and the reset ordering is backwards.
-
-Fix:
-- `editor/e2e/fixtures/test-transcripts/one-youtube-channel-with-data/channels/test-youtube/data/20240101_test1234567/metadata.info.json`:
- set `id` and `webpage_url` so the canonical id equals the directory name
- (`watch?v=20240101_test1234567`). Do NOT rename the directory to `test1234567` —
- `video-page.spec.ts:148` creates a different video by that id in the same channel. Nothing
- asserts this fixture's `webpage_url` (the one `watch?v=test1234567` literal, at `:156`, is
- the unrelated created video). Grep the editor e2e tree for any other reader of this
- fixture's `id` before committing.
-- `editor/e2e/helpers.ts:45`: call `GET /api/test/invalidate-cache` BEFORE the `rm`, keeping
- the existing call at `:63`. Quiesce first, then mutate the tree. Both calls are idempotent;
- this also subsumes the ENOTEMPTY retry note at `:35-44` (update the comment).
-- `editor/e2e/helpers.ts:25-32` `fileExists`: re-throw when `err.code !== "ENOENT"` so a
- transient errno never reads as "gone".
-- `plans/STATE.md` (the "One known flake, reported and not fixed" paragraph): the note says
- nothing deletes the directory; correct it to "nothing deletes it, `reconcileVideoDirs`
- renamed it" and mark it fixed.
-
-### 2. `export/e2e/theme.spec.ts:40,56` and `theme-family.spec.ts:34` "no FOUC" — test-side timing
-
-`page.reload({waitUntil: "commit"})` resolves before the inline `<head>` script in
-`common/components/ThemeScript.tsx:26-47` is guaranteed to have run, so the following
-`page.evaluate` can read `data-theme: null`. Product is fine.
-
-Fix: the script sets `d.setAttribute('data-theme-ready','1')` in the same synchronous `try`
-block (just before the `catch`); each of the three tests gates its read on
-`page.waitForFunction(() => document.documentElement.dataset.themeReady === "1")` after the
-reload. The marker and the theme attributes are set by the same statement sequence and no
-React has run before a head script, so the test still proves "set before hydration".
-
-### 3. `export/e2e/ask-chat.spec.ts:961` "corpus sweep: Stop aborts mid-sweep" — test-side timing
-
-The route mock delays batch 2 with a wall-clock `setTimeout(r, 500)` at `:985`; the test must
-click Stop (`:1027`) inside that window, and on a loaded box batch 2 lands first.
-
-Fix: replace the timer with a latch the test controls — a deferred promise declared above the
-route; the batch-2 branch awaits it; the test resolves it immediately after the Stop click at
-`:1027`. Assertions at `:1032-1035` unchanged.
-
-### 4. `editor/e2e/attribution.spec.ts:349` "Run from the video page runs that video and no other" — unattributed
-
-One timeout (≈96 s = setup + the 90 s `toContainText("1 done")` wait at `:361-364`) in a run
-later killed with exit 137; the ✘ is 54 tests before the kill, so not a kill victim, but the
-kill suppressed the reporter detail. Passed in every later full run. Ruled out: lost
-pre-hydration click (`StreamActionLog.tsx:184` disables until hydrated) and a stale ollama stub
-(port preflight aborts on a bound 11435).
-
-Bounded experiment, not a fix: run `attribution.spec.ts` alone with `--repeat-each 10` from the
-e2e worktree, editor server stdout captured to a file. If it reproduces, the stream log's last
-line says whether the unit was never dispatched (slot starvation from the previous test) or
-dispatched and never answered (stub); fix accordingly and add the finding here. If 10/10 pass,
-record it in `plans/STATE.md` as unreproduced with the evidence and stop.
-
-**Result (2026-09-08): it reproduced — 2 failures in 10 — and it is NEITHER of those two.
-Not fixed; the evidence is below so the next attempt starts from it.**
-
-The unit was dispatched and the stub answered. Every failure froze on exactly the same three
-lines: the batch header, `Attribute attrvid0002: 120 cues → 1 chunk(s), text-only.`, and
-`ollama qwen2.5:7b: 100 in / 50 out tokens …`. Four separate 10× runs, six failures, identical
-content each time.
-
-What the failure snapshot adds: `attribution-text freshness` already reads **`current`**, so
-`attribution.json` HAD been written — and `attributeOneVideo` logs its closing
-`Attribute <id> (text-only): N speaker(s)…` line *immediately* after `await
-writeAttribution(...)`, with nothing between the two statements. So the job got past its write
-and then produced nothing further for 90 s. The editor server keeps answering `/api/pulse`
-throughout with an UNCHANGING `rev`, so the event loop is alive and the job's registry record
-never moves: **the job never reaches a terminal state.** `runOperationBatch` never returns, so
-`operationJobs.ts`'s single summary line is never emitted, so the test's wait is never
-satisfied. It is a hang in the batch, somewhere after the unit's write.
-
-**Two fixes were tried against the panel and BOTH failed, which is itself the evidence that the
-panel is not the problem.** (a) Reconciling `StreamActionLog`'s log against the job's log FILE
-once the stream ends: 2/10, unchanged. (b) Reconciling from the 1 s status poll on a terminal
-job status, and on either finish route: 1/10 then 2/10 — noise. Neither could find anything the
-panel did not already have, because the file does not have it either. Both were reverted; the
-component is untouched. If someone picks this up: the surviving suspects are inside
-`runOperationBatch` between `runOperationUnit` returning and `runPool` draining —
-`concurrentRunner.ts`'s documented "a transiently-zero limit ... does NOT terminate" wait at a
-zero `laneLimit`, and `taskHooks.ts`'s `onLog` progress parsers, which run on every line the
-unit emits. Instrument the job's registry record, not the log panel.
-
-### 4, as shipped — the panel was remounted, and the batch was innocent (`fae99f1`)
-
-Root-caused under the plan in [`attribution-batch-hang.md`](attribution-batch-hang.md).
-Instrumented at `fea2996` (`console.error`, ISO timestamps, the job id, never through the
-job's own `onLog`, editor webServer `stdout`/`stderr` piped): **3 failures in 25**, all
-identical. The decisive trace, one job:
-
-```
-[TRACE 2026-09-08T20:25:21.598Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=1 closed=false :: Backfill attribution-channel: attribution-text over 1 video
-[TRACE 2026-09-08T20:25:21.611Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=3 closed=false :: ollama qwen2.5:7b: 100 in / 50 out tokens in 0s wall
-[TRACE 2026-09-08T20:25:21.661Z] attributeOne.post-write attrvid0002
-[TRACE 2026-09-08T20:25:21.661Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=4 closed=false :: Attribute attrvid0002 (text-only): 2 speaker(s), 2 segment(s)
-[TRACE 2026-09-08T20:25:21.662Z] runPool returned attribution-channel
-[TRACE 2026-09-08T20:25:21.662Z] onLog job=01M21B4PDQZC6YWGZH38WYV37N n=5 closed=false :: Backfill attribution-channel: 1 done, 0 already current, 0 failed
-[TRACE 2026-09-08T20:25:21.663Z] fn.finally job=01M21B4PDQZC6YWGZH38WYV37N status=done
-Error: locator.getAttribute: Test timeout of 120000ms exceeded.
- - waiting for getByLabel('Run Speaker names (from the transcript) output')
-```
-
-The whole job took **65 ms**. Every line reached `onLog` with `closed=false`, the summary
-included, and the record finalized `done`. **The trace killed all five hypotheses the plan
-ranked, H1's mechanism included.** H2: `limit()` never read 0 (`pool.wait-capacity target=1`
-throughout). H3: `runOne`'s `finally` timestamps are all present. H4: finalize ran. H5: no
-signal aborted. And H1 as WRITTEN — an early SSE teardown, to be fixed by polling the job's
-log file until terminal — is dead too: `stream.cancel` fired **zero** times in 240
-instrumented tests (40 of this spec) and every line enqueued `closed=false`. All that held of
-H1 was its DISPOSITION: the server is innocent and the failure is client-side. The real cause
-is a sixth mechanism, outside the plan's table, and **the fix the plan prescribed for H1 was
-not shipped and would not have worked** — see below.
-
-**The sixth mechanism: React unmounted the panel.** The log was not stale — the log ELEMENT
-was gone. Both bodies returned two fragments of different SHAPES, each with `RunOne` at a
-different index in the two branches:
-
-| body | no record on disk | with a record | RunOne moves |
-|---|---|---|---|
-| `DiarizationBody` | `[p, RunOne]` | `[dl, p, RunOne]` | index 1 → 2 |
-| `AttributionBody` | `[p, RunOne]` | `[dl, ul, p, RunOne]` | index 1 → 3 |
-
-Static JSX fragment children compile to one array, so `reconcileChildrenArray` runs: the index
-fast-loop breaks at 0 (`p` vs `dl`) and the map pass then finds `p`/`ul` at index 1 where
-`RunOne` used to be. **A positional TYPE MISMATCH on an UNKEYED child is what destroyed it** —
-not the move as such: React preserves state across a KEYED move, so a `key` alone would have
-matched the old fiber at its new index, and a fixed position alone would never have reached
-the map pass. Either was sufficient. With `log` empty and `running` false the remounted
-component renders no `<pre role="log">` at all, which is exactly what the failure snapshot
-shows: the record body, the Run button, and no log. The refresh that lands the record is the
-one `StreamActionLog` fires itself at the end of a run (`:163`), so the panel is wiped at the
-instant the summary line reaches it, and the spec could only pass in the ~200 ms window
-before the refresh landed.
-
-**This retires two claims made here on 2026-09-08 and both were measurement artifacts**: "the
-job never reaches a terminal state" (it reached it in 65 ms) and "the log FILE has no more
-than the panel does" (the file had everything). It also explains why the two panel-side
-reconciles measured no change, and why the plan's prescribed H1 fix would have measured no
-change either — no amount of reconciling helps a component React has just destroyed and
-rebuilt with empty state.
-
-Fix: both bodies are ONE two-child list, the record body a sibling of the button, `RunOne`
-last AND keyed in both branches — belt and brace, since each alone would have done. No DOM
-change, no server change, `StreamActionLog` untouched. The durable rule this generalises to
-(and three pre-existing, unfixed instances of it in `VideoPanel.tsx`) is in `plans/FACTS.md`.
-Test: the spec asserts the panel STILL contains "1 done" AFTER the freshness pill reads
-"current" — the pill is the proof the refresh landed, which makes it deterministic rather than
-a second race. At `fea2996` that assertion is red **5/5** (`element(s) not found`); at
-`fae99f1` `attribution.spec.ts --repeat-each 20` is **20/20**.
-
-**Follow-up:** the three `VideoPanel.tsx` instances this section left unfixed are closed in
-`c19098b` (specs `b207e84`), with a fourth found in `PerFileTranscribeRow` and the review's
-button/alert/timeout fixes in `12d1778` — same rule, the shape to copy is in `FACTS.md`. Full
-suite at that tip: **518/518**.
-
-## Not changed, deliberately
-
-- `reconcileVideoDirs` keeps mutating during snapshot generation; that is the product's
- design. The e2e hazard is closed by quiescing before the fixture copy, and the STATE.md note
- names the class ("a debounced write survives a test boundary until the next reset").
-- `workers: 1`, `fullyParallel: false`, `retries: 0` stay as documented in
- `editor/playwright.config.ts:42-72`. No `retries`, `test.slow`, or serial-mode markers are
- added anywhere — the point is determinism, not tolerance.
-
-## Verification
-
-- `tsc --noEmit` in common and export (ThemeScript change); `pnpm --filter yt-dlp-transcript-common test`.
-- Stress the fixed specs from a worktree (the primary checkout cannot run editor e2e because
- of the untracked `editor/content` symlink; worktree recipe in `plans/FACTS.md`'s one-core
- sections — copy a composed fixture site into the worktree's `export/public`, e.g. from
- `.claude/worktrees/duplicates-page/export/public`):
- - editor: `pnpm e2e -- video-page.spec.ts --repeat-each 10` (the full file, so `:196`
- precedes `:216` every time) — 10/10. If `--repeat-each` is swallowed after `--`, use
- Playwright's config/CLI another way (e.g. `pnpm exec playwright test ... --repeat-each 10`
- with the queue lock taken the way `pnpm e2e` takes it) and say which you used.
- - editor: `pnpm e2e -- attribution.spec.ts --repeat-each 10` with server stdout captured
- (the item-4 experiment).
- - export: `theme.spec.ts theme-family.spec.ts ask-chat.spec.ts --repeat-each 10` — all green
- (use the export package's own e2e entry; `e2e:2origin` is known-broken on main and is not
- used).
-- Full editor e2e once at the end from the worktree, detached behind the queue lock, watched
- with Monitor (not polled): expect 515/515.
-- One commit per flake (fixture+helper; theme; ask-chat; STATE.md + the item-4 record), each
- with the stress result in its message.
diff --git a/plans/editor-channels-rack.md b/plans/editor-channels-rack.md
@@ -1,387 +0,0 @@
-# `/channels` rethink: one instrument, one deck
-
-Pinned to `main` @ `a1058d0` (2026-09-13).
-
-## Context
-
-`/channels` is the editor's channel console: 67 rows, 16 columns, three bulk mechanisms and
-a pipeline band per operation per row. Two features landed on it in the 2026-09 integration
-without a design pass, and the operator's first use of the merged page found it messy:
-
-- **Two selection bars.** `ChannelBulkBar` (priority) is `sticky bottom-0` and floats at the
- viewport edge; `ChannelStorageBulkBar` is a plain block after the 67-row table, reachable only
- at the very bottom. Both say "N selected", both have Clear. On `<md` the sticky bar pins to
- the table's `overflow-x-auto` box, not the screen. The storage bar's root input truncates and
- its button label (`Move media to {root}`) is cut to "Move media to…".
-- **Rows are ~90 px.** The Tier cell is a four-line stack (select, chips, held note, Advanced),
- and with a corpus-wide focus active the orange `Held — focus: omnimirror` note repeats on 60+
- rows: the most repeated element carries the least per-row information. 67 rows ≈ 6,000 px.
-- **The table overflows the viewport.** At 1440 px (1216 px of content beside the sidebar) the
- six band columns and the Actions column sit off-screen; the wrapper is `overflow-visible` on
- `md+`, so it spills rather than scrolls.
-- **The header has no hierarchy.** Four dark pills ("Sync every channel", "Full sweep every
- channel", "Update all reports", "New channel") share one weight.
-- **The page's honesty lives in its footer.** The band legend, the Names·A/T explainer and the
- report-age note (`data-testid="channels-freshness"`) are stacked in 11 px type under the
- floating bar.
-
-Decisions taken with the operator 2026-09-13: full-page rethink; a corpus-wide focus is stated
-**once** above the table and each held row shows a small chip with the full reason as
-screen-reader text.
-
-## The design plan
-
-**Subject.** An operator's console for a 67-channel corpus. Its single job: see every channel's
-state in one glance and act on a few. The vocabulary already in the product is the instrument:
-"transit line", "stations", "bands", "rail/strip", "runner", "lane". The page should read as a
-**rack** — a scrolling column of channel strips under a fixed meter-bridge header, with the
-selection controls docked below like a console's master section — not a document with widgets
-stapled to its top and bottom.
-
-**Colour.** No new colour. The editor runs the neutral base family from
-`common/styles/tokens.css`; the page keeps it and keeps the band rule that `reachable`
-(`--info` #2563eb) is the **only** saturated colour. The palette in use:
-
-| role | token |
-|---|---|
-| chrome (header, toolbar, deck) | `bg-card/95 backdrop-blur border-border` — the channel page's sticky-header idiom (`[slug]/layout.tsx:43`) |
-| rack ground | `bg-background`, rows `border-t border-border`, meter bridge `bg-surface` (#f7f7f8 / #141416) |
-| identity | `text-foreground` slug in `font-mono`; name in `text-muted-foreground` |
-| the one accent | `--info`, via `StateBand` only |
-| attention | `--warning` for held chips, stale/missing report; `--destructive` only for unreachable media |
-
-**Type.** Source Sans 3 body, Source Code Pro for slugs, counts and the editor's signature
-micro-caps eyebrow (`font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground`,
-already the nav-group and lane-strip label style). Eyebrows are the structural device on this
-page: they name the *verb groups* in the deck (Tier · Focus · Media), the *corpus actions* in
-the header, and the *pipeline* block in the table head. They encode something true: these are
-groups of controls, not decoration. Tabular numerals (`tabular-nums`) on every count and date.
-
-**Layout.** On `md+` the page stops scrolling the document. It is a flex column the height of
-the viewport: header → focus line → instrument bar → **a scroll region holding the table** →
-deck (only with a selection). Inside the region the `<thead>` is `sticky top-0` and the
-checkbox + Slug cells are `sticky left-0`, so the identity column and the meter bridge header
-never leave the screen while 16 columns scroll horizontally. On `<md` the document scrolls as
-today and the deck is `sticky bottom-0` **outside** the overflow wrapper, so it pins to the
-screen.
-
-```
-┌ sidebar ┐┌────────────────────────────────────────────────────────────────────────┐
-│ ││ Channels EVERY CHANNEL │
-│ ││ 67 channels · oldest report Aug 27, 5:58 PM [Sync every] [Full sweep]│
-│ ││ (channels-freshness, moved up) [Update reports] ▮New ch.▮│
-│ ││────────────────────────────────────────────────────────────────────────│
-│ ││ FOCUS omnimirror · 61 held [site ▾] [Focus site] [End focus] │
-│ ││────────────────────────────────────────────────────────────────────────│
-│ ││ [x] Group by section PIPELINE ▪ done ▮ can run ░ blocked … │
-│ ││┌─────────────────────────────────────────────────────────────────────┐│
-│ │││☐ Slug Name Handling Build Tier Playlist Last sync … ││ sticky thead
-│ │││☐ chibi-rev… Chibi R… youtube ●Incl. Normal▾ 9658 Sep 11 10:24 ││
-│ │││☑ chrissie-m Chrissie youtube ●Incl. Normal▾ [held] 3528 … ││ 40px rows
-│ │││ … (scrolls vertically; ☐ + Slug sticky left; bands scroll right) ││
-│ ││└─────────────────────────────────────────────────────────────────────┘│
-│ ││┌ deck (docked, only with a selection) ───────────────────────────────┐│
-│ │││ 2 selected │ TIER [Normal▾] [Apply tier] │ FOCUS [Focus these] ││
-│ │││ │ MEDIA [/mnt/platter/archilyzer-media] [Move media] ││
-│ │││ Queued 1 · skipped 1 · view jobs [Clear] ││
-│ ││└─────────────────────────────────────────────────────────────────────┘│
-└─────────┘└────────────────────────────────────────────────────────────────────────┘
-```
-
-Mobile (`<md`):
-
-```
-│ Channels │
-│ 67 channels · oldest report … │
-│ EVERY CHANNEL │
-│ [Sync every channel] │
-│ [Full sweep every channel] │
-│ [Update all reports] ▮New channel▮│
-│ FOCUS omnimirror · 61 held │
-│ [site ▾] [Focus site] [End focus] │
-│ ┌ table, overflow-x-auto ───────┐ │
-│ │☐ slug (sticky left) | … → │ │
-│ └───────────────────────────────┘ │
-│ ┌ deck sticky bottom-0 ─────────┐ │ ← outside the overflow wrapper
-│ │ 2 selected [Clear] │ │
-│ │ TIER [Normal▾] [Apply tier] │ │
-│ │ FOCUS [Focus these] │ │
-│ │ MEDIA [root……] [Move media] │ │
-│ └───────────────────────────────┘ │
-```
-
-**Signature.** The **meter bridge**: the six band columns are one block, not six loose grey
-dashes. Their header cells share one eyebrow (`PIPELINE`) with the legend swatches inline; their
-body cells sit on `bg-surface` with a 1 px `border-l border-border` on the first, so the
-strips read as one instrument across the row. Nothing about `StateBand` changes (no new fill,
-no animation at `strip` scale). This is the one place the page spends its boldness; the deck,
-header and rows are quiet.
-
-**Self-critique before building.** The generic answer to "messy table page" is cards, a
-search box, a filter chip row and a floating action button. None of that: the IA record rules
-out cards (columns must stay locked for cross-group comparison), there is no search or filter
-on the page today and none is asked for, and a FAB would be a third selection mechanism. The
-rack-with-docked-deck is specific to this page's real problem (16 columns × 67 rows plus two
-kinds of bulk verb) and reuses the product's own instrument vocabulary. The eyebrows are the
-editor's existing signature move, not an import. The one risk taken (the bridge) is layout,
-not colour, so it survives all eight token families.
-
-## Rules this must honour (from the plans, verified)
-
-- Every e2e accessible name on the page is **unchanged**; only DOM position and styling move.
- The pinned set: `select all channels`, `select {slug}`, `channel priority bulk`, `bulk tier`,
- `Apply tier`, `Focus these`, `channel focus`, `focus site`, `Focus site`, `End focus`,
- `bulk media root`, `move media for selected channels`, `bulk media move result` (+ `title`),
- `bulk media move error`, `priority bulk error`, `held reason for {slug}` (must **contain the
- full text** `Held — focus: …`; `toHaveCount(0)` when not held), `focused-{slug}`,
- `tier for {slug}`, `advanced priority for {slug}`, `{op} override for {slug}`,
- `sync only for {slug}`, `report age for {slug}`, `playlist count for {slug}`,
- `{op} count for {slug}` (sr-only text beside the band), `toggle build inclusion for {slug}`,
- `sort by {label}` + `aria-sort` on the `<th>`, `group-name`, `rowheader`, `Group by section`,
- `sync group {name}` etc., `sync every channel` / `sync all result`, `update all reports` /
- `update all reports result`, `New channel` link, `channels-freshness`, `Active site`, the
- h1 `Channels`, and the eight fixed header strings Slug, Name, Handling, Build, Tier,
- Playlist, Last sync, Report.
-- `channel priority bulk` and `bulk media root` must have **count 0 with an empty selection**
- and the root box must carry `settings.storage.mediaRoot` as soon as anything is selected —
- so the deck unmounts when empty and shows all three verb groups at once (no mode switch).
-- The storage verb keeps **no preview gate** and one root for the batch
- (`ChannelStorageBulkBar.tsx:8-20`); `Queued N · skipped M` with reasons on `title`.
-- Tier is a `<select>`; the five per-operation overrides stay behind the `Advanced` disclosure;
- one writer (`saveChannelPriorityAction`); focus is corpus-wide and needs no selection.
-- `MediaLocationBadge` appearances unchanged (nothing on in-place rows).
-- Row dimming keys off `excludeFromBuild || tier === "paused"` only.
-- Selection is a `Set` of slugs intersected with what is on screen; survives sort/group toggle.
-- `StateBand`: exactly one saturated colour, fill pattern first, no animation at `strip`.
-- The freshness note is an obligation, not decoration; the Names·A/T explainer stays.
-- No sort/group state in the URL.
-
-## Changes, by file
-
-All under `editor/app/channels/` unless noted. New components go in `components/`. Add by
-path, commit per step, tsc green at every commit.
-
-### 1. `components/ChannelSelectionDeck.tsx` (new) — replaces both bars
-
-- Props: `slugs`, `onClear`, `defaultRoot`. Returns `null` when `slugs.length === 0`.
-- One root element `aria-label="channel priority bulk"` (keeps the spec's handle; the storage
- controls are inside it, addressed by their own labels). Chrome:
- `border-t md:border md:rounded-md border-border bg-card/95 backdrop-blur shadow-lg
- motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-bottom-2`.
-- Row 1, `flex flex-wrap items-center gap-x-4 gap-y-2`: `{n} selected` (`font-medium
- tabular-nums`), then three groups each `flex items-center gap-2 pl-4 border-l border-border`
- with an eyebrow (`TIER`, `FOCUS`, `MEDIA`): Tier = `<select aria-label="bulk tier">` +
- **Apply tier**; Focus = **Focus these**; Media = `<input aria-label="bulk media root">`
- (`font-mono w-72 md:w-80`, seeded from `defaultRoot`) + button `aria-label="move media for
- selected channels"` whose **visible text is `Move media`** (the root is in the box beside it;
- the old `Move media to {root}` label is what truncated) + `Queueing…` while pending; then
- `ml-auto` **Clear**.
-- Row 2 (only when there is something to say): the storage result span (`aria-label="bulk
- media move result"`, `Queued N · skipped M · view jobs`, reasons on `title`), the storage
- error (`role="alert" aria-label="bulk media move error"`), the priority error
- (`role="alert" aria-label="priority bulk error"`).
-- Behaviour moved verbatim from the two old components: `setChannelTierAction` and
- `focusChannelsAction` call `onClear` on success; the storage move does not; the storage
- header comment about "no preview gate" moves with it.
-- Delete `ChannelStorageBulkBar.tsx` and the `ChannelBulkBar` export from `ChannelBulkBar.tsx`
- (keep `ChannelFocusBar` there, or move it to its own file — see step 4).
-
-### 2. `components/ChannelsTable.tsx` — the rack
-
-- **Structure.** The outer wrapper becomes `flex flex-col min-h-0` (it is inside the page's
- flex column, step 5). Order: instrument bar → scroll region → deck. The deck is a sibling of
- the scroll region, never inside the `overflow` element.
-- **Scroll region.** `div.relative.min-h-0.flex-1.overflow-auto.md:rounded-md.md:border
- .border-border` (border-y only below `md`). Drop `md:overflow-hidden` from the `<table>` —
- it would become the sticky ancestor and defeat the sticky header; rounded corners come from
- the region.
-- **Sticky header.** `<thead className="sticky top-0 z-20 bg-muted">`. Group header rows
- (`ChannelGroupHeaderRow`) get `sticky top-[var(--thead-h)] z-10` on `md+` so a section's name
- stays visible while its rows scroll (measure `--thead-h` once with a ref; fall back to a fixed
- `top-9`).
-- **Sticky identity.** The checkbox `<th>/<td>` `sticky left-0 z-10` and the Slug cells
- `sticky left-8 z-10`, both with `bg-muted` (head) / `bg-background` (body) and a
- `shadow-[1px_0_0_var(--color-border)]` right edge so they read as pinned when the rest
- scrolls. Rows keep `border-t border-border`; selected rows get `bg-accent/60`.
-- **Row density.** Cells `px-2 py-1.5 align-middle` (was `px-3 py-2`); target row height 40 px
- with a closed Tier cell. `Td` for dates: `whitespace-nowrap tabular-nums text-xs
- text-muted-foreground`, formatted `toLocaleString(undefined, { dateStyle: "medium",
- timeStyle: "short" })` (`Sep 11, 2026, 10:24 AM`). Report cell keeps `stale`/`missing` in
- `text-warning`. Playlist `text-right tabular-nums`. Handling becomes a mono micro-tag
- (`font-mono text-[11px] text-muted-foreground`), same text.
-- **Meter bridge.** The pipeline `<th>`s: a `<th colSpan={columns.length}>` is NOT added (it
- would change `columnheader` semantics); instead each band header keeps its own sortable
- button and the FIRST band header carries the eyebrow `PIPELINE` above its label and the
- legend swatches render inline in the instrument bar (step 3). Body: each band `<td>` gets
- `bg-surface`, the first `border-l border-border`, the last `border-r border-border`; width
- `w-24 min-w-20`. `PipelineCell` unchanged (sr-only count + `StateBand size="strip"`).
-- **Instrument bar** (the row above the region): `flex items-center justify-between gap-3
- px-1 pb-2 text-xs text-muted-foreground`: left = the existing `Group by section` checkbox
- (when sections exist); right = `<BandLegend />` plus, behind a `<details>` labelled
- `Names·A / Names·T`, the two-route explainer paragraph (text unchanged).
-- **The deck** replaces lines 446–454; the legend block at 455–464 is dissolved into the
- instrument bar. `colSpan` stays `10 + columns.length`.
-- **`<md`.** The region is `overflow-x-auto -mx-4` as today (no fixed height; the document
- scrolls); the deck sits after the wrapper with `sticky bottom-0 z-20`.
-
-### 3. `components/ChannelTierSelect.tsx` — one line
-
-- Root becomes `flex flex-wrap items-center gap-1.5` (not a vertical stack); `min-w-36` →
- `min-w-32`. Order: `<select aria-label="tier for {slug}">` (h-7, text-xs), `Focused` chip
- (`data-testid="focused-{slug}"`, unchanged), `N pinned` chip (unchanged), the **held chip**,
- the `Advanced` `<details>` summary (unchanged label/aria; its open panel is
- `absolute z-30 mt-1 rounded-md border border-border bg-popover p-2 shadow-md w-64` inside
- a `relative` wrapper so opening it does not reflow the row — it overlays the rows below).
-- **Held chip.** Replaces the orange `role="note"` line. Keeps `role="note"` and
- `aria-label="held reason for {slug}"`; visible text is a warning pill
- (`rounded-full border border-warning/30 bg-warning-soft text-warning px-1.5 text-[10px]
- uppercase tracking-wide`) reading `held`, plus an `sr-only` span holding the **full reason
- text** (`Held — focus: site Focusable`) and the same on `title`. `textContent` therefore still
- contains the pinned substring. Rendered only when `heldReason` is set (so `toHaveCount(0)`
- holds).
-- The error span stays (`text-destructive text-xs`), wrapping to a second line only on error.
-
-### 4. Focus line — `ChannelFocusBar` (in `ChannelBulkBar.tsx`, or moved to `ChannelFocusBar.tsx`)
-
-- Keeps `aria-label="channel focus"`, the `focus site` select, **Focus site**, **End focus**,
- `focus error`, and the `Focus: {label}` / `No focus` text (the spec asserts
- `toContainText("Focus: site Focusable")` and `"No focus"`).
-- New prop `heldCount` (computed in `ChannelsTable` as the number of rows whose
- `priority.heldReason` is set): renders ` · {n} held` after the label when a focus is active.
-- Chrome: a single line, `flex items-center gap-3 px-1 py-1.5 text-sm` with an eyebrow
- `FOCUS` first; no card border (it is a statement, not a panel); `border-b border-border`
- under it. Buttons `h-7 text-xs`.
-
-### 5. `page.tsx` — header hierarchy and the honesty line
-
-- Page root: `flex flex-col gap-3 md:h-[calc(100vh-3rem)] md:min-h-0` (main has `py-6`;
- the sidebar is `md:h-screen`, so the content column matches). Below `md` no fixed height.
-- Header: left = `<h1>` (unchanged) + the freshness paragraph **moved here** as the subtitle
- (`data-testid="channels-freshness"`, same text, `text-xs text-muted-foreground`, prefixed
- with `{count} channels · `). Right = a cluster: eyebrow `EVERY CHANNEL` above
- `SyncAllChannelsButton` + `RefreshAllReportsButton` restyled as **outline** buttons (`h-8
- text-xs border border-border bg-transparent hover:bg-accent`), then the `New channel` link
- as the **only** primary (`bg-primary text-primary-foreground`). Button names and result
- spans unchanged (`sync all result`, `update all reports result`).
-- The empty state (`No channels yet.`) unchanged.
-- The freshness paragraph is removed from the bottom (it moved, not duplicated).
-
-### 6. Header buttons — `SyncAllChannelsButton.tsx`, `RefreshAllReportsButton.tsx`
-
-- Accept a `variant` or simply take the outline classes; the inline result span moves to a
- `title`-less line under the cluster on `<md` (still the same element and label).
-
-### 7. Nothing else moves
-
-No server action, no `actions.ts`, no `common/` change, no e2e spec renamed. `MediaLocationBadge`,
-`ChannelBuildToggle`, `ChannelGroupHeaderRow`, `ChannelGroupLine`, `PipelineCell`, `StateBand`,
-`BandLegend` are reused as they are (only classes on their host cells change).
-
-## Verification
-
-1. `pnpm -r exec tsc --noEmit` clean; `pnpm --filter yt-dlp-transcript-common test` unchanged
- (1159 on `main`); `pnpm --filter editor exec next build` clean.
-2. Editor e2e, from a worktree (never the primary checkout), the channel set first:
- `channels.spec.ts`, `channels-sort.spec.ts`, `channels-counts.spec.ts`,
- `channels-actions.spec.ts`, `channel-priority.spec.ts`, `channel-storage.spec.ts`,
- `channel-groups.spec.ts`, `channel-work.spec.ts`, `channel-build-toggle.spec.ts`,
- `site-scope.spec.ts`, `navigation.spec.ts`, `perf-budget.spec.ts`; then the FULL suite
- (533 on `main`; known flakes `video-page.spec.ts:216`, `backfill.spec.ts:457`). Detached
- behind the queue lock, watched with Monitor.
-3. Visual check against the "before" PNGs: re-run the screenshot script against the
- worktree's dev server (its own port block; a copy of the e2e fixture corpus, never
- `transcripts/`) at 1440×900 and 390×844, with and without a selection, plus one row's
- Advanced open. Confirm: one deck; rows ≈ 40 px; header and identity column stay put while
- the bands scroll; the deck reachable on mobile without scrolling the table; keyboard focus
- rings visible on every control; `prefers-reduced-motion` disables the deck's entry animation.
-4. Accessibility: tab order header → focus line → instrument bar → table → deck; the held
- chip's accessible name reads the full reason; the sticky cells do not trap focus.
-5. Record: `editor/CHANGELOG.md` entry; a "Shipped" section appended to this file with the
- before/after screenshots' paths and the one-paragraph rationale (rack + docked deck +
- meter bridge), and the e2e counts.
-
-## Shipped
-
-Branch `editor-channels-rack`, forked from `main` @ `a1058d0`. Commit range
-`64b5573..HEAD`, which is these ten in order: `64b5573` the plan, `4bb2a0a`
-step 1, `278d446` step 2, `76a1e1e` step 3, `b57b59b` step 4, `662fdf1` step 5,
-`75b7f37` step 6, `20ee34d` the polish pass the rendered page called for,
-`92fa9d8` the first record, and THIS commit — the header fix below plus this
-paragraph. (A commit cannot name its own hash, so the tip is enumerated rather
-than spelled; `git log --oneline main..` prints it.)
-
-**Rationale.** The page's problem was never that it showed too much — it is a
-console for a 67-channel corpus and every column earns its place — but that it
-had no instrument. Sixteen columns spilled off the right of a 1440px screen
-because the wrapper was `overflow-visible`, one selection had two bulk bars in
-two places, rows were ~90px because the tier cell was a four-deep stack, and the
-page's own caveat sat 6,000px below the numbers it qualified. So: a **rack** —
-one scroll region whose column headers pin to its top and whose checkbox and slug
-cells pin to its left, so the identity column and the meter-bridge header never
-leave the screen while the bands scroll sideways; a **docked deck** — one panel
-under the rack carrying Tier, Focus and Media at once, appearing with a selection
-and unmounting without one, so there is one place to act on what you ticked; and
-a **meter bridge** — the six band columns drawn as one block, with a shared
-`Pipeline` eyebrow, a surface behind them and a rule at each end, which is the one
-place the page spends its boldness. Everything else went quiet: the focus is a
-line, not a card; the held sentence is stated once above the table with a count
-and each row keeps a chip (full reason on `title` and for a screen reader); the
-three pool-wide buttons are outlines under an eyebrow naming what they sweep, and
-`New channel` is the only fill.
-
-**Measured.** Rows 41px (was ~90): 14 channels on screen at 1440×900 where 7 fit
-before, with the header at 80px (211px on a 390px viewport, where it stacks). The deck is 48px tall at 1440 and 176px at 390. `prefers-reduced-motion:
-reduce` computes `animation-name: none` on the deck (`enter` otherwise). Tab order
-runs header buttons → focus line → table → deck, with the deck last in the
-document's focus order and the sticky cells trapping nothing.
-
-**Screenshots.** Before (production editor, 67 channels):
-`~/reports/editor-channels-rack/before/` — `ch-1440-full.png`,
-`ch-1440-sel-viewport.png`, `ch-1440-sel-bottom.png`, `ch-1440-advanced.png`,
-`ch-390-full.png`, `ch-390-sel-viewport.png`. After (worktree dev server on 3201
-against a synthesized 34-channel corpus with a live site focus, never
-`transcripts/`): `~/reports/editor-channels-rack/after/` —
-`ch-1440-viewport.png`, `ch-1440-sel-viewport.png`, `ch-1440-sel-bottom.png`,
-`ch-1440-scrolled-right.png`, `ch-1440-advanced.png`, `ch-1440-grouped.png`,
-`ch-1440-sel-reduced-motion.png`, `ch-390-viewport.png`,
-`ch-390-sel-viewport.png`, `ch-390-sel-bottom.png`, plus the `-full` variants.
-
-**Verification.** `pnpm -r exec tsc --noEmit` clean at every commit;
-`pnpm --filter yt-dlp-transcript-common test` 1159 passed (unchanged);
-`pnpm --filter editor exec next build` clean. e2e from this worktree: the channel
-set (`channels`, `channels-sort`, `channels-counts`, `channels-actions`,
-`channel-priority`, `channel-storage`, `channel-groups`, `channel-work`,
-`channel-build-toggle`, `site-scope`, `navigation`, `perf-budget`) **60 passed /
-0 failed** in 3.5 min; the FULL suite **533 passed / 0 failed** in 30.3 min,
-which is `main`'s baseline exactly and includes the two known flakes
-(`video-page.spec.ts:216`, `backfill.spec.ts:457`) passing first time. A fresh
-worktree needs a composed fixture site copied into `export/public` first or the
-export webServer 500s and Playwright dies at 120s (FACTS.md:3295) — that bit the
-first attempt.
-
-**Divergences from the plan, and why.**
-
-- `min-w-32` on the tier cell was too narrow: select + chips + `Advanced` want
- ~200px, so the cell wrapped and rows measured 63px. `min-w-52` gets them to 41.
-- The checkbox cell renders ~29px wide, so the Slug cell's `left-8` left a
- sub-pixel gap that showed the scrolled columns through it. The checkbox cell is
- `w-9` and the Slug cell paints over the overlap (`z-20` over `z-10`) instead.
-- The band `<th>`s carry the block's opening and closing rules too, not only the
- body cells — otherwise the bridge's vertical rules start below the header and
- the block reads as broken.
-- `ChannelGroupHeaderRow`'s `<tr>` drops `bg-muted/40` and its `<th>` takes solid
- `bg-muted`: a sticky cell cannot be translucent or the rows scroll visibly
- through it.
-- The header result spans keep their `title` (the skip reasons are an obligation,
- not decoration); the cluster wraps them to their own line rather than stripping
- the attribute.
-- `ChannelFocusBar` moved to its own file and exports `useBarAction`, which the
- deck shares — the plan allowed either.
-- The header is `md:flex-nowrap` with the SUBTITLE shrinking, because the
- freshness paragraph is three lines and not a tagline: at its `max-w-3xl`
- ceiling it claimed 768px of a 1216px column, the header wrapped, and the
- corpus-wide cluster dropped onto a band of its own — the undifferentiated row
- of pills this change exists to remove. The left block is `md:flex-1 min-w-0`
- so the paragraph rewraps into what is left (the cap stays a ceiling, never a
- floor) and the cluster keeps its intrinsic width top-right. Header 80px at
- 1440 instead of ~150. Below md it still wraps and stacks.
diff --git a/plans/editor-ia-slice-3.md b/plans/editor-ia-slice-3.md
@@ -1,280 +0,0 @@
-# Editor IA slice 3 — per-operation settings live on the operation page
-
-## Context
-
-The vocabulary pass landed 2026-08-26 (`02ff048` → `32950aa`): the registry is `operations.ts`,
-says `Operation`, and every UI id space says "speakers". The user chose **slice 3 over
-unified-ops step 1** as the next piece (recorded in `plans/STATE.md` "Recommended next" #6 and
-in memory). Step 1 follows it.
-
-Today `/settings` (`SettingsForm.tsx`, 1,163 lines, one form, one `saveSettingsAction`) holds
-four fieldsets that configure *operations*: **Digest** (`:526-707`), **Diarization**
-(`:708-888`), **Speaker work lane** (`:889-981`), **Speaker attribution** (`:982-1087`) —
-562 lines. `/operations/<id>` (slice 1–2) is where an operator reads an operation's state,
-arms its sweep and pauses its lane, then has to go to a different page to switch it on. The
-IA doc's test is "a new operation is a registry entry, and it appears on the board, the channel
-page, the video page and the policy tree without a new page" — its settings should appear
-there too, and `/settings` should be the Machine page the end-state nav says it is.
-
-**Every fact below was verified at `32950aa` and is recorded in `plans/FACTS.md` "Verified
-2026-08-26 — slice 3 seams"** — read that section first. `plans/STATE.md` already links this
-plan as `plans/editor-ia-slice-3.md`; that file does not exist yet (see step 0).
-
-Three findings that decide the design:
-
-1. **The `*FormPresent` markers exist only because one form saves everything.** Each of the
- four action blocks (`settings/actions.ts` Digest `:264-343`, Diarization `:344-393`,
- Backfill `:394-411`, Attribution `:412-448`) is gated on a hidden input so a submit from a
- form lacking the block cannot read every checkbox as off. Give each block its own form and
- action and all four markers are dead — that is the deletion this slice makes. The
- `...current` spread each block already does becomes the whole isolation story, and the
- sanitizers are already per-block (`sanitizeDigest :937`, `sanitizeBackfill :1111`,
- `sanitizeAttribution :1149`, `sanitizeDiarization :1211`; `writeSettings` re-sanitizes
- everything at `:1679`).
-2. **The lane fieldset is not per-operation.** "Speaker work lane" (`enabled`, `weight`,
- `concurrency`, `allowRedownload`) governs `BACKFILL_QUEUE`, shared by diarization,
- `attribution-text` and `attribution-diarized`. It goes beside `SweepLane` inside
- `SweepOperationView` (`OperationDetail.tsx:104-169`) — the one place `SweepLane` is
- rendered, on every member page of the lane, already carrying the shared pause and sweep
- under the same `data-lane="backfill"`. One definition, three renders. `LaneHeader.tsx` is
- the RUNNER lanes' header and is not involved; the `/operations` board does not draw the
- sweep lanes.
-3. **Nothing in the four fieldsets is stateful** — no `useState`, everything
- `defaultValue`/`defaultChecked`. Outside reads are only `initial.<block>`, `digestApps`
- (Digest and Attribution), the file-local `Field` (`:1128`), `DigestAppsField`
- (`settings/components/DigestAppsField.tsx`), and one `Link` to `/operations` in the lane
- fieldset. The precedent for a client form with its own scoped action is
- `scheduler/components/SchedulerSettingsForm.tsx` (`useActionState`, `pending`, "Saving…",
- `role="status"` "Saved.", `role="alert"`); the precedent for the action shape is
- `saveLaneOrderAction` (`operations/actions.ts:205-235`: `{...getSettings(), block}`,
- `writeSettings`, `revalidateOperations()` at `:30-33`).
-
-## Step 0 — the docs already in the working tree
-
-`plans/FACTS.md` and `plans/STATE.md` are modified and uncommitted (the census and the
-decision). First action: write this plan verbatim to `plans/editor-ia-slice-3.md` and commit
-the three files together: `plans: slice 3 chosen and planned`. Nothing else in that commit.
-
-## Order: three commits
-
-1. **The seams** — registry `settingsBlock`, `Field` promoted, the four per-block actions
- written beside the old one (nothing rendered yet). tsc + unit-verified.
-2. **The move** — four form components, host slots in `OperationDetail`, fieldsets and blocks
- deleted from `/settings`, markers gone, specs repointed. e2e-verified.
-3. **Copy, pointer, docs** — every "in Settings" sentence that now points at the wrong page,
- a one-paragraph pointer on `/settings`, CHANGELOG, FACTS/STATE/IA doc.
-
-tsc in all six packages + `pnpm -C common test` + editor units after each; e2e once after
-commit 3 (detached — see memory `e2e-run-detached`; the queue lock is serial). Edit nothing
-while it runs.
-
-## Commit 1 — the seams
-
-### `settingsBlock` on the descriptor (`common/lib/operations.ts`)
-
-Off the descriptor, never off the id — the rule slice 2 set for `runner` and `sweepLaneIdFor`.
-Add to `Operation` (the registry-side type) and copy through to `OperationDescriptor` in
-`operationCatalog()`, exactly as `appliesTo` was added in `32950aa`:
-
-```ts
-// The settings.json block that configures this operation, when one does. Named
-// here so the operation page can render that block's form without a table
-// keyed by operation id. Digest owns `digest`; diarization owns `diarization`;
-// both attribution operations share `attribution` (one block, one form, drawn
-// on both pages). The backfill LANE's block (`settings.backfill`) is not an
-// operation's and is not named here — it is rendered per lane, not per operation.
-settingsBlock?: "digest" | "diarization" | "attribution";
-```
-
-Set it on `digest`, `diarization`, `attribution-text`, `attribution-diarized`. External
-operations and `transcode` have none. Test in `operations.test.ts`: the four carry the
-values above, everything else is `undefined`, and the two attribution ids share one.
-
-### `Field` promoted
-
-`SettingsForm.tsx:1128-1162` `Field` (the superset — has `type`/`step` and the load-bearing
-comment about `type="number"` implying `step=1`) → `editor/app/components/forms/Field.tsx`,
-exported. `SettingsForm` imports it. The three other file-local copies (`ChannelForm.tsx:948`,
-`SiteForm.tsx:664`, `OverviewPanel.tsx:168`) are **out of scope** — say so in a comment at the
-top of the new file so the next reader does not "finish" it here.
-
-### Four actions (`editor/app/operations/settingsActions.ts`, new, `"use server"`)
-
-`saveDigestSettingsAction`, `saveDiarizationSettingsAction`, `saveBackfillLaneSettingsAction`,
-`saveAttributionSettingsAction`, each `(prev: SaveResult | undefined, formData: FormData) =>
-Promise<SaveResult>` (reuse `SaveResult` from `settings/actions.ts:41`). Body of each is the
-existing block moved verbatim minus its marker:
-
-```ts
-const current = getSettings();
-const next: SiteSettings = { ...current, digest: { ...current.digest, /* fields */ } };
-try { await writeSettings(next); } catch (e) { return { ok: false, error: (e as Error).message }; }
-revalidateOperations();
-return { ok: true };
-```
-
-- `num(key, fallback)` is currently defined INSIDE the diarization block (`:353`) and reused by
- backfill and attribution — it becomes a module-level helper in the new file.
-- Digest keeps its `digestAppsJson` parse and its `"Digest app config payload is malformed"`
- error; keep `isDigestSectionKind` / `isDigestTimestampMode` imports.
-- Keep each block's existing head comment (what the spread protects: an armed sweep, the
- capture lane, `allowRedownload`, `textOnlyEnabled`) — the marker paragraph is deleted, the
- *why* is not. Add one line: the form that posts here renders every field of this block, and
- is the only form that touches it.
-- No `getWorkerPool().reconfigure` (workers-only), no `revalidatePath("/workers")`.
- `revalidateOperations()` covers `/operations` and `/operations/[id]`; add
- `revalidatePath("/settings")` only if commit 3's pointer shows anything live (it will not).
-- Do NOT touch `saveSettingsAction` in this commit; it still works with the markers. tsc and
- the existing units prove commit 1 alone changes nothing.
-
-## Commit 2 — the move
-
-### Four form components (`editor/app/operations/components/settings/`)
-
-`DigestSettingsForm.tsx`, `DiarizationSettingsForm.tsx`, `LaneSettingsForm.tsx` (the backfill
-lane), `AttributionSettingsForm.tsx`. Each is `"use client"`, takes its block as a prop
-(`initial: SiteSettings["digest"]`, plus `digestApps: DigestAppDescriptor[]` for Digest and
-Attribution), and is:
-
-```tsx
-<form action={formAction} data-settings-block="digest" className="flex flex-col gap-3">
- <fieldset className="… border rounded p-3">
- <legend className="px-1 text-sm font-medium">Digest</legend> {/* verbatim */}
- …the fieldset's existing children, minus the hidden marker…
- <button type="submit" disabled={pending}>{pending ? "Saving…" : "Save digest settings"}</button>
- {state?.ok && <p role="status">Saved.</p>}
- {state && !state.ok && <p role="alert">{state.error}</p>}
- </fieldset>
-</form>
-```
-
-- **Legends verbatim** ("Digest", "Diarization", "Speaker work lane", "Speaker attribution"):
- `settings.spec.ts:190` scopes with `getByRole("group", { name: "Digest" })` — the legend is
- the fieldset's accessible name and keeps that selector valid after only a `goto` change.
-- **Field `name`s verbatim** (`digestTimestampMode`, `diarizationEngine`, …): the actions read
- them and `settings.spec.ts:265` targets `select[name="diarizationEngine"]` by name.
-- **Button text is per block** ("Save digest settings", "Save diarization settings", "Save
- lane settings", "Save attribution settings"): two forms share the attribution pages and the
- backfill member pages, and an unscoped `/save settings/i` would be ambiguous.
-- `data-settings-block` is the spec hook. `role="status"` "Saved." is fine here: the SaveBar
- comment (`SaveBar.tsx:66-68`, "the ONLY role=status on this page") is about RUNNER pages,
- which get no settings form; `auto-subs-replace.spec.ts:415` (`getByRole("status").first()`)
- runs on `/operations/transcription`. Write that boundary into the SaveBar comment.
-- `DigestAppsField.tsx` `git mv`s into the new directory — its only consumer moves.
-- The lane form's paragraph that links to `/operations` for "which operations a sweep runs is
- not set here" is rewritten: the sweep scope is now **directly above this form** on the same
- page. Keep the sentence about why scope is not persisted separately (the resurrected-sweep
- bug); drop the `Link`.
-- Use the 3-tuple `useActionState` with `pending`, as `SchedulerSettingsForm` does.
-
-### Host slots
-
-`OperationDetail` gains two optional props: `operationSettings?: ReactNode` and
-`laneSettings?: ReactNode`. `SweepOperationView` renders them after `<SweepLane>` (`:167`):
-operation block first, lane block second, inside the same `section[data-lane]` — so the
-existing scoped selectors (`backfill.spec.ts:477`, `auto-queue.spec.ts:1210`) still find the
-lane's controls, and the new forms are inside the scope those specs use. Checked: nothing in
-the four fieldsets carries a label matching `Order`/`Reach` (exact), `/sweep$/i`, or the two
-sweep-scope checkbox labels.
-
-`/operations/[id]/page.tsx` (server) builds them:
-
-```ts
-const settings = getSettings();
-const digestApps = op.settingsBlock === "digest" || op.settingsBlock === "attribution" ? listDigestApps() : [];
-const operationSettings = formForBlock(op.settingsBlock, settings, digestApps); // small switch on the BLOCK, not the id
-const laneSettings = laneId === "backfill" ? <LaneSettingsForm initial={settings.backfill} /> : null;
-```
-
-`formForBlock` is a `switch` over the three block names — a table keyed by settings block,
-which is data the descriptor declared, not a table keyed by operation id. The digest lane's
-own lane facts (`sweepEnabled`, order/reach) are already in the Digest block and the
-`OrderReach` control, so `laneSettings` for `digest` is `null`.
-
-### `/settings` loses the four
-
-Delete `SettingsForm.tsx:526-1087` and the four blocks in `saveSettingsAction`
-(`:264-448`), the four `*FormPresent` reads, and the four keys at `:491-494` — the `next`
-object then carries `digest/diarization/backfill/attribution: getSettings().<block>` with the
-same one-line comment the `autoQueue` and `savedVideoBackup` keys already have ("edited on its
-own page; preserved here"). Drop `digestApps` from `SettingsForm`'s props and from
-`settings/page.tsx` if nothing else reads it (`workerTags` and `apps` stay). Remove now-unused
-imports (`DIGEST_SECTION_OPTIONS` etc., `isDigestSectionKind`, `isDigestTimestampMode`,
-`DigestAppsField`, `Link` if unused).
-
-### Specs
-
-- **`settings.spec.ts:179`** (digest round-trip) → `goto("/operations/digest")`, scope to
- `page.locator('form[data-settings-block="digest"]')`, click `Save digest settings`, status
- inside that form. Move it to a new `editor/e2e/operation-settings.spec.ts`.
-- **`:221`** (unrelated save does not reset the digest prompt shape) → becomes the genuine
- cross-form test it always described: set the digest fields on `/operations/digest`, save,
- then `goto("/settings")`, change `admin title`, save, read `test-settings.json`. Keep its
- comment about React 19 resetting `<form action>` inputs — it still explains the reload.
- Add a second half in the same file: save the **lane** form on `/operations/diarization`
- with `Run the backfill lane` ticked, then save the **diarization** form on the same page,
- and assert `backfill.enabled` survived — that is the property the markers used to protect,
- now proven structurally.
-- **`:265`** (sortformer round-trip) → `goto("/operations/diarization")`, scope to
- `form[data-settings-block="diarization"]`; the by-name selectors are unchanged.
-- **New**: attribution round-trip on `/operations/attribution-text` (tick
- `attributionTextOnly`, set `attributionModel`, save, read back) and the same form present on
- `/operations/attribution-diarized` (one assertion that the fieldset renders there). The
- attribution and lane fieldsets had **no form-driving spec at all** before.
-- `settings.spec.ts` keeps everything else (`:8-178`); the `page.locator("form")` selectors at
- `:124/:133` stay unambiguous — there is still exactly one form on `/settings`.
-- `backfill.spec.ts`, `attribution.spec.ts`, `worker-unit.spec.ts` set these blocks through
- `writeSettings()` (`e2e/helpers.ts:66`), never the form — unaffected.
-
-## Commit 3 — copy, the pointer, docs
-
-**Copy that says "in Settings" about a switch that moved** (from FACTS; each becomes "on its
-operation page" with a link where the component can hold one):
-`OperationDetail.tsx:150` ("switched off in Settings" — it is now switched off *on this page*,
-below; say "below"), `SweepLane.tsx:218`, `SpeakersStage.tsx:144`, `ChannelGroupLine.tsx:184`
-(title), `groupActions.ts:108` (skip reason string — `channel-groups.spec.ts` does not assert
-it; check before changing), `DigestStage.tsx:210` and `DigestPanel.tsx:144` ("metered —
-disabled in Settings" → "on the Digest page"). The disk-floor sentences ("lower the floor in
-Settings", four sites) stay — the floor did not move.
-
-**`/settings` pointer**: one `<p>` at the top of `SettingsForm` (or `settings/page.tsx`):
-"Digest, diarization, the speaker work lane and speaker attribution are configured on their
-operation pages" with four links. Not a fieldset, no form. The IA rule "fold rather than
-add; every retired route redirects" does not apply — no route retires.
-
-**Docs**: `editor/CHANGELOG.md` (user-visible: the four blocks moved, the buttons are per
-block, `/settings` is machine + site settings); `plans/editor-operations-ia.md` slice 3 bullet
-→ "SHIPPED" with a "Slice 3, as shipped" section recording the two decisions (lane block per
-lane not per operation; `settingsBlock` on the descriptor rather than an id table);
-`plans/STATE.md` dated entry + "Recommended next" (#6 done, #2 next); `plans/FACTS.md` a short
-"as shipped" note under the seams section (the new file paths; markers gone; the SaveBar
-`role="status"` boundary).
-
-## Verification
-
-1. After each commit: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export homepage
- umtool mcp`; `pnpm -C common test` (828+ — the `settingsBlock` test); editor units
- `pnpm -C editor exec tsx --test "app/**/*.test.ts"` (85+).
-2. Grep gates after commit 2, over `editor/`: `FormPresent` → 0; `Save settings` → exactly
- the one on `/settings` (+ its spec regex); `saveSettingsAction` no longer reads
- `digest|diarization|backfill|attribution` form fields (grep `formData.get("digest` etc. in
- `settings/actions.ts` → 0); `DigestAppsField` imported only from the new directory.
-3. e2e once after commit 3, detached (`setsid nohup … pnpm e2e -- <specs>`, log monitor),
- filenames only after `--`: `operation-settings.spec.ts settings.spec.ts auto-queue.spec.ts
- auto-subs-replace.spec.ts backfill.spec.ts attribution.spec.ts channel-groups.spec.ts
- digest.spec.ts` (whichever digest-stage spec asserts the "metered — disabled" copy; check
- with grep first). Known flakes from the slice-2 run (`auto-queue.spec.ts:411` race; the
- Videos-tab 5 s `toHaveURL` on a cold compile) are not this slice's — retry individually.
-4. Manual, on the e2e fixture, never `transcripts/`: `PORT=3021 pnpm dev:test`;
- `/operations/digest` shows the Digest form under the lane and saving it persists to
- `editor/test-settings.json`; `/operations/diarization` shows Diarization then Speaker work
- lane; `/operations/attribution-text` and `/attribution-diarized` show Speaker attribution
- then Speaker work lane; `/operations/download` and `/operations/transcode` show no form;
- `/settings` has no operation fieldset and carries the pointer; kill the server, remove
- `editor/test-transcripts` and `editor/test-settings.json`, `git status` clean.
-
-## Out of scope
-
-Unified-ops step 1 (next). The three other file-local `Field` copies. `WorkersField`
-(slice 8), the pause trio (slice 7), `/actionable` (slice 4). Persisted keys and field
-`name`s do not change. No redirect — no route retires.
diff --git a/plans/editor-ia-slice-4.md b/plans/editor-ia-slice-4.md
@@ -1,470 +0,0 @@
-# Editor IA slice 4 — `/actionable` dissolves
-
-## Context
-
-**Verified read-only against `184cb9f` (clean) on 2026-08-28.** `/actionable` is the fourth
-answer to "what needs doing" (`plans/editor-operations-ia.md:21`): one 696-line page
-(`editor/app/actionable/page.tsx`) rendering ten `SectionConfig`s from a literal array
-(`:92-321`) plus two hand-written sections (`DuplicatesSection :421-475`, `MediaScanSection
-:356-419`), behind a hand-exhaustive `nothingPending` gate (`:77-90`). Slice 4 was unblocked
-by unified-ops step 1 (`STATE.md:204-206`). The IA doc's slice-4 bullet (`:137-152`) and
-reconciliations (`:93-97`) say where things go: per-operation sections onto
-`/operations/<id>`, digest review + uncertain attribution as that page's *attention*
-section, duplicates (and later viewer feedback / context promotion) to a small `/review`
-under Corpus, the rest to `/cleanup`, Sites and the dashboard; `loadActionable.ts` survives
-for the widget; the `SectionConfig` extension point moves with the sections.
-
-**Decided (operator, 2026-08-28):** (a) the two runner pages get a per-channel work table —
-`RunnerOperationView` has none today; (b) stale/missing reports, the per-row *refresh
-report* and *update all reports* go to `/channels`; (c) `/review` holds duplicate clusters
-**and** media-integrity findings — both are human judgements with reviewed state, neither is
-an operation or bytes, so `/cleanup` stays about reclaimable disk.
-
-**Five findings that shape the design (the first two correct the IA bullet):**
-
-1. **The dashboard's digest number does not move — it already IS the band's `reachable`.**
- `actionableNoDigestCount` (`loadActionable.ts:142-144`) returns
- `digestWorkOf(row.snapshot).reachable`, the same `reachableOperationWork` that
- `buildBands.ts:63` folds. So "drop `noDigest` for band `reachable`" is a **rename** with
- honest labels (`noDigest` → `digestReachable`; "No digest" → "Digest to do"), not a
- re-sourcing. The changelog says the name changes and the number does not.
-2. **`MonitorWidget` never reads `noDigest`** (`ActionableStrip` reads slug / undownloaded /
- untranscribed; `LaneDeck.tsx:81-82` likewise). Readers: `page.tsx:80,92`,
- `NeedsWorkPanel.tsx:74-79`, `dashboard/ChannelsTable.tsx:69`, `dashboard/types.ts:21`,
- `api/widget/actionable/route.ts:24,42`. The wire field can be renamed.
-3. **The review half of the summary has no consumer outside the page** —
- `summary.duplicates / duplicateOverrides / mediaScan / mediaScanOverrides`
- (`loadActionable.ts:52-64`, loaded `:194-201`) are read only by `actionable/page.tsx:341-348`.
- The dashboard and the widget poll pay the 6.7 MB duplicates parse for nothing. The loader
- splits: channel-work half keeps its names; review half becomes `loadReviewSummary`.
-4. **`SweepPlan`'s `sweep <slug>` checkbox exists only while choosing a scope**
- (`SweepPlan.tsx:171-174`), and its total is a **cross-kind sum by design** (`bandForScope`,
- `:92-96`). The repointed `backfill`/`attribution` assertions target the lane section's row
- text and `LaneFigures` ("N reachable now" / "N blocked upstream", `SweepLane.tsx:330-335`).
- `attribution.spec.ts:362`'s "3" (1 diarized + 2 text) is dropped: per-operation pages split
- it by construction; the sum still lives on the channel page's speakers stage (`:341-343`).
-5. **`/cleanup` is the pool view that lists a snapshot-less channel by label**
- (`ChannelCleanupCard` = `<section aria-label="cleanup <slug>">`, `:49`; the page reads no
- `searchParams`), so `site-scope.spec.ts:95-104` re-homes there. `SweepPlan` puts unknown
- channels into a count, not rows.
-
-**Contradiction to fix in passing:** the IA doc's nav end state (`:66-73`, "eleven", Corpus =
-Dashboard, Channels) omits `/review` while `:93-97` promises it; `nav.ts:44` says eleven. After
-this slice it is twelve. `PLAN.md` 11a is already revised (`:519-521`) — no edit.
-
-**Hazards carried through every commit (slice 3's lesson):** a labelled `<section>` landing
-inside `section[data-lane]` puts its prose and labels into every scoped selector; `getByText`
-/ `getByLabel` match substrings; the runner section's contract
-(`RunnerOperationView.tsx:21-35`) forbids any nested `<section>` and reserves `role="status"`
-(`auto-subs-replace.spec.ts:415` takes `getByRole("status").first()` on
-`/operations/transcription`). Everything new here renders **outside** `section[data-lane]` and
-the runner `<section>`, and carries no `role="status"`.
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/editor-ia-slice-4.md` and commit it alone:
-`plans: slice 4 planned`.
-
-## Order: six commits after the plan
-
-1. **The seams** — `SectionConfig` + `ChannelWorkTable` extracted; loader, actions,
- `InlineActionButton`, `FixAllIncompleteButton` moved out of the route; review loader split.
- `/actionable` renders identically from the shared module. Zero behaviour change.
-2. **Operation pages + dashboard** — `channelWork` slot on `OperationDetail`; sections on
- `/operations/download|transcription|digest`; `noDigest` → `digestReachable`; dashboard
- links → `/operations`; revalidation targets. Specs repointed.
-3. **`/channels` reports + `/cleanup` sections.** Specs repointed.
-4. **`/review`** — page, Corpus nav entry, four review components + four actions moved under
- it. `duplicate-shorts.spec.ts` repointed; new `review.spec.ts`.
-5. **Retire** — delete `editor/app/actionable/`, the redirect, the nav entry, every
- `revalidatePath("/actionable")`, the prose sweep.
-6. **Docs** — CHANGELOG, IA doc, STATE, FACTS, memory.
-
-Gates after each of 1–5: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export homepage
-umtool mcp`; `pnpm -C common test` (861); `pnpm -C editor exec tsx --test "app/**/*.test.ts"`
-(85 → 86+ with `sections.test.ts`). e2e once after commit 6, detached (memory
-`e2e-run-detached`), on the spec list in Verification. Edit nothing while it runs.
-
----
-
-## Commit 1 — `editor: the channel-work table and its census leave the /actionable route` (zero behaviour change)
-
-### `SectionConfig` and the eight configs that survive → `editor/app/components/channelWork/sections.tsx`
-
-Move the type from `page.tsx:50-66` and give it an owner and a role:
-
-```ts
-export type SectionConfig = {
- id: string;
- // The page that renders this section: an operation id for sections that are one
- // operation's work, or null for the two cleanup sections (Storage, /cleanup's).
- // The extension point moved with the sections; it did not disappear.
- operation: "download" | "transcription" | "digest" | null;
- // "work" is what the runner or sweep will do; "attention" is what a human must
- // look at first — a truncated download is not one the runner can retry.
- role: "work" | "attention";
- // Which summary list this section draws — declared here so no page hand-pairs a
- // config with a list (the old page.tsx:92-321 pairing was the same hand-
- // exhaustiveness as its nothingPending gate).
- getRows: (summary: ActionableSummary) => ActionableRow[];
- title; description; countLabel; emptyLabel; getCount; extraColumn?; primaryAction;
- headerAction?: React.ReactNode;
-};
-export function channelWorkSections(): SectionConfig[] // a function: headerAction is an element
-export function sectionsFor(operation: SectionConfig["operation"]): SectionConfig[] // work first, then attention, declaration order
-```
-
-The eight, moved verbatim from `page.tsx`: `undownloaded` (`:93-109`, download/work),
-`missing-never-fetched` (`:110-130`, download/attention), `untranscribed` (`:131-151`,
-transcription/work), `incomplete-transcripts` (`:152-181`, transcription/attention,
-`headerAction: <FixAllIncompleteButton />`), `digest-warnings` (`:182-202`, digest/attention),
-`short-audio` (`:235-260`, download/attention), `clean-transcribed-audio` (`:261-281`, null),
-`clean-extra-formats` (`:282-303`, null). **`speakers` (`:203-234`) and `stale-reports`
-(`:304-320`) stay page-local** — they die with the page in commit 5.
-
-Unit test `sections.test.ts` (editor units): ids unique; every `getRows` returns a distinct
-field of an `ActionableSummary` literal; `sectionsFor("download")` = `[undownloaded,
-missing-never-fetched, short-audio]`; `("transcription")` = `[untranscribed,
-incomplete-transcripts]`; `("digest")` = `[digest-warnings]`; `(null)` = the two cleanup ids.
-
-### `ChannelWorkTable` → `editor/app/components/channelWork/ChannelWorkTable.tsx` (server component — `primaryAction` is a function and cannot cross to a client component)
-
-```tsx
-export function ChannelWorkTable({ sections, summary }: { sections: SectionConfig[]; summary: ActionableSummary })
-```
-
-`Section` (`page.tsx:553-617`) and `Row` (`:619-696`) ported verbatim with the aria contract
-intact — `<section aria-label={config.id}>`, `<h2>{title}</h2>`, `<p aria-label="<id> empty">`,
-`<tr aria-label="<id> row <slug>">`, columns Slug / countLabel / [extra] / Last report / Last
-sync / Actions, `refreshReport` `InlineActionButton` on every row. Two safe simplifications
-because `stale-reports` is not in the module: the `sectionId === "stale-reports"` cell branch
-(`:653-659`) and guard (`:687-691`) go; `Row`'s own `isStale` (`:635-638`) becomes the loader's
-`isStaleOrMissing(row)` (`loadActionable.ts:67-72`, of which it was a copy). Header comment:
-the aria contract is load-bearing for `channel-work.spec`, `cleanup-actionable.spec`,
-`incomplete-transcript.spec`, `download-format-guard.spec`; **never add `role="status"` here**
-(renders on RUNNER pages).
-
-### Moves (`git mv`, imports repointed, no other edits)
-
-| From | To | Importers to repoint |
-|---|---|---|
-| `actionable/lib/loadActionable.ts` | `editor/app/lib/actionable/loadActionable.ts` | `api/widget/actionable/route.ts:3-8`, `page.tsx:10-15,23`, `actionable/page.tsx:10-25`, `actions.ts:29`; its own `../../lib/requestCache` → `../requestCache` |
-| `actionable/actions.ts` | `editor/app/lib/actionable/actions.ts` | `CommandPalette.tsx:27-30`, the components below; its own `../channels/[slug]/incompleteTranscriptActions` → `../../channels/[slug]/…`, `./lib/loadActionable` → `./loadActionable` |
-| `actionable/components/InlineActionButton.tsx` | `editor/app/components/actions/InlineActionButton.tsx` | `components/dashboard/ChannelsTable.tsx:7`, `components/dashboard/NeedsWorkPanel.tsx:5`, `channels/[slug]/components/NoReportYet.tsx:2`, `channels/[slug]/components/flow/NextAction.tsx:2`, `widget/components/MonitorWidget.tsx:18`, `actionable/page.tsx:26`. Its own `../../channels/…` imports are the same depth — unchanged |
-| `actionable/components/FixAllIncompleteButton.tsx` | `editor/app/components/channelWork/FixAllIncompleteButton.tsx` | its `../actions` → `../../lib/actionable/actions` |
-
-The other five components (`RefreshAllReportsButton`, `RunDuplicateDetectionButton`,
-`DuplicateClusterReview`, `RunMediaScanButton`, `MediaScanFindingRow`) stay in
-`actionable/components/` for now, repointing only `../actions` → `../../lib/actionable/actions`;
-each moves in the commit that gives it a home (3 and 4). `DiagnosticsStage.tsx:31` untouched
-until commit 4.
-
-### The review loader split → `editor/app/lib/review/loadReview.ts`
-
-`ActionableSummary` loses `duplicates`, `duplicateOverrides`, `mediaScan`, `mediaScanOverrides`
-(`:52-64`); `loadActionableSummary` loses the four reads (`:194-201`, `:283-286`). New:
-
-```ts
-export type ReviewSummary = { duplicates: DuplicateReport | null; duplicateOverrides: DuplicateOverrides; mediaScan: MediaScanReport | null; mediaScanOverrides: MediaScanOverrides };
-export async function loadReviewSummary(paths: Paths): Promise<ReviewSummary> // same four reads, same Promise.all, getDuplicateReport via ../requestCache
-```
-
-Carry the field comments (`:53-57`, `:59-62`) verbatim. `actionable/page.tsx` calls both
-loaders — same render. `requestCache.ts:35-37` comment corrected: only `/review` reads the
-duplicates report now.
-
-### `actionable/page.tsx` after commit 1
-
-Imports the eight from `sections.tsx`, renders `<ChannelWorkTable sections={[
-...channelWorkSections(), speakersConfig, staleReportsConfig]} summary={summary} />` behind
-the unchanged `nothingPending` gate. Aria output byte-identical; tsc proves the wiring.
-
----
-
-## Commit 2 — `operations: each operation page lists the channels with its work, and the dashboard says "digest to do"`
-
-### The slot
-
-`OperationDetail.tsx` gains `channelWork?: ReactNode` beside `operationSettings`/`laneSettings`
-(`:69-70`) and renders it **after** the three-way branch (`:82-107`), inside the outer `div`
-(`:75`), outside every `section[data-lane]` and the runner `<section>`. Comment: outside
-deliberately — inside the runner section it would be a nested `<section>`
-(`RunnerOperationView.tsx:26-28`); inside the sweep section its headings and slugs would land
-in every `section[data-lane]`-scoped `getByText` (`backfill.spec.ts:477-484`). Below the
-console: the console is the operation; the table is what waits for it.
-
-`/operations/[id]/page.tsx` (`:190-217`):
-
-```ts
-const sections = sectionsFor(op.id as SectionConfig["operation"]); // [] for diarization, attribution-*, transcode — the cast is safe only because unknown ids return []
-const channelWork = sections.length > 0
- ? <ChannelWorkTable key="channel-work" sections={sections} summary={await getActionableSummary(paths)} />
- : null;
-```
-
-`getActionableSummary` reuses the briefs `buildAutoQueueStatusPayload()` already read via
-`getChannelBriefs` (`requestCache.ts:31-33`) — no extra disk read.
-
-Collision check (done against `auto-queue.spec.ts` and `auto-subs-replace.spec.ts`):
-`locator("section", { has: heading "Auto-transcribe" })` matches by descendant and the new
-sections are siblings; `getByRole("heading", { name: "Transcription", exact: true })` (`:375`)
-and `{ name: "Other" }` count-0 (`:545,1269`) match none of the six titles;
-`section[data-lane]` counts (`:1108,1163`) unaffected; `role="status"` stays reserved. On
-`/operations/digest` the warnings section is outside `section[data-lane="digest"]`, so
-`operation-settings.spec.ts` scopes see nothing new. Two `refresh report <slug>` buttons can
-appear on `/operations/download` (a channel in both `undownloaded` and `short-audio`) — same as
-the old page; `actionable.spec.ts:165-167` already takes `.first()`.
-
-### The dashboard rename
-
-- `loadActionable.ts:142` `actionableNoDigestCount` → `actionableDigestReachableCount`; comment:
- "the digest band's `reachable`, per channel — `buildBands.ts:63` folds the same call".
-- `api/widget/actionable/route.ts:24,42` `noDigest` → `digestReachable`; the `:16-23` comment
- keeps its argument (still not a filter criterion), drops "historically the noDigest bucket".
-- `page.tsx:80,92`; `dashboard/types.ts:21` (comment: "the digest band's reachable — what the
- lane could act on today; not blocked, not deferred"); `NeedsWorkPanel.tsx:74-79` (badge
- reads `c.digestReachable`, title "N video(s) the digest lane can work on now");
- `dashboard/ChannelsTable.tsx:36-40` header "Digest to do", title "Videos the digest lane can
- work on now — the same reachable figure the /operations rail draws; blocked and deferred are
- not in it", cell `:69`.
-- `NeedsWorkPanel.tsx:31,101` hrefs → `/operations`; `:11` comment "as /actionable" → "as the
- operation pages".
-
-### Revalidation
-
-`lib/actionable/actions.ts` `clearAllIncompleteTranscriptsAction` (`:232`) and
-`redownloadAllIncompleteTranscriptsAction` (`:252`) → `revalidatePath("/operations/[id]",
-"page")` (the shape `operations/actions.ts:30-33` documents). `refreshAllChannelSnapshotsAction`
-(`:105-106`) → `/channels`, `/`, `/operations/[id]` page, `/cleanup` (comment `:87-90,100-103`
-"/actionable" → "the pages that read the snapshots"). `pipelineActions.ts:213` and
-`snapshotScheduler.ts:203` → `revalidatePath("/operations/[id]", "page")` +
-`revalidatePath("/cleanup")` (keep the lazy-import shape at `snapshotScheduler.ts:196-204`).
-**Leave the old `"/actionable"` lines in place until commit 5** so the page is still
-revalidated while it exists.
-
-### Specs
-
-- `actionable.spec.ts` → `git mv` to `channel-work.spec.ts` (header: "the channel-work tables
- on the operation pages, and the report controls on /channels"). This commit: T3 (`:39-61`)
- `goto("/operations/download")`; T4 (`:63-77`) `/operations/transcription`; T8 (`:189-207`)
- `/operations/download`; T9 (`:209-227`) `/operations/transcription`; T10 (`:236-251`)
- `a[href="/operations"]`; T1 (`:18-29`) rewritten: `resetData("empty")`,
- `goto("/operations/download")`, `getByLabel("undownloaded empty")` contains "Nothing
- pending." — the page-wide empty state is gone with the gate. T2, T5, T6, T7 move in commit
- 3; T11 unchanged.
-- `incomplete-transcript.spec.ts:127,222,257,280` → `/operations/transcription`; titles
- `:80,215,250` "actionable" → "transcription page"; the poll `:275-283` keeps its shape.
-- `download-format-guard.spec.ts:156-157` → `/operations/download`.
-- `backfill.spec.ts:747-773` → `goto("/operations/diarization")`; `const lane =
- page.locator('section[data-lane="backfill"]')`; `expect(lane).toContainText(SLUG)` (the plan
- row, `SweepPlan.tsx:193-200`; the fixture has a snapshot so the row is in `working`);
- `expect(lane.getByText(/need their media back first/)).toBeVisible()` (`:140-152`; vidB's
- audio is removed at `:758-760` so `missingInput > 0`). Comment records the dropped
- "not hidden behind nothing pending" property.
-- `attribution.spec.ts:356-365` → `goto("/operations/attribution-diarized")`, lane contains
- `CHANNEL`, `lane.getByText("1 reachable now")`, `lane.getByText("1 blocked upstream")`; then
- `goto("/operations/attribution-text")`, `lane.getByText("2 reachable now")`. The "3" is
- dropped (finding 4); the comment says where the sum lives (`:341-343`).
-
----
-
-## Commit 3 — `channels: the report column and its refresh live with the channels; cleanup: the two cleanup tables live with the bytes`
-
-### `/channels`
-
-- `RefreshAllReportsButton.tsx` → `editor/app/channels/components/`;
- `refreshAllChannelSnapshotsAction` (`lib/actionable/actions.ts:42-108`, with
- `RefreshAllResult :31-34`) → `editor/app/channels/actions.ts` (already `"use server"`, holds
- `refreshChannelSnapshotAction :294-304`); `CommandPalette.tsx:27-30` and the button repoint.
- `refreshChannelSnapshotAction :302` gains `revalidatePath("/channels")` and
- `revalidatePath("/operations/[id]", "page")` so a row action flips the marker beside it.
-- `channels/page.tsx:158-166` header: `<RefreshAllReportsButton />` between
- `SyncAllChannelsButton` and "New channel". Aria (`update all reports`, `… result`, `… error`)
- unchanged; nothing on `/channels` shares the words.
-- `ChannelRow` (`channels/components/ChannelsTable.tsx:24-26`) gains `report: { generatedAt:
- string | null; state: "current" | "stale" | "missing" }`, built in `channels/page.tsx:134-137`
- from `briefs` via new `reportStateOf(brief)` in `lib/actionable/loadActionable.ts`
- (`isStaleOrMissing` becomes `reportStateOf(...) !== "current"`). New column "Report" after
- "Last sync" (`:261`): `SortableTh` `sortKey: "report"` (`compareDates` on `generatedAt`,
- `DEFAULT_DIR.report = "asc"` so stale surfaces first); cell `<Td ariaLabel={`report age for
- ${slug}`} className={state === "current" ? … : "text-warning"}>` showing `stale` / `missing`
- / the date. `colSpan` (`:196`) → `9 + columns.length`. `channels-sort.spec.ts:22-30` iterates
- a fixed header list; `channel-groups.spec.ts:69` counts `rowheader`s — neither breaks.
- Actions cell (`:436-441`) gains `<InlineActionButton variant={{ kind: "refreshReport", slug }} />`.
-- Footer (`:197-202`, "Run *Refresh report* from a channel") → "…from a row here, or *Update
- all reports* above".
-
-### `/cleanup`
-
-`cleanup/page.tsx`: load `getActionableSummary(paths)` beside `loadCleanupSummary` (same
-briefs, request-cached); render `<ChannelWorkTable sections={sectionsFor(null)}
-summary={summary} />` **after** the `channel cleanup ledger` section (`:123-138`), before the
-footnote (`:141-151`). Below because the page is an argument in order (hero → sieve → release
-ledger → cards); the tables are the "do it" step. Not merged into `ChannelCleanupCard` (out of
-scope; say so in a comment).
-
-Collision check (done): the card's "Clean audio" is a `StreamActionLog` whose button has no
-aria-label (`common/components/StreamActionLog.tsx:178-185`), so `getByRole("button", { name:
-"clean audio test-transcribe" })` matches only the table's button; the log's
-`aria-label="Clean audio test-transcribe error"` (`:211`) and the table's differ only by case
-and neither is asserted — note in the table's header comment.
-
-Links: `cleanup/page.tsx:143` and `HoldSieve.tsx:307` → `/channels` (text "Refresh reports"
-stays — `cleanup-holds.spec.ts:201` asserts it).
-
-### Specs
-
-- `channel-work.spec.ts` T5 (`:79-114`) → `goto("/channels")`, `getByLabel("report age for
- test-youtube")` contains "stale"; T6 (`:116-146`) `goto("/channels")`; T7 (`:148-187`)
- `goto("/channels")`, drop `.first()`; T2 (`:31-37`) → "Actionable is gone from the
- sidebar": `aside` link `/^Actionable$/` `toHaveCount(0)`.
-- `cleanup-actionable.spec.ts:52,83,102,126` → `/cleanup`; header comment gains one line.
- Name kept.
-- `site-scope.spec.ts:95-104` → `goto("/cleanup?site=alpha")`, `getByRole("region", { name:
- "cleanup slow-a", exact: true })` and `slow-b` visible; comment "/cleanup is a shared-pool
- view and lists every channel, snapshot or not". (Slice 5 owns `:63-87` of the same file —
- touch nothing else there.)
-
----
-
-## Commit 4 — `review: the judgements a person makes about the archive get a page under Corpus`
-
-- `editor/app/review/page.tsx` (`dynamic = "force-dynamic"`, `metadata.title = "Review"`,
- `<h1>Review</h1>`): `loadReviewSummary(paths)`, then `DuplicatesSection`,
- `DuplicateClusterCard`, `Badge`, `MediaScanSection` moved verbatim from
- `actionable/page.tsx:353-551` (aria `duplicate-shorts`, `duplicate-shorts empty`, `duplicate
- cluster <id>`, `media scan`, `media scan empty`, `media finding <key>` unchanged). One intro
- paragraph: "Corpus review — findings a human decides, not work a lane runs."
- `loadReview.ts` may `git mv` to `review/lib/`.
-- Components → `editor/app/review/components/`: `RunDuplicateDetectionButton`,
- `DuplicateClusterReview` (comment `:33-37` "/actionable renders a page heavy enough" →
- "/review"), `RunMediaScanButton` (`DiagnosticsStage.tsx:31` repoints), `MediaScanFindingRow`.
-- Actions → `editor/app/review/actions.ts` (`"use server"`): `runDuplicateDetectionAction`
- (`:110-141`), `reviewDuplicateClusterAction` (`:143-204`), `runMediaScanAction` (`:257-300`),
- `reviewMediaFindingAction` (`:302-320`) with their types; `revalidatePath("/actionable")` at
- `:139,199,298,315` → `"/review"`. `CommandPalette.tsx` imports `runDuplicateDetectionAction`
- from `../review/actions`. `lib/actionable/actions.ts` keeps the two incomplete actions.
-- `nav.ts:62-69` Corpus gains `{ href: "/review", label: "Review", icon: ClipboardCheck,
- keywords: "duplicates duplicate shorts media integrity scan corrupt review queue" }`
- (`ClipboardCheck` is in the installed lucide).
-- Specs: `duplicate-shorts.spec.ts:207,287,342` → `/review`; `:9` comment. New
- `review.spec.ts`: `resetData("empty")`, `/review` renders the h1, `getByLabel("duplicate-shorts
- empty")` "Run detection to scan.", `getByLabel("media scan empty")` "Run a scan to check the
- media on disk." (media scan had no e2e at all), sidebar Corpus link `Review` has
- `href="/review"`.
-
----
-
-## Commit 5 — `editor: /actionable retires and redirects to /operations`
-
-- `git rm -r editor/app/actionable/`. With it: the `speakers`/`stale-reports` configs,
- `laneAction` (`page.tsx:74-76`), `nothingPending`, and from the loader the `backfill` /
- `staleOrMissing` lists (`:49,51,263-269`), `actionableBackfillCount` /
- `actionableBackfillMissingInputCount` (`:150-179`; no other consumer — the guard lives in
- `backfillLaneEntriesOf`, tested at `operations.test.ts:1503`). `reportStateOf` stays.
-- `next.config.ts:57-61`: add `{ source: "/actionable", destination: "/operations", permanent:
- false }`; extend the comment in the same voice — "/actionable was four answers to 'what needs
- doing' on one page; its sections live with the operation, `/channels`, `/cleanup` and
- `/review` now, and the board is where a bookmark lands. Temporary (307) for the reason
- above." (`permanent: false` is 307; query strings pass through — `node_modules/next/dist/docs/…/redirects.md`.)
-- `nav.ts`: delete `:79-81` and the `TriangleAlert` import (`:17`, only use); `:44` "eleven"
- → "twelve"; Operations link keywords (`:77`) gain `actionable needs attention todo`.
-- `revalidatePath("/actionable")` residue: `pipelineActions.ts:213`, `snapshotScheduler.ts:203`,
- any left in `lib/actionable/actions.ts` — grep gate.
-- Prose sweep (comments only): `common/controller/channels.ts:241`, `channelSnapshot.ts:93,269`,
- `digestSharing.ts:283` ("/review's per-cluster action"), `common/lib/operations.ts:34,60,1531,1575`
- ("/actionable's backfill rows" → "the /channels speaker columns"; `:1575` name the widget
- sync payload and the channel stage), `duplicates.ts:332` ("/review"), `LaneDeck.tsx:76,607`
- ("the widget payload"), `stageStatus.ts:457`, `DigestStage.tsx:5`, `SpeakersStage.tsx:20,123`
- ("the /channels station and the operation pages"), `requestCache.ts:9,28-29`,
- `InlineActionButton.tsx:52` ("see sections.tsx"), `MonitorWidget.tsx:827,917`,
- `incompleteTranscriptActions.ts:35`, `api/widget/actionable/route.ts:30-34`,
- `operations.test.ts:1509`, `widget.spec.ts:26,251,320`, `navigation.spec.ts:35-36`.
-- Specs: `navigation.spec.ts:43` deleted; new test "a retired route redirects, never 404s":
- `goto("/actionable")`, `toHaveURL(/\/operations$/)`, heading "Operations" (shape of
- `auto-queue.spec.ts:1125-1132`).
-
----
-
-## Commit 6 — `plans: slice 4 shipped, and the docs say where everything went`
-
-- `editor/CHANGELOG.md` `[Unreleased]`, first bullet, house voice (slice 3's bullet at `:11` is
- the model): the operation pages list the channels with that operation's work and its
- attention items; `/channels` carries report freshness and the refresh controls; `/cleanup`
- carries the two cleanup tables; `/review` (Corpus) holds duplicate clusters and
- media-integrity findings; `/actionable` redirects to `/operations`. **Nothing on disk changes
- — no snapshot field, no settings key, no widget section id.** The dashboard's "No digest"
- badge/column is now "Digest to do", the same number under its right name; the widget payload
- field `noDigest` is `digestReachable`.
-- `plans/editor-operations-ia.md`: `:71` drop "Actionable until slice 4"; `:70` Corpus =
- Dashboard, Channels, Review; `:68` twelve; bullet 4 → SHIPPED with hashes; a "Slice 4, as
- shipped" section recording: the rename-not-resourcing finding; the review-loader split and
- why; the slot outside `data-lane`; the dropped "nothing pending" property; the "3" that stayed
- on the channel page; `/cleanup` as the pool re-home.
-- `plans/STATE.md`: "Last updated" prepend; "Recommended next" #3 → DONE with the plan link;
- the `:239-242` note gains "renamed in slice 4".
-- `plans/FACTS.md`: `## Verified 2026-08-28 — editor IA slice 4 seams` (census + "As shipped",
- the slice-3 template at `:2249`); table row `:820` ("Actionable sections") → the new paths;
- the "Retired editor routes" row gains `/actionable`.
-- Memory: new `ia-slice-4-shipped.md` (+ `MEMORY.md` line); amend `slice-3-chosen-next` index
- line (slice 4 done; next candidates: slice 7 one-pause, slice 5, Phase 6).
-
----
-
-## Verification
-
-1. After each of commits 1–5: tsc in `common editor export homepage umtool mcp`; `pnpm -C
- common test` (861); editor units (85 → 86+).
-2. Grep gates after commit 5, over `editor/ common/` excluding `node_modules`: `"/actionable"`
- → only `next.config.ts` (redirect), `navigation.spec.ts` (redirect test), and
- `api/widget/actionable` path strings; `actionable/` as an import path → only
- `api/widget/actionable`; `noDigest` in `editor/app` → only `DigestStage`'s `noDigestIds` and
- `channels/[slug]/page.tsx:427` (channel page, out of scope); `TriangleAlert` → 0;
- `nothingPending` → 0; `revalidatePath("/actionable")` → 0.
-3. e2e once after commit 6, detached (`cd editor && setsid nohup sh -c 'pnpm e2e -- <specs>;
- echo exit=$?' > $CLAUDE_JOB_DIR/tmp/e2e.log 2>&1 < /dev/null & disown`; filenames only):
- `channel-work.spec.ts cleanup-actionable.spec.ts review.spec.ts site-scope.spec.ts
- navigation.spec.ts backfill.spec.ts attribution.spec.ts incomplete-transcript.spec.ts
- download-format-guard.spec.ts duplicate-shorts.spec.ts dashboard.spec.ts widget.spec.ts
- auto-queue.spec.ts auto-subs-replace.spec.ts operation-settings.spec.ts channels-sort.spec.ts
- channel-groups.spec.ts channels-actions.spec.ts cleanup-page.spec.ts cleanup-holds.spec.ts
- perf-budget.spec.ts`. Known flakes (`auto-queue.spec.ts:411`; the cold-compile Videos-tab
- `toHaveURL`) are retried individually and reported as such. If port 3011 is held use
- `PORT=3111 EXPORT_PORT=3110 OLLAMA_STUB_PORT=11535`; never kill anything.
-4. **No editor boot against `transcripts/`, nothing written under it.**
-5. Manual (optional, on the e2e fixture, `PORT=3021 pnpm dev:test`): `/actionable` lands on
- `/operations` (307); `/operations/download` shows three sections below the console,
- `/operations/transcription` two with the incomplete header actions, `/operations/digest` the
- warnings section below the settings forms, `/operations/diarization` none; `/channels` shows
- the Report column, a row "Refresh report", and "Update all reports" in the header; `/cleanup`
- shows the two tables under the cards; `/review` shows both sections and Corpus has Review;
- the dashboard's "Needs work" badge title says "can work on now". Kill the server, remove
- `editor/test-transcripts` and `editor/test-settings.json`, `git status` clean.
-
-## Out of scope
-
-- Renaming the `actionable*` identifiers, `ActionableRow`/`ActionableSummary`, or the
- `/api/widget/actionable` path (the vocabulary-pass rule: an identifier sweep is reviewable
- only alone); `editor/app/lib/actionable/` keeps the name as "the actionable census".
-- The widget's `SectionId "actionable"`, `config.ts`, `placement.test.ts`, `MonitorWidget`
- internals beyond two comment lines.
-- Merging the cleanup tables into `ChannelCleanupCard`; the channel page's `noDigestIds` and
- `DigestStage`.
-- "Uncertain attribution" as an attention section — no bucket or confidence field exists yet
- (`attributionTurns.ts:119-123` says the text lane has none); net-new, not a move.
-- Any snapshot field, settings key, or file `name`. Slices 5–9.
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`): write the plan to
-`plans/editor-ia-slice-4.md`, commit it alone, then spawn one `general-purpose` agent, `model:
-"opus"`, with: the plan path, the fish-shell caveats (commit via `git commit -F <file under
-$CLAUDE_JOB_DIR/tmp>`; quote `[slug]`/`[id]` paths and globs; POSIX `for … do … done`), never
-boot against `transcripts/`, e2e detached, tmp under `$CLAUDE_JOB_DIR/tmp`, the two trailer
-lines, and the report contract: commit shas with one line each; exact tsc/test outputs; e2e
-pass/fail per spec with any retry; every divergence from the plan and why; anything undone.
-Fable reviews on return (`git log --oneline 184cb9f..`, the hunks in `sections.tsx`,
-`ChannelWorkTable.tsx`, `OperationDetail.tsx`, `[id]/page.tsx`, `channels/components/ChannelsTable.tsx`,
-`cleanup/page.tsx`, `review/page.tsx`, `nav.ts`, `next.config.ts`, and the repointed specs;
-re-runs grep gates + `pnpm -C common test` + editor units, not e2e), sends fixes via
-SendMessage to the same agent, and reports.
diff --git a/plans/editor-ia-slice-5.md b/plans/editor-ia-slice-5.md
@@ -1,1106 +0,0 @@
-# Editor IA slice 5 — Sites absorb Charts, Search aliases, Deploy, Build and Homepage: a site has tabs, the family page has the globals
-
-## Context
-
-**Verified read-only against `2a8081e` (clean) on 2026-08-30**, the commit that closed slice
-8c. The census is the appendix of this file (three exploration reports, every file:line
-re-checked at this sha); the findings cite it as "census (a)/(b)/(c)". A `duplicates-page`
-worktree exists (`git worktree list`) — another session commits into this checkout.
-
-This is the IA doc's bullet 5 (`plans/editor-operations-ia.md:147-150`):
-"`/sites/[siteId]/{charts,aliases,publish}`; `?site=` stays for Dashboard and Channels. Deletes
-five pages." It is the last UI-only slice and the last one that reduces the nav: the Sites
-group is six entries (`editor/app/lib/nav.ts:88-95`) and the end state is one, "eleven
-top-level entries" (`nav.ts:42`; IA doc `:68`).
-
-**Decided (operator, 2026-08-30):**
-
-- **(A) Globals live on `/sites`, the family page.** `/sites` = the sites list PLUS everything
- that applies to the whole family: the EXPORT release notes (`CutReleaseForm
- workspace="export"`), the build-mode toggle and the batch panel ("Build all sites" / "Or pick
- specific sites"), the **Hub** (today's `/homepage` form), and the **Pool** (today's `/build`:
- index, stats, normalize/archive ×3 transcripts and ×3 live chat with their
- `QueueControl`s/`ArchiveOptionsControl`s, plus `RunningJobsList` over `BUILD_KINDS`). Heavy
- sections collapse under `<details>` the way `/deploy`'s "Individual steps" does
- (`deploy/page.tsx:133-167`).
-- **Per-site:** `/sites/[siteId]/charts`, `/sites/[siteId]/aliases`, `/sites/[siteId]/publish`
- ("Build & deploy" + "Individual steps"). `/sites/[siteId]` stays the settings form.
-- **(B) Aliases: both sections stay on the site page** — h2 "Global" + h2 "This site — <id>"
- exactly as `EditorAliasesClient.tsx:88,96,183` draws them; `/sites` does not duplicate the
- global list.
-- **Nav end state:** Sites group = one entry, 11 total. The five routes 307 (`permanent:
- false`, the "TEMPORARY" rule at `next.config.ts:66-71`). Nothing on disk changes.
-- **Cadence:** Fable reviews; one Opus agent implements. Stage by explicit path; e2e detached;
- never boot the editor against `transcripts/`; `git mv` for every move.
-
-**What the census found — every place the IA bullet's wording cannot be implemented
-literally, and what to do instead:**
-
-1. **"They are all per-site facts already; only their routes say otherwise" (`nav.ts:89-90`)
- is wrong for two of five.** `/build` has no site notion at all — no `searchParams`, no
- `listSites`, eleven corpus-wide actions (`build/page.tsx:20-33`, `build/buildAction.ts`);
- `/homepage` edits `sites/_homepage/homepage.json`, and `_homepage` is rejected by
- `isValidSiteId` so the hub can never be a `[siteId]` (census b). `/deploy` is half and
- half: "Build & deploy" + "Individual steps" target one site; "Release notes", "Build mode"
- and "Build all sites" are the family's (`deploy/page.tsx:81-196`). **Instead:** decision
- (A) — the per-site halves become tabs, the global halves become sections of `/sites`.
- Also: `nav.ts:89` says "these four" and lists five.
-2. **Aliases are a global dictionary with a per-site overlay** (`aliasesStore.ts:68-73`,
- per-site id shadows global at compose). A site tab that showed only the overlay would hide
- the thing it overlays. **Instead:** decision (B) — the tab renders both sections;
- `readGlobalAliases` is read on the site page exactly as `aliases/page.tsx:27-28` reads it.
-3. **The site picker and the path disagree on `/sites/<id>/…`.** `SiteScopeSelect.tsx:30`
- `seedsSiteParam = !pathname.startsWith("/sites")` (reason at `:25-29`: the mount effect's
- `replace()` clobbered an in-flight push to `/sites/<id>`); its value is
- `resolveActiveSite(searchParams.site)` (`:22-23`), so on `/sites/alpha/charts` it shows
- whatever was stored last. **Instead:** a pure `siteIdFromPathname()` in
- `lib/activeSite.ts`; on a site path the picker's value IS the path segment, the reconcile
- effect writes it to localStorage (so Dashboard/Channels follow), `onChange` does
- `router.push("/sites/<other>/<segment>")` and "All sites" pushes `/sites`;
- `seedsSiteParam` and its comment stay.
-4. **`?site=` can be routed at config level, and the query survives the redirect.**
- `redirects.md:142`: "if the value `first-(?<paramName>.*)` is used … then `second` will be
- usable in the destination with `:paramName`"; the validator accepts destination segments
- that are `has` named groups (`next/dist/lib/load-custom-routes.js:210-263`). The regex is
- anchored — `new RegExp(`^${hasItem.value}$`)`
- (`next/dist/shared/lib/router/utils/prepare-destination.js:101`) — so `__all__` fails
- `[a-z0-9][a-z0-9-]*` and falls to the bare rule. The initial query is merged into the
- destination (`prepare-destination.js:278-284`) and stringified into `Location`
- (`next/dist/server/lib/router-utils/resolve-routes.js:509-517`; `redirects.md:43`):
- **`/charts?site=testsite` lands on `/sites/testsite/charts?site=testsite`.** Harmless (the
- tab reads `params.siteId`; the picker's path rule wins over the query), but every spec
- regex on a captured redirect must be `(\?|$)`, and bare sources (`/build`, `/homepage`)
- are `/\/sites$/`.
-5. **Layout mechanics, from the docs.** Layout `params` is a Promise (`layout.md:70-72,88`);
- layouts do not rerender and cannot read `searchParams`/`pathname` (`layout.md:154,180,240`)
- — so the active tab lives in a client component, exactly `ChannelTabs.tsx:8-12`;
- `useSelectedLayoutSegment()` returns `null` on the index page
- (`use-selected-layout-segment.md:50,58`) — Settings is active when `segment === null`.
- Metadata: a `title.template` in a layout applies to CHILD segments and not to a `title` in
- the same segment's `page.js` (`generate-metadata.md:284-287`), so the layout exports
- `{ default: `${siteId} — Sites`, template: `%s — ${siteId} — Sites` }`: the index page
- keeps today's `${siteId} — Sites` (`[siteId]/page.tsx:26`) by exporting nothing, and each
- tab exports a static `title` ("Charts", "Search aliases", "Publish") and gets templated.
-6. **`revalidatePath` and the dynamic layout.** A literal path invalidates only that page
- (`revalidatePath.md:38`, `:151` "will not invalidate pages beneath"); `type: "layout"`
- invalidates the layout, nested layouts and every page beneath (`:39`, `:155-162`).
- `saveSiteAction`'s `revalidatePath(`/sites/${siteId}`)` (`sites/actions.ts:193`) therefore
- does NOT cover `/sites/<id>/charts` by the letter — it works today only through the
- "temporary" server-function behaviour that refreshes every visited page (`:16`).
- **Instead:** `:193` → `revalidatePath("/sites/[siteId]", "layout")` (one line; the h1 reads
- `siteTitle`, which that form edits). `buildAction.ts:64` `/charts` →
- `revalidatePath("/sites/[siteId]/charts", "page")` (precedent `channels/actions.ts:312`);
- `cutReleaseAction.ts:114`, `buildModeAction.ts:24`, `homepage/actions.ts:50` → `/sites`.
-7. **The all-sites disabled state cannot exist on a site tab.** `BuildDeployButton.tsx:26-33`,
- `BuildExportButton.tsx:39-43`, `DeployButton.tsx:28-31` each carry "Select a specific site
- from the sidebar…" for `siteId === null`. **Instead:** `siteId: string`, `siteTitle:
- string` (non-null), the three notices deleted, `disabled={!siteId}`
- (`BuildExportButton:30`, `DeployButton:21`) deleted; the missing-Cloudflare-project branch
- (`BuildDeployButton:34-40`, pinned by `deploy-page.spec.ts:60`) is what the button says
- when it cannot deploy — copy unchanged: "**<title>** has no Cloudflare Pages project
- configured — set one on the site's page to deploy." ("the site's page" is now literally
- the Settings tab beside it).
-8. **The Pool is eight job consoles; on the family page it collapses.** `BuildButtons.tsx`
- renders eight `StreamActionLog`s; `getByRole` ignores what a closed `<details>` hides, so
- the nine specs that press "Build index" (census a) must open it first. **Instead:** h2
- "Pool" + description + `<RunningJobsList>` ABOVE the disclosure (it renders `null` when
- empty, `RunningJobsList.tsx:24`, and a running pool job must be visible without a click),
- then `<details><summary>Pool jobs</summary><BuildButtons/></details>`; one
- `buildIndex(page)` helper in `e2e/helpers.ts` opens it, presses, and asserts "Done" — it
- needs `import { expect } from "@playwright/test"` added (`helpers.ts:12` imports only
- `type Page` today); the assertion stays inside the helper because all three inline copies
- (`channel-build-toggle:16-22`, `regional-vtt-fallback:18-27`, `duplicate-shorts:177-188`)
- assert, and a helper that returned a locator would move six lines into nine call sites.
-9. **`build/` and `deploy/` are already one module in two directories**
- (`build/buildAction.ts:34` ← `deploy/buildDeployCore`; four `deploy/components/*` →
- `build/buildAction`; `changelog/page.tsx:12` → `deploy/components/CutReleaseForm`).
- **Instead:** server modules to `editor/app/sites/lib/` (`buildDeployCore.ts` deliberately
- NOT `"use server"`, `buildAction.ts`, `deployAction.ts`, `cutReleaseAction.ts`,
- `buildModeAction.ts`, `homepageActions.ts`, `chartsActions.ts`, `aliasesActions.ts`);
- components FLAT in the existing `editor/app/sites/components/` beside `SiteForm.tsx` and
- `SiteListActions.tsx`. Flat, not `{publish,pool,hub,charts,aliases}/`: the repo's component
- dirs are flat (`jobs/components/`, `channels/[slug]/components/`, `deploy/components/`),
- every moved file then has the same import shape (`../lib/x`,
- `../../components/QueueControl`, `../../jobs/actions` — the last two are byte-identical
- to today's from `deploy/components/`), and the filenames already say which section they
- are. Neither `sites/lib` nor `sites/components` has a `page.tsx`, so neither is routable
- (slice 8a+8b finding 8) and neither can shadow a site id; `SiteTabs.tsx` goes under
- `sites/[siteId]/components/` (precedent `channels/[slug]/components/ChannelTabs.tsx`).
- **No static route sibling of `[siteId]` is added** — `/sites/publish` would shadow a site
- called `publish` (`SITE_ID_RE`, `site.ts:110`).
-10. **The hub's form is not what deploys the hub** (census b: `homepage/` package's `deploy`
- script hardcodes `--project-name archilyzer`; no editor job builds it). Pre-existing; the
- section keeps today's copy (`homepage/page.tsx:17-24`) verbatim and this plan does not
- touch the script.
-11. **Charts preview data is whatever site `compose-site` ran last** (`export/public/stats`,
- census b; `useStats` fetches `${idBaseUrl(origin)}/stats/…` — absolute,
- `common/components/statsCache.ts:28,44`, so the move changes nothing). **Decided: one
- sentence** in the Charts tab's intro: "The preview draws the stats dataset as last
- composed, which may be another site's." Out of scope to fix.
-12. **`navigation.spec.ts`'s redirect test has no site.** Its fixture is
- `channel-with-counts` (`:49`) and it never calls `writeSite`; a captured redirect to
- `/sites/testsite/charts` would 404 there. **Instead:** the test writes `testsite` before
- the capture case (helpers `writeSite`, `:74-105`).
-13. **`/sites` becomes async and reads six things** (`listSites`, `export/CHANGELOG.md`,
- `settings.buildPipeline.mode`, `activeQueueNames()`, `liveJobRows(BUILD_KINDS)`,
- `getHomepageConfig`) — all file/registry reads the two retired pages already did per
- request; it is `force-dynamic` already (`sites/page.tsx:7`).
-14. **`BUILD_KINDS` (`build/page.tsx:11-18`) is wrong in both directions** — six kinds,
- missing the three live-chat kinds the buttons enqueue, including `build-export` which
- none does. Moved verbatim with a comment saying exactly that; **not fixed**.
-15. **`SettingsForm.tsx:288`** `<a href="/deploy">Deploy</a>` "The mode can also be toggled on
- the Deploy page" → `href="/sites"` "the Sites page".
-16. **A stale `?site=<deleted>` bookmark 404s at `/sites/<id>/charts`** exactly as
- `/sites/<id>` does (`navigation.spec.ts:135` pins the family's 404). Today
- `/charts?site=bogus` fell back to the lone/all site (`activeSite.ts:46-50`). The picker
- never seeds an invalid id (`SiteScopeSelect.tsx:60` resolves first), so only a hand-typed
- URL reaches this. Accepted; recorded in the CHANGELOG bullet.
-
-**Hazards carried through every commit:**
-
-- **Another session commits into this checkout.** `git status` before every commit; stage by
- explicit path; never `git add -A`.
-- **Playwright strict mode and the site title.** On `/sites` a site's title appears THREE
- times after this slice: the picker `<option>`, the list `<Link>`, and `BuildSitesPanel`'s
- visible `<span>{s.siteTitle}</span>` (`BuildSitesPanel.tsx:83`, beside its
- `aria-label="Select <title>"` checkbox at `:81`). `sites-crud.spec.ts` survives because it
- already scopes by `getByRole("link", { name: /Alpha Site/ })` (`:59,65`; the comment at
- `:56-59` records the picker collision) and its `getByText("Doomed")).toHaveCount(0)` (`:91`)
- runs AFTER the delete, when all three occurrences are gone (the panel takes `sites` as a
- page prop and re-renders with the revalidated route). **No new unscoped `getByText(<site
- title>)` on `/sites`.** `sites-crud:89` `getByRole("button", { name: /delete/i })` stays
- unique: the new buttons are Cut release, Basic, Docker, Build all sites / Build & deploy all
- sites, Build selected, Save config, Build index, Build stats dataset, Normalize transcripts,
- Build archives, Build combined archive, Normalize live chat, Build live chat archives, Build
- combined live chat archive, and `QueueControl`'s Set/Cancel only while editing
- (`QueueControl.tsx:48-70`) — none contains "delete".
-- **`getByRole("button", { name: "Build index" })` is a substring match**; on `/sites` no other
- button contains it ("Build all sites", "Build selected", "Build stats dataset" do not).
- `getByLabel("Build index output")` (`StreamActionLog` label, route-independent) stays unique.
-- **`deleteSiteAction` rm -rf's the whole site dir** including `chart-templates.json` and
- `search-aliases.json` (census c). Unchanged; the tabs now make that visible. Nothing changes.
-- **`CutReleaseForm` is shared with `/changelog`** (`workspace="editor"`, `cut-release.spec.ts`
- three tests on `/changelog`) — one import edit at `changelog/page.tsx:12`; no spec change.
-- **`"use server"` files export functions only**; `buildDeployCore.ts` is NOT `"use server"`
- (its header `:1-5` says why) and stays that way in `sites/lib/`.
-- **`revalidatePath("/sites")`** at `channels/actions.ts:232,285` and `sites/actions.ts:192,
- 207,217` — unchanged; three more callers join them.
-- **No `loading.tsx`** anywhere under `sites/` (`navigation.spec.ts:7-33`; `:132-140` pins
- `/sites/definitely-not-a-site` → 404). The layout's `notFound()` is the guard; each tab page
- also guards through the same `cache()`d read (the channel page does likewise,
- `channels/[slug]/page.tsx:122-123`).
-- **Redirects are checked before the filesystem** (`redirects.md:39`), so a redirect for a
- route that still has a page hides the page: each commit adds ONLY the redirects for the
- pages it deletes.
-- **Tab labels vs sidebar labels.** The Settings tab's accessible name is "Settings tab"
- (`aria-label`, `ChannelTabs.tsx:38` precedent); `dashboard.spec.ts:125` and
- `navigation.spec.ts:61` scope sidebar links to `aside`. No unscoped `getByRole("link", {
- name: /settings|charts/i })` exists in `e2e/` (grep verified).
-- **Hidden `<details>` content**: `toBeVisible`/`getByRole` on anything inside the Pool
- disclosure or "Individual steps" needs the click first (`build.spec.ts:87` already does it
- for the latter).
-- **e2e runs detached (~25 min); never boot the editor against `transcripts/`**; the corpus is
- `test-transcripts/` with site `testsite`.
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/editor-ia-slice-5.md`; commit alone: `plans: slice 5 planned`.
-
-## Order: four code commits after the plan, then the docs
-
-1. **`sites: a site has tabs, and Charts and Search aliases are two of them`** —
- `[siteId]/layout.tsx`, `SiteTabs`, `siteCache.ts`, `[siteId]/page.tsx` trimmed,
- `/sites/[siteId]/charts`, `/sites/[siteId]/aliases`, `chartsActions`/`aliasesActions` + the
- two clients moved, `siteIdFromPathname` + test, the picker follows the path, `/charts` and
- `/aliases` redirected and deleted, two nav entries gone, two `revalidatePath` rewrites,
- four specs.
-2. **`sites: Publish is the site's tab; the family page cuts the release and batches the
- builds`** — `deploy/*` and `build/buildAction.ts` moved to `sites/lib` + `sites/components`,
- `/sites/[siteId]/publish`, `/sites` gains Release notes and Build all sites (with the mode
- toggle), the three all-sites notices deleted, `/deploy` redirected and deleted, Deploy nav
- entry gone, `SettingsForm` link, five specs.
-3. **`sites: the pool runs from the family page`** — `BuildButtons`/`ArchiveOptionsControl`
- moved, `/sites` gains Pool under `<details>`, `buildIndex(page)` helper replaces three
- inline copies, `/build` redirected and deleted, Build nav entry gone, three comment sites,
- eight specs.
-4. **`sites: the hub is the family's, and the Sites group is one entry`** —
- `homepageActions`/`HomepageConfigForm` moved, `/sites` gains Hub, `/homepage` redirected
- and deleted, Homepage nav entry gone, `nav.ts` header says eleven is reached, `nav.test.ts`,
- the redirect comment paragraph final, one spec.
-5. **`plans: slice 5 shipped, and the docs say so`** — CHANGELOG, IA doc, STATE, FACTS.
-
-Gates after each of 1–4: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export homepage
-umtool mcp`; `pnpm -C common test`; `pnpm -C editor exec tsx --test "app/**/*.test.ts"` (111 at
-`2a8081e`; `activeSite.test.ts` adds in commit 1, `nav.test.ts` in commit 4 — re-measure before
-commit 1). e2e once after commit 5, detached.
-
----
-
-## Commit 1 — `sites: a site has tabs, and Charts and Search aliases are two of them`
-
-**New `editor/app/sites/[siteId]/lib/siteCache.ts`** (modelled on
-`channels/[slug]/lib/channelConfigCache.ts`):
-
-```ts
-import { cache } from "react";
-import { getPaths } from "yt-dlp-transcript-common/lib/paths";
-import { getSite, isValidSiteId, listSiteIds, type Site } from "yt-dlp-transcript-common/lib/site";
-
-// The layout and every tab page need the site — the layout for the title,
-// the page for its own section. React cache() dedupes them into ONE read per
-// request (the channel routes do the same, channelConfigCache.ts). Returns
-// null for an id that is malformed or has no site.json, so the caller's
-// notFound() is the one 404 for /sites/<missing> and every tab under it.
-// Request-scoped, not a process cache: a site renamed by the form on the
-// previous request is read fresh on the next one.
-export const getSiteCached = cache((siteId: string): Site | null => {
- const paths = getPaths();
- if (!isValidSiteId(siteId) || !listSiteIds(paths).includes(siteId)) return null;
- return getSite(siteId, paths);
-});
-```
-
-(the guard is `[siteId]/page.tsx:36-38` verbatim; `getSite` is sync, `site.ts:356`).
-
-**New `editor/app/sites/[siteId]/components/SiteTabs.tsx`** (`"use client"`; `ChannelTabs.tsx`
-copied, four tabs):
-
-```ts
-// Settings | Charts | Search aliases | Publish.
-//
-// A CLIENT component on purpose. Next 16 layouts are cached during navigation
-// and DO NOT RERENDER — they cannot read the pathname and would not re-evaluate
-// an active-tab check on a client-side move between two tabs.
-// useSelectedLayoutSegment is the supported way to ask "which child segment is
-// rendered"; it is null on the index page, which is the Settings tab.
-export function SiteTabs({ siteId }: { siteId: string }) {
- const segment = useSelectedLayoutSegment();
- return (
- <nav aria-label="site sections" className="flex items-center gap-1">
- <Tab href={`/sites/${siteId}`} active={segment === null} label="Settings" />
- <Tab href={`/sites/${siteId}/charts`} active={segment === "charts"} label="Charts" />
- <Tab href={`/sites/${siteId}/aliases`} active={segment === "aliases"} label="Search aliases" />
- {/* commit 2 adds: <Tab href={`/sites/${siteId}/publish`} active={segment === "publish"} label="Publish" /> */}
- </nav>
- );
-}
-```
-
-`Tab` is `ChannelTabs.tsx:25-48` verbatim (`aria-current={active ? "page" : undefined}`,
-`aria-label={`${label} tab`}`, same classes).
-
-**New `editor/app/sites/[siteId]/layout.tsx`** — header comment modelled on
-`channels/[slug]/layout.tsx:9-24` (why a layout: the site has more than one page now; the two
-Next 16 caveats — layouts do not rerender / no `loading.tsx` here because it turns
-`notFound()` 404s into 200s; `force-dynamic` because it reads `site.json` per request). Body:
-
-```ts
-export const dynamic = "force-dynamic";
-
-export async function generateMetadata({ params }: { params: Promise<{ siteId: string }> }): Promise<Metadata> {
- const { siteId } = await params;
- // The index page (the settings form) exports no title and gets `default`;
- // each tab exports a bare title and gets the template
- // (generate-metadata.md: a layout's template applies to CHILD segments).
- return { title: { default: `${siteId} — Sites`, template: `%s — ${siteId} — Sites` } };
-}
-
-export default async function SiteLayout({ children, params }: { children: ReactNode; params: Promise<{ siteId: string }> }) {
- const { siteId } = await params;
- const site = getSiteCached(siteId);
- if (!site) notFound();
- return (
- <div className="flex flex-col gap-4">
- {/* breadcrumb: [siteId]/page.tsx:49-55 verbatim */}
- <div className="flex items-center justify-between gap-2 flex-wrap">
- <h1 className="text-2xl font-semibold">{site.siteTitle || siteId}</h1>
- <SiteTabs siteId={siteId} />
- </div>
- {children}
- </div>
- );
-}
-```
-
-**`editor/app/sites/[siteId]/page.tsx`:** delete `:2` (`Link`), `:7,:9` (`isValidSiteId`,
-`listSiteIds`), `:20-27` (`generateMetadata` — the layout's default is the same string),
-`:49-64` (breadcrumb, h1, the `/charts?site=` link — the tabs replace it). `:35-39` → `const
-site = getSiteCached(siteId); if (!site) notFound();` (import from `./lib/siteCache`; `getSite`
-import dropped). Keep `force-dynamic` (`:18`) — the page reads `listChannelConfigs` and
-`listSites` itself, as the channel page keeps its own (`channels/[slug]/layout.tsx:23-24`).
-The return becomes the `<SiteForm …/>` (`:65-70`) inside the existing wrapper div.
-
-**Moves (`git mv`)**: `editor/app/charts/EditorChartsClient.tsx` →
-`editor/app/sites/components/EditorChartsClient.tsx` (`:13` `./actions` →
-`../lib/chartsActions`); `editor/app/charts/actions.ts` → `editor/app/sites/lib/chartsActions.ts`;
-`editor/app/aliases/EditorAliasesClient.tsx` → `editor/app/sites/components/EditorAliasesClient.tsx`
-(`:19` `./actions` → `../lib/aliasesActions`); `editor/app/aliases/actions.ts` →
-`editor/app/sites/lib/aliasesActions.ts`. **`git rm`** `editor/app/charts/page.tsx`,
-`editor/app/aliases/page.tsx`; the two directories are gone. `EditorAliasesClient`'s `siteId:
-string | null` branch is now unreachable and is left alone (a `git mv` + one import line is
-the whole diff; narrowing it is not this slice).
-
-**New `editor/app/sites/[siteId]/charts/page.tsx`:**
-
-```ts
-export const dynamic = "force-dynamic";
-export const metadata: Metadata = { title: "Charts" }; // → "Charts — <id> — Sites"
-export default async function SiteChartsPage({ params }: { params: Promise<{ siteId: string }> }) {
- const { siteId } = await params;
- if (!getSiteCached(siteId)) notFound();
- const templates = readTemplates(getPaths(), siteId);
- return (
- <section className="flex flex-col gap-4">
- <p className="text-sm text-muted-foreground">
- Author the default dashboard for <strong>{siteId}</strong>. Edits save
- automatically and bake into this site's next export build. Requires the
- stats dataset — build it on the <Link className="underline" href="/build">Build</Link> page.
- The preview draws the stats dataset as last composed, which may be another site's.
- </p>
- <EditorChartsClient key={siteId} templates={templates} siteId={siteId} />
- </section>
- );
-}
-```
-
-No own heading: the h1 (site title) and the active tab name the page; the tab pages start with
-their intro. The `/build` link is repointed to `/sites` in commit 3 (it is true until then).
-The "Select a specific site" branch (`charts/page.tsx:36-48`) and the zero-sites branch
-(`:21-34`) are gone — a tab always has a site. `site-scope.spec.ts:67` `/author the default
-dashboard/i` still matches.
-
-**New `editor/app/sites/[siteId]/aliases/page.tsx`:** same shape; `metadata.title = "Search
-aliases"`; reads `readGlobalAliases(paths)` and `readSiteAliases(paths, siteId)`
-(`aliases/page.tsx:27-28`); intro = `aliases/page.tsx:33-42`'s site branch ("Global aliases
-apply everywhere; per-site aliases below add to or override them for **{siteId}**. Changes bake
-into the site's next export build."); `<EditorAliasesClient key={siteId} globalConfig
-siteConfig siteId={siteId} />`. The client's h2 "Global" and h2 "This site — <id>" and every
-`alias-*` testid are untouched.
-
-**`editor/app/lib/activeSite.ts`:** `:1-6` header → "(Dashboard, Channels)" and a new
-paragraph: "ON A SITE'S OWN PAGES the site is the PATH, not the param: `/sites/<id>/<tab>`
-names it, the tab reads `params.siteId`, and the picker reads the same path through
-`siteIdFromPathname` so the two never disagree." Append:
-
-```ts
-// The routes under /sites where the path names the site. `new` is /sites/new,
-// a static route that beats [siteId] and is not a site. The id pattern is
-// SITE_ID_RE re-spelled: common/lib/site.ts imports node:fs and this module
-// must stay importable from the client picker.
-const SITE_PATH_RE = /^\/sites\/([a-z0-9][a-z0-9-]*)(?:\/([a-z-]+))?\/?$/;
-
-export type SitePath = { siteId: string; segment: string | null };
-
-// "/sites/alpha" → { alpha, null }; "/sites/alpha/charts" → { alpha, "charts" };
-// "/sites", "/sites/new", "/channels", "/sites/a/b/c" → null.
-export function siteIdFromPathname(pathname: string): SitePath | null {
- const m = SITE_PATH_RE.exec(pathname);
- if (!m || m[1] === "new") return null;
- return { siteId: m[1], segment: m[2] ?? null };
-}
-```
-
-**New `editor/app/lib/activeSite.test.ts`** (node:test): the six cases above.
-`resolveActiveSite` is not re-tested (unchanged).
-
-**`editor/app/components/SiteScopeSelect.tsx`:** `:5-9` import adds `siteIdFromPathname`;
-`:14-16` comment → "…so the server-rendered scoped pages (Dashboard, Channels) can read it from
-their `searchParams`. On a site's own pages (`/sites/<id>/…`) the path IS the selection: the
-picker shows it, writes it to storage so Dashboard and Channels follow, and changing it
-navigates to the same tab of the other site. See app/lib/activeSite.ts."; after `:19` add
-`const onSite = siteIdFromPathname(pathname);`; `:23` → `const resolved =
-resolveActiveSite(onSite?.siteId ?? urlValue, siteIds);`; `:25-30` comment keeps its reason and
-gains one sentence: "On `/sites/<id>/…` the picker reads the path instead (below) and never
-seeds either."; `:30` unchanged. Effect `:43-52` → `const chosen = onSite?.siteId ?? urlValue;
-const chosenIsValid = chosen === ALL_SITES || (!!chosen && siteIds.includes(chosen)); if
-(chosenIsValid) { …setItem(ACTIVE_SITE_KEY, chosen)…; return; }`; `:53-62` unchanged (deps
-already include `pathname`). `onChange` `:64-71`:
-
-```ts
-function onChange(value: string) {
- try { window.localStorage.setItem(ACTIVE_SITE_KEY, value); } catch { /* ignore */ }
- if (onSite) {
- // The site is the path here, so changing it is a navigation, not a param:
- // the same tab of the other site, or the family page for "All sites".
- router.push(value === ALL_SITES ? "/sites" : `/sites/${value}${onSite.segment ? `/${onSite.segment}` : ""}`);
- return;
- }
- setParam(value);
-}
-```
-
-**`editor/app/build/buildAction.ts:64`** → `revalidatePath("/sites/[siteId]/charts", "page");`
-with `// every site's Charts tab previews the dataset this just rebuilt.`
-**`editor/app/sites/actions.ts:193`** → `revalidatePath("/sites/[siteId]", "layout");` with
-`// "layout": the h1 above every tab reads siteTitle, and a literal path would revalidate only
-the settings page (revalidatePath.md).`
-
-**`editor/next.config.ts`:** the redirect comment gains, before the TEMPORARY paragraph:
-
-```
- // /charts, /aliases, /deploy, /build and /homepage were the Sites group's
- // five satellites. A site's charts, search aliases and publish controls are
- // its TABS now (/sites/<id>/{charts,aliases,publish}); what applies to the
- // whole family — the release notes, the batch build, the hub, the pool —
- // is on /sites itself. The `has` rules carry a ?site=<id> bookmark to the
- // site's tab: the value regex is SITE_ID_RE, anchored by Next, so
- // ?site=__all__ (underscores) misses it and lands on the family page. The
- // matched query is NOT stripped — /charts?site=a lands on
- // /sites/a/charts?site=a — which the tab ignores and the picker reconciles.
- // Order matters: first match wins, so each `has` rule precedes its bare one.
-```
-
-(commit 1 writes the paragraph naming all five; the array grows per commit). Above
-`redirects()`: `const siteQuery = { type: "query", key: "site", value:
-"(?<site>[a-z0-9][a-z0-9-]*)" } as const;`. Array, commit 1 adds after `:78`:
-
-```ts
-{ source: "/charts", has: [siteQuery], destination: "/sites/:site/charts", permanent: false },
-{ source: "/charts", destination: "/sites", permanent: false },
-{ source: "/aliases", has: [siteQuery], destination: "/sites/:site/aliases", permanent: false },
-{ source: "/aliases", destination: "/sites", permanent: false },
-```
-
-**`editor/app/lib/nav.ts`:** delete `:91-92` and the `ChartColumnBig` (`:3`) and `Regex`
-(`:12`) imports; `:88` → `{ href: "/sites", label: "Sites", icon: Globe, keywords: "family
-charts stats graphs search aliases synonyms suggestions regex search terms" }`; `:89-90` →
-`// Interim: slice 5 folds these three into /sites — Deploy into the site's Publish tab and
-the family page, Build and Homepage into the family page.`
-
-**Specs (commit 1):**
-
-- `site-scope.spec.ts:61-68` → title "charts is a site's tab, and the picker follows the path":
- ```ts
- await twoSites();
- await page.goto("/sites/alpha/charts");
- await expect(page.getByText(/author the default dashboard/i)).toBeVisible();
- await expect(page.getByLabel("Active site")).toHaveValue("alpha");
- await page.getByLabel("Active site").selectOption("beta");
- await expect(page).toHaveURL(/\/sites\/beta\/charts$/);
- await expect(page.getByText(/author the default dashboard/i)).toContainText("beta");
- // The path wrote localStorage, so the scoped pages follow.
- await page.goto("/channels");
- await expect(page.getByLabel("Active site")).toHaveValue("beta");
- await expect(page).toHaveURL(/site=beta/);
- // "All sites" is the family page.
- await page.goto("/sites/beta/charts");
- await page.getByLabel("Active site").selectOption("__all__");
- await expect(page).toHaveURL(/\/sites$/);
- ```
-- `aliases.spec.ts:4-5` header → "…on the site's Search aliases tab: the global dictionary and
- the site's overrides, both."; `:16,:25,:52` → `/sites/testsite/aliases`.
-- `navigation.spec.ts:2` → `import { resetData, writeSite } from "./helpers";`; `:105-109`
- comment gains "The Sites group's five satellites fold into /sites and the site's tabs.";
- after `:129` (grown per commit — commit 1 has `/charts`, `/aliases`):
- ```ts
- await writeSite("testsite", {});
- for (const retired of ["/charts", "/aliases"]) {
- await page.goto(retired);
- await expect(page).toHaveURL(/\/sites$/);
- await expect(page.getByRole("heading", { name: "Sites", level: 1 })).toBeVisible();
- }
- // A ?site= bookmark is carried to the site's tab; the query survives the redirect.
- await page.goto("/charts?site=testsite");
- await expect(page).toHaveURL(/\/sites\/testsite\/charts(\?|$)/);
- await expect(page.getByRole("link", { name: "Charts tab" })).toHaveAttribute("aria-current", "page");
- ```
-- `sites-crud.spec.ts`: no change (the h1, the form and `role=status` are as before; nothing
- pins the deleted link).
-
----
-
-## Commit 2 — `sites: Publish is the site's tab; the family page cuts the release and batches the builds`
-
-**Moves (`git mv`)**, then the import edits:
-
-| from | to | import edits |
-|---|---|---|
-| `editor/app/deploy/buildDeployCore.ts` | `editor/app/sites/lib/buildDeployCore.ts` | none (header `:1-5` still true) |
-| `editor/app/build/buildAction.ts` | `editor/app/sites/lib/buildAction.ts` | `:34` `../deploy/buildDeployCore` → `./buildDeployCore` |
-| `editor/app/deploy/deployAction.ts` | `editor/app/sites/lib/deployAction.ts` | none (`./buildDeployCore`) |
-| `editor/app/deploy/buildModeAction.ts` | `editor/app/sites/lib/buildModeAction.ts` | `:24` → `revalidatePath("/sites")`; `:11` comment "from the deploy page" → "from the family page (/sites)" |
-| `editor/app/deploy/cutReleaseAction.ts` | `editor/app/sites/lib/cutReleaseAction.ts` | `:114` → `revalidatePath("/sites")` |
-| `editor/app/deploy/components/BuildAllSitesButton.tsx` | `editor/app/sites/components/` | `:7` `../../build/buildAction` → `../lib/buildAction` |
-| `…/BuildDeployButton.tsx` | `editor/app/sites/components/` | `:5` → `../lib/buildAction`; props/notice per finding 7 |
-| `…/BuildExportButton.tsx` | `editor/app/sites/components/` | `:5` → `../lib/buildAction`; finding 7 |
-| `…/BuildModeToggle.tsx` | `editor/app/sites/components/` | `:5` `../buildModeAction` → `../lib/buildModeAction` |
-| `…/BuildSitesPanel.tsx` | `editor/app/sites/components/` | `:4` → `../lib/buildAction`; `:61-64` comment "on /deploy" → "on /sites" |
-| `…/CutReleaseForm.tsx` | `editor/app/sites/components/` | `:4-7` `../cutReleaseAction` → `../lib/cutReleaseAction` |
-| `…/DeployButton.tsx` | `editor/app/sites/components/` | `:5` `../deployAction` → `../lib/deployAction`; finding 7 |
-| `…/JobLane.tsx` | `editor/app/sites/components/` | none (`../../jobs/actions` is the same depth) |
-
-`editor/app/changelog/page.tsx:12` → `import { CutReleaseForm } from
-"../sites/components/CutReleaseForm";`. **Interim (undone in commit 3):**
-`editor/app/build/components/BuildButtons.tsx:11-20` `../buildAction` →
-`../../sites/lib/buildAction`. **`git rm`** `editor/app/deploy/page.tsx`; `editor/app/deploy/`
-is gone.
-
-**Finding 7, exactly:** `BuildDeployButton.tsx:8-14` → `siteId: string; siteTitle: string;
-cloudflareProject: string | null;`; `:23` `ready = Boolean(cloudflareProject)`; `:26-33`
-deleted, the `if/else if/else` becomes `if (!cloudflareProject) … else …`; `:51` `siteId as
-string` → `siteId`. `BuildExportButton.tsx:9-14` → `siteId: string; siteTitle: string;`; `:30`
-`disabled={!siteId}` deleted; `:35-43` → the `<p>` "Building **{siteTitle}** (`{siteId}`)."
-only; `:26` cast dropped. `DeployButton.tsx:7-11`, `:21`, `:23-32` likewise. Grep gate: `Select
-a specific site` → 0 after this commit.
-
-**New `editor/app/sites/[siteId]/publish/page.tsx`:** `metadata.title = "Publish"`; guard via
-`getSiteCached`; `existingQueues = getRegistry().activeQueueNames()`; `getLastDeployedAt()`
-moved from `deploy/page.tsx:37-44` into this file. Body = `deploy/page.tsx:108-168` with the
-site's values:
-
-- `<section>` h2 **"Build & deploy"** (`:111`), the two `<p>`s (`:112-121`, "Last deployed:
- …"), one added line "Build mode (Basic or Docker) is set on the <Link
- href="/sites">Sites</Link> page.", `<BuildDeployButton siteId={siteId} siteTitle={site.siteTitle
- || siteId} cloudflareProject={site.cloudflareProject ?? null} />`. **No `BuildModeToggle`
- here** — the mode is the family's (decision A) and `deploy-page.spec.ts:70,114` finds the
- group on `/sites`.
-- `<section>` `<details><summary>`**Individual steps**`</summary>` (`:133-167` verbatim): h3
- "Build static export" + `<BuildExportButton existingQueues siteId siteTitle />`, h3 "Deploy
- static export" + `<DeployButton siteId siteTitle />`.
-
-`SiteTabs.tsx` gains the Publish tab (the commented line in commit 1).
-
-**`editor/app/sites/page.tsx`** (commit 2 state; commits 3 and 4 add sections): `export default
-async function SitesPage()`; reads add `loadExportChangelog()` (moved from
-`deploy/page.tsx:26-35`), `lastVersion`/`suggestedVersion`/`unreleased`/`hasUnreleased`
-(`:53-56`), `buildMode = getSettings().buildPipeline.mode`. Sections, in order, each after the
-first `border-t border-border pt-6`:
-
-1. The list as today (`:13-56`), wrapped in a `<section>`.
-2. `<section>` h2 **"Release notes"** — `deploy/page.tsx:82-106` verbatim (`Changelog` limit 1,
- `CutReleaseForm workspace="export"`).
-3. `<section>` h2 **"Build all sites"** — `<p>` (`:174-177`), then `<BuildModeToggle
- mode={buildMode} />` (moved up from the retired "Build & deploy" section: the mode decides
- whether the batch fans out, `serial={buildMode === "basic"}`), `<BuildAllSitesButton
- dockerMode={buildMode === "docker"} />`, h3 **"Or pick specific sites"** + `<BuildSitesPanel
- …/>` (`:181-195` verbatim).
-
-Order rationale, stated in a comment: the list first because the family is the page's noun;
-then the release → batch lifecycle the old page read as (`deploy-page.spec.ts:28`). The intro
-`<p>` (`sites/page.tsx:23-27`) stays.
-
-**`editor/app/settings/components/SettingsForm.tsx:288`** → `<a href="/sites"
-className="underline">Sites</a> page`.
-
-**`editor/next.config.ts`:** add `{ source: "/deploy", has: [siteQuery], destination:
-"/sites/:site/publish", permanent: false }, { source: "/deploy", destination: "/sites",
-permanent: false }`.
-
-**`nav.ts`:** delete `:93` (Deploy) and `Rocket` (`:13`); Sites keywords += ` deploy publish
-release cloudflare`; the interim comment → "folds these two into the family page".
-
-**Specs (commit 2):**
-
-- `deploy-page.spec.ts:5-7` comment "/deploy renders two controls" → "/sites renders two
- controls"; test 1 (`:15-34`) → title "publishing splits: the family page releases and
- batches, the site page builds & deploys":
- ```ts
- await writeSite("testsite", { cloudflareProject: "proj" });
- await page.goto("/sites");
- const release = page.getByRole("heading", { name: "Release notes" });
- const batch = page.getByRole("heading", { name: "Build all sites" });
- await expect(release).toBeVisible();
- await expect(batch).toBeVisible();
- expect((await release.boundingBox())!.y).toBeLessThan((await batch.boundingBox())!.y);
- await expect(page.getByRole("heading", { name: "Build & deploy", exact: true })).toHaveCount(0);
- await page.goto("/sites/testsite/publish");
- await expect(page.getByRole("heading", { name: "Build & deploy", exact: true })).toBeVisible();
- await expect(page.getByRole("heading", { name: "Build all sites" })).toHaveCount(0);
- await expect(page.getByRole("heading", { name: "Release notes" })).toHaveCount(0);
- ```
- Test 2 (`:36-62`): `:43` → `/sites/with-proj/publish`, `:52` → `/sites/no-proj/publish`;
- comments `:45-47,:54-56` → "exact: true — kept from the /deploy days, where 'Build & deploy
- all sites' sat below; harmless here." Test 3 (`:64-117`): `:68,:111` → `/sites`. Test 4
- (`:119-147`): `:127` → `/sites`.
-- `site-scope.spec.ts:70-93` → title "publish targets the site in the path, and says when it
- cannot deploy":
- ```ts
- await twoSites(); // alpha has no cloudflareProject
- await page.goto("/sites/alpha/publish");
- await expect(page.getByRole("heading", { name: "Build & deploy", exact: true })).toBeVisible();
- await expect(page.getByRole("button", { name: "Build & deploy", exact: true })).toBeDisabled();
- await expect(page.getByText(/has no Cloudflare Pages project configured/i)).toBeVisible();
- await expect(page.getByText(/select a specific site/i)).toHaveCount(0);
- await expect(page.getByLabel("Active site")).toHaveValue("alpha");
- await page.getByLabel("Active site").selectOption("beta");
- await expect(page).toHaveURL(/\/sites\/beta\/publish$/);
- ```
- (`:88` comment gone with the test.)
-- `build.spec.ts:86` → `/sites/testsite/publish`; `:85` comment "On the deploy page" → "On the
- site's Publish tab". (`:79` stays `/build` until commit 3.)
-- `settings.spec.ts:92-93` → "The Sites page reflects the persisted mode." / `/sites`.
-- `navigation.spec.ts`: `/deploy` joins the retired list.
-
----
-
-## Commit 3 — `sites: the pool runs from the family page`
-
-**Moves (`git mv`):** `editor/app/build/components/BuildButtons.tsx` →
-`editor/app/sites/components/BuildButtons.tsx` (`:11-20` → `../lib/buildAction`; `:9-10,:21`
-unchanged); `editor/app/build/components/ArchiveOptionsControl.tsx` →
-`editor/app/sites/components/`. **`git rm`** `editor/app/build/page.tsx`; `editor/app/build/`
-is gone.
-
-**`editor/app/sites/page.tsx`** gains (after "Build all sites"): `BUILD_KINDS` moved from
-`build/page.tsx:11-18` verbatim with:
-
-```ts
-// Which live jobs the Pool section lists. SIX KINDS, AND THE SET IS WRONG IN
-// BOTH DIRECTIONS: the three live-chat kinds the buttons below enqueue are
-// missing, and build-export (enqueued from a site's Publish tab, never here)
-// is in. Carried as-is from /build — recorded in plans/editor-ia-slice-5.md,
-// not fixed by it.
-```
-
-reads `existingQueues = getRegistry().activeQueueNames()` (the Pool's `BuildButtons` takes it)
-and `activeJobs = await liveJobRows((j) => BUILD_KINDS.has(j.kind))` (`build/page.tsx:23-25`
-with its comment). Section:
-
-```tsx
-<section className="flex flex-col gap-3 border-t border-border pt-6">
- <div>
- <h2 className="text-lg font-semibold">Pool</h2>
- <p className="text-sm text-muted-foreground">
- The shared channel pool every site is a selection over: the search index, the
- stats dataset, the transcript and live-chat sidecars and the downloadable
- archives. Corpus-wide — no site is involved.
- </p>
- </div>
- {/* Above the disclosure: a running pool job must be visible without a click. */}
- <RunningJobsList jobs={activeJobs} />
- {/* Eight job consoles; the family page does not open on them. */}
- <details>
- <summary className="cursor-pointer text-lg font-semibold select-none">Pool jobs</summary>
- <div className="pt-4"><BuildButtons existingQueues={existingQueues} /></div>
- </details>
-</section>
-```
-
-**`editor/e2e/helpers.ts`:** `:12` → `import { expect, type Page } from "@playwright/test";`;
-append:
-
-```ts
-// Run the corpus-wide Build index job from the family page, the way a user
-// does: open the Pool disclosure, press the button, wait for "Done". The
-// controls sit under <details> so /sites does not open on eight job consoles,
-// and getByRole ignores what a closed disclosure hides — hence the click first.
-// Replaces the six-line copy three specs carried inline. goto() resets the
-// disclosure, so calling this twice in one test is fine.
-export async function buildIndex(page: Page, timeout = 30_000) {
- await page.goto("/sites");
- await page.getByText("Pool jobs", { exact: true }).click();
- await page.getByRole("button", { name: "Build index" }).click();
- await expect(page.getByLabel("Build index output")).toContainText("Done", { timeout });
-}
-```
-
-**Specs (commit 3):**
-
-- `build.spec.ts`: `:9-13`, `:28-32`, `:55-59` → `await buildIndex(page);` (import added at
- `:2`); test 4 (`:70-103`) → title "build static export lives on the site's Publish tab, not
- the family page"; `:78-83` →
- ```ts
- await page.goto("/sites");
- await page.getByText("Pool jobs", { exact: true }).click();
- await expect(page.getByRole("heading", { name: "Build static export" })).toHaveCount(0);
- await expect(page.getByRole("heading", { name: "Build index" })).toBeVisible();
- ```
- (`:86-103` as commit 2 left them.)
-- `channel-build-toggle.spec.ts:16-22` deleted; `:2` imports `buildIndex`; `:32,:65,:93`
- `runBuild(page)` → `buildIndex(page)`.
-- `regional-vtt-fallback.spec.ts:18-27` → keeps a local `seedAndBuild(page)` =
- `writeSite("testsite", { channels: [{ slug: CHANNEL, groupId: "default" }] })` then
- `buildIndex(page)`; `:41,:58` call it (the local name `buildIndex` would shadow the import).
-- `duplicate-shorts.spec.ts:177-188` → `await buildIndex(page);` then the stats click and its
- assertion (`:183-187`) unchanged — the disclosure is still open on the same page.
-- `jobs.spec.ts:21-25` → `await buildIndex(page);`. `availability.spec.ts:190-194` → `await
- buildIndex(page);` ("Done" is a substring of "Done in").
-- `dashboard.spec.ts:108` title → "sidebar links to Channels, Sites, Jobs, Settings";
- `:116-119` → `sidebar.getByRole("link", { name: /sites/i })` / `"/sites"`.
-- `navigation.spec.ts`: `/build` joins the list.
-
-**Copy and comments:** `EditorChartsClient.tsx:34-38` "on the Build page first" → "under Pool
-on the Sites page first"; `sites/[siteId]/charts/page.tsx` link → `href="/sites"` "the Pool on
-the Sites page"; `channels/[slug]/normalizeActions.ts:10` "a corpus-wide button on /build" →
-"a corpus-wide button in the Pool on /sites"; `common/controller/normalizeAll.ts:16` "what the
-/build button has always done" → "what the Pool's button on /sites has always done";
-`common/jobs/jobKinds.ts:134` "corpus-wide from /build" → "corpus-wide from the Pool on /sites".
-
-**`next.config.ts`:** `{ source: "/build", destination: "/sites", permanent: false }`.
-**`nav.ts`:** delete `:94` (Build) and `Hammer` (`:7`); keywords += ` build static export pool
-index stats archives normalize live chat`.
-
----
-
-## Commit 4 — `sites: the hub is the family's, and the Sites group is one entry`
-
-**Moves (`git mv`):** `editor/app/homepage/actions.ts` →
-`editor/app/sites/lib/homepageActions.ts` (`:50` → `revalidatePath("/sites")`);
-`editor/app/homepage/HomepageConfigForm.tsx` →
-`editor/app/sites/components/HomepageConfigForm.tsx` (`:5` `./actions` →
-`../lib/homepageActions`). **`git rm`** `editor/app/homepage/page.tsx`; the directory is gone.
-
-**`editor/app/sites/page.tsx`** gains, between "Build all sites" and "Pool": `<section>` h2
-**"Hub"** + the `<p>` from `homepage/page.tsx:17-24` verbatim (it already explains the
-`homepage` package and that only the operator-facing bits are edited) + `<HomepageConfigForm
-config={getHomepageConfig(paths)} />`. (`homepage/page.tsx:16` h1 "Homepage (project site)"
-and `:28` h2 "Config" do not survive — the section is the config.) Final order: list, Release
-notes, Build all sites, Hub, Pool.
-
-**`editor/next.config.ts`:** `{ source: "/homepage", destination: "/sites", permanent: false }`.
-Final array order: the five slice-4/8 entries (`:74-78`), then `/charts` has, `/charts`,
-`/aliases` has, `/aliases`, `/deploy` has, `/deploy`, `/build`, `/homepage`.
-
-**`editor/app/lib/nav.ts`:** delete `:95` (Homepage), `House` (`:8`), the interim comment;
-`:42` → "The entries marked "interim" were folded by later slices; the end state is eleven, and
-slice 5 reached it (2026-08-30)."; Sites final: `{ href: "/sites", label: "Sites", icon: Globe,
-keywords: "family charts stats graphs search aliases synonyms suggestions regex search terms
-deploy publish release cloudflare build static export pool index stats archives normalize live
-chat hub homepage" }` — the palette (`CommandPalette.tsx:256-263` matches on `label + keywords
-+ group`) still answers "charts", "deploy", "aliases", "build", "hub".
-
-**New `editor/app/lib/nav.test.ts`** (node:test): `NAV_GROUPS` labels are
-`["Corpus","Operations","Sites","Machine"]`; `NAV_LINKS.length === 11`; hrefs unique; the
-Sites group is exactly `["/sites"]`; none of `/charts /aliases /deploy /build /homepage
-/jobs/active /jobs/queue /actionable /auto-queue /scheduler` is an href. Caveat: `nav.ts`
-imports `lucide-react` values; if `tsx --test` cannot load it, the test is dropped and the
-grep gate (`label: "Charts"|…` → 0; link count by grep) stands in — report which.
-
-**Specs (commit 4):** `navigation.spec.ts`: `/homepage` joins the list (final: `["/charts",
-"/aliases", "/deploy", "/build", "/homepage"]`). No homepage e2e existed (census a); none is
-added — the form's action is unchanged and `HomepageConfigForm` is a `git mv`.
-
----
-
-## Locator / URL table (old → new; which spec pins it)
-
-| old | new | pinned by |
-|---|---|---|
-| `/charts?site=<id>` | `/sites/<id>/charts` (307, query kept) | `site-scope:63,66` (rewritten), `navigation` (new) |
-| `/charts?site=__all__`, bare `/charts` | `/sites` (307) | `navigation` (new) |
-| `/aliases`, `/aliases?site=testsite` | `/sites/testsite/aliases` | `aliases:16,25,52` |
-| `/deploy?site=<id>` | `/sites/<id>/publish` (307) | `deploy-page:43,52`, `site-scope:74,87` (rewritten), `navigation` |
-| `/deploy?site=<id>` (mode / batch tests), bare `/deploy` | `/sites` | `deploy-page:19,68,111,127`, `settings:93`, `build:86` → publish |
-| `/build` | `/sites` + "Pool jobs" click | `build:9,28,55,79`, `channel-build-toggle:17`, `regional-vtt-fallback:22`, `duplicate-shorts:178`, `jobs:21`, `availability:190` (all via `buildIndex(page)`) |
-| `/homepage` | `/sites` | `navigation` (new) |
-| h1 "Charts" / "Search aliases" / "Deploy" / "Build" / "Homepage (project site)" | gone; h1 is the site title (tabs) or "Sites" (family) | `navigation` (heading "Sites" level 1) |
-| h2 "Release notes", "Build all sites", h3 "Or pick specific sites", group "Build specific sites", group "Build mode", "Select Alpha", "2 selected", "Deploy after build", "Build selected"/"Build & deploy selected", `/Basic mode runs these one at a time/i`, `/Docker builds are a follow-up/i`, Basic/Docker `aria-pressed` | unchanged, on `/sites` | `deploy-page:21-33,70-116,129-146`, `settings:94-98` |
-| h2 "Build & deploy", "Individual steps", h3 "Build static export", button "Build static export", "Skip data rebuild (index, stats, charts)", button "Build & deploy" (exact), `/has no Cloudflare Pages project configured/i` | unchanged, on `/sites/<id>/publish` | `deploy-page:48,57,60`, `build:87-102`, `site-scope` (rewritten) |
-| `/select a specific site from the sidebar to build & deploy\./i`, `/select a specific site/i` (charts) | **gone** (count 0 pinned) | `site-scope` (rewritten) |
-| `/author the default dashboard/i` | unchanged, on the Charts tab | `site-scope` (rewritten) |
-| `alias-section-global|site`, `alias-label-*`, `alias-triggers-*`, `alias-suggestion-*`, `alias-add-site`, `alias-save-*`, `alias-saved-*`, h2 "Global", h2 "This site — testsite" | unchanged, on the Search aliases tab | `aliases:17-59` |
-| button "Build index", label "Build index output", "Build stats dataset", "Build stats dataset output", "Stats built" | unchanged, inside the Pool disclosure | the nine build specs |
-| h2 "Build index" visible / h2 "Build static export" absent | on `/sites` after opening "Pool jobs" | `build:80-83` |
-| sidebar link `/build/i` → `/build` | `/sites/i` → `/sites` | `dashboard:116-119` |
-| `getByLabel("Active site")` value on `/sites/<id>/<tab>` | = the path's id; `selectOption` navigates | `site-scope` (rewritten) |
-| `"Charts tab"` link `aria-current="page"` | new | `navigation` (new) |
-| `/site id/i`, `/site title/i`, `/save site/i`, `role=status` "Saved", `/delete/i`, `/migrate existing settings/i`, link `/Alpha Site/` | unchanged | `sites-crud` (11 tests) |
-| `/^cut release$/i`, "Cut release 9.9.10." on `/changelog` | unchanged (file moved, import repointed) | `cut-release.spec.ts` |
-| `/sites/definitely-not-a-site` → 404 | unchanged (the layout's `notFound()`) | `navigation:132-140` |
-
-## Verification
-
-1. After each of commits 1–4: tsc in the six packages; `pnpm -C common test`; editor units
- (`activeSite.test.ts`, `nav.test.ts` included).
-2. Grep gates after commit 4, over `editor/ common/` excluding `node_modules`, `.next`,
- `CHANGELOG.md`, `plans/`:
- - `"/(charts|aliases|deploy|build|homepage)(\?|"|/)` and the backtick form as URLs → only
- `editor/next.config.ts` (the `source`s + comment) and `editor/e2e/navigation.spec.ts`.
- (`site-scope.spec.ts` deliberately pins no retired URL.)
- - `editor/app/charts editor/app/aliases editor/app/deploy editor/app/build
- editor/app/homepage` do not exist; `editor/app/sites/lib/{buildDeployCore,buildAction,
- deployAction,cutReleaseAction,buildModeAction,homepageActions,chartsActions,
- aliasesActions}.ts` and `editor/app/sites/[siteId]/{layout.tsx,lib/siteCache.ts,
- components/SiteTabs.tsx,charts/page.tsx,aliases/page.tsx,publish/page.tsx}` do.
- - `Select a specific site|from the sidebar|in the sidebar to` → 0 under `editor/app`.
- - `label: "Charts"|label: "Deploy"|label: "Build"|label: "Homepage"|label: "Search
- aliases"|ChartColumnBig|Hammer|House|Regex|Rocket` in `nav.ts` → 0; `href:` count in
- `nav.ts` → 11; `Interim` in `nav.ts` → 0.
- - `revalidatePath("/charts")|revalidatePath("/deploy")|revalidatePath("/homepage")` → 0;
- `revalidatePath("/sites")` → 8 (was 5); `revalidatePath("/sites/[siteId]"` → 2 (`"layout"`
- in `sites/actions.ts`, `/charts", "page"` in `sites/lib/buildAction.ts`).
- - `seedsSiteParam = !pathname.startsWith("/sites")` → still exactly one hit
- (`SiteScopeSelect.tsx`); `siteIdFromPathname` → `activeSite.ts`, its test,
- `SiteScopeSelect.tsx`.
- - `^"use server"` → present in the seven action files under `sites/lib/`, absent from
- `buildDeployCore.ts`.
- - `from "\.\./\.\./(build|deploy)/` → 0; `from "\.\./deploy/components/CutReleaseForm"` → 0
- (`changelog/page.tsx` repointed).
- - `page.goto("/build")|goto("/deploy|goto("/charts|goto("/aliases|goto("/homepage` under
- `editor/e2e` → only `navigation.spec.ts`; `getByRole("button", { name: "Build index" })`
- under `editor/e2e` → only `helpers.ts`.
- - `Individual steps` → `sites/[siteId]/publish/page.tsx` + `build.spec.ts`; `Pool jobs` →
- `sites/page.tsx`, `helpers.ts`, `build.spec.ts`.
- - the render-path guard: `pnpm -C common exec tsx --test
- controller/noCorpusWalkInRenderPaths.test.ts`.
-3. e2e once after commit 5, detached (`cd editor && setsid nohup sh -c 'pnpm e2e -- <specs>;
- echo exit=$?' > $CLAUDE_JOB_DIR/tmp/e2e.log 2>&1 < /dev/null & disown`):
- `site-scope.spec.ts deploy-page.spec.ts build.spec.ts aliases.spec.ts navigation.spec.ts
- dashboard.spec.ts settings.spec.ts sites-crud.spec.ts cut-release.spec.ts
- channel-build-toggle.spec.ts regional-vtt-fallback.spec.ts duplicate-shorts.spec.ts
- jobs.spec.ts availability.spec.ts channel-site-membership.spec.ts perf-budget.spec.ts
- pulse.spec.ts auto-refresh.spec.ts` (there is no `changelog.spec.ts`; `cut-release.spec.ts`
- is the changelog page's). Port fallback `PORT=3111 EXPORT_PORT=3110 OLLAMA_STUB_PORT=11535`;
- never kill anything.
-4. **No editor boot against `transcripts/`, nothing written under it.**
-5. Manual (optional, `PORT=3021 pnpm dev:test`): `/sites` reads list → Release notes → Build
- all sites (Basic|Docker) → Hub → Pool (closed); open "Pool jobs", run Build index, see its
- card above the disclosure; `/sites/testsite` shows the h1 and four tabs with Settings
- current; Charts/Search aliases/Publish tabs render, the picker reads `testsite`, switching
- it (with a second site) lands on the same tab of the other site, "All sites" lands on
- `/sites`; `/charts?site=testsite` → the Charts tab with `?site=testsite` still in the bar;
- `/deploy`, `/build`, `/homepage` → `/sites`; the sidebar's Sites group has one entry; the
- palette finds Sites by "deploy" and "hub"; `/sites/nope/charts` → 404.
-
-## Commit 5 — `plans: slice 5 shipped, and the docs say so`
-
-- `editor/CHANGELOG.md` `[Unreleased]` first bullet, house voice (`:4` is the model): **A site
- has tabs, and the family has one page.** Charts, Search aliases, Deploy, Build and Homepage
- were five sidebar entries beside *Sites*, three of them reading the site from a `?site=`
- parameter the sidebar picker had to seed, one of them (Build) about no site at all, and one
- (Homepage) about the family's own hub. A site is one thing now: **`/sites/<id>` is Settings ·
- Charts · Search aliases · Publish**, the site named in the path, the picker following it
- (and Dashboard and Channels following the picker). **`/sites` is the family page**: the
- list, then *Release notes*, *Build all sites* with the Basic/Docker mode, the *Hub*, and the
- *Pool* — the corpus-wide index, stats, sidecar and archive jobs — folded under a disclosure.
- Search aliases keep both sections on the site's tab: the global dictionary and the site's
- overrides. Every button, label and log is unchanged; "Select a specific site from the
- sidebar" is gone because a site's page always has one. The five routes redirect — a
- `?site=<id>` bookmark lands on that site's tab (the query rides along), `?site=__all__` and
- the bare routes on `/sites`; a bookmark to a deleted site 404s there exactly as
- `/sites/<id>` does. The Sites group is one entry; the nav is **eleven**, the IA doc's end
- state. **Nothing on disk changes.**
-- `plans/editor-operations-ia.md:72` → `- **Sites** — Sites *(Charts, Search aliases, Deploy,
- Build and Homepage folded in, 2026-08-30)*`; `:147-150` bullet 5 → "**Sites absorb charts /
- aliases / deploy / build / homepage — SHIPPED** (`<sha1>` → `<sha5>`; see "Slice 5, as
- shipped" below). The bullet's premise — "all per-site facts already" — was wrong for two of
- five …"; new `## Slice 5, as shipped` after the 8c section (`:603-`): the four commits; the
- three operator decisions (A, B, the nav end state) with the reason each was needed; findings
- 1–16; what stayed (`seedsSiteParam` and its reason, `BUILD_KINDS`' mismatch,
- `EditorAliasesClient`'s null branch, the charts preview's last-composed data, the hub deploy
- script's project name, `RunningJobsList` as the Pool's renderer, `/api/*` untouched); the
- flat `sites/components/` decision and why.
-- `plans/STATE.md:6` "Last updated" prepend (previous demoted to "Previously:"); after `:301`
- (#12) a `13. ~~**Editor IA slice 5** (Sites absorb the five)~~ — **DONE 2026-08-30**, `<sha>`
- → `<sha>`. Plan: [`editor-ia-slice-5.md`]; outcome: "Slice 5, as shipped" and the FACTS
- section "Verified 2026-08-30 — editor IA slice 5 seams". The nav is eleven; the IA doc's UI
- slices are complete.`; `:308-311` "Recommended next (editor IA)" → the **transcode band**
- (`EXTERNAL_BAND_IDS` to three, needs the snapshot writer), **Phase 6**, and **slice 9**
- (gated on the sweep running in production).
-- `plans/FACTS.md`: append `## Verified 2026-08-30 — editor IA slice 5 seams (a site has tabs;
- the family has one page)` after the 8c section: census (b)'s table; the seven import edges
- and where each went; `matchHas` anchoring (`prepare-destination.js:101`) and the query merge
- (`:278-284`, `resolve-routes.js:509-517`); the metadata template rule
- (`generate-metadata.md:284-287`); `revalidatePath` literal vs `"layout"`
- (`revalidatePath.md:38-39,151,155-162`); `seedsSiteParam`'s reason and the path rule beside
- it; `BUILD_KINDS` in both directions; `_homepage` and `isValidSiteId`; the hub deploy
- script's hardcoded project; `idBaseUrl` absolute URLs; `getSite` throwing on a malformed id
- (why the tab pages guard through `getSiteCached`); the e2e labels newly co-resident on
- `/sites` (three occurrences of a site title) and why none collides.
-- Memory: left to the reviewer (`ia-slice-5-shipped.md` + a `MEMORY.md` line).
-
-## Out of scope
-
-Fixing `BUILD_KINDS`. Narrowing `EditorAliasesClient`'s `siteId: string | null`. Per-site
-charts preview data (composing the `[siteId]` for the preview). The hub's deploy script vs the
-form's `cloudflareProject`; `socialLinks` on `HomepageConfig`; the three adjacent "hub URL"
-globals; the dead `readHomepageTemplates`/`writeHomepageTemplates` (census b). Cookies for the
-active site. A nav-count e2e (the node test is it). `/api/*` — nothing there moves. Data
-migration — none.
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`): write the plan to
-`plans/editor-ia-slice-5.md`, commit it alone, then spawn one `general-purpose` agent, `model:
-"opus"`, with: the plan path; the shell caveats (the Bash tool runs zsh — quote every glob and
-every `[siteId]`/`[slug]` path, `--include='*.ts'`; no word-splitting of `$VAR` commands; POSIX
-loops inside `sh -c`; `git commit -F <file under $CLAUDE_JOB_DIR/tmp>`; stage by explicit path,
-never `git add -A`; `git mv` for every move so history survives); never boot against
-`transcripts/`; e2e detached (memory `e2e-run-detached`); tmp under `$CLAUDE_JOB_DIR/tmp`; the
-two trailer lines; the report contract (shas + one line each; exact gate outputs incl. the
-unit-test count before and after; e2e per spec with retries; every divergence and why; whether
-`nav.test.ts` loaded `lucide-react`; anything undone). Fable reviews on return (`git log
---oneline 2a8081e..`; `[siteId]/layout.tsx`, `siteCache.ts`, `SiteTabs.tsx`; `activeSite.ts` +
-test; the `SiteScopeSelect.tsx` hunks — `onSite`, the effect, `onChange`, the untouched `:30`;
-`next.config.ts` array order and `siteQuery`; the three tab pages; `sites/page.tsx` section
-order; every moved file diff-against-rename (import lines only, plus finding 7's three
-components); `nav.ts`; `sites/actions.ts:193`; the deletions; the twelve repointed specs and
-`helpers.ts`; re-runs grep gates + `pnpm -C common test` + editor units, not e2e), sends fixes
-via SendMessage, and reports.
-
----
-
-# Appendix — the census (verified 2026-08-30 at `2a8081e`)
-
-## Census (a) — specs, links, nav arithmetic
-
-**Nav today** (`nav.ts`): Corpus 3, Operations 1, Sites 6 (`/sites`, `/charts`, `/aliases`,
-`/deploy`, `/build`, `/homepage`), Machine 6 = 16. Minus five = **11** (`nav.ts:42` "the end
-state is eleven" holds). `nav.ts:89-90` says "folds these FOUR" but lists five. Palette
-(`CommandPalette.tsx:254`) draws `NAV_GROUPS`, so the five leave it too. `navigation.spec.ts`
-has NO nav-count test; its redirect test (`:110`) is the shape to extend, and its 404 test
-(`:132`) already covers `/sites/definitely-not-a-site`.
-
-**Specs that hit the five URLs:**
-- `/build` (9 gotos): `build.spec.ts:9,28,55,79`, `channel-build-toggle.spec.ts:17` (helper
- `runBuild`), `regional-vtt-fallback.spec.ts:22` (helper `buildIndex`),
- `duplicate-shorts.spec.ts:178` (helper `buildData`, also "Build stats dataset"),
- `jobs.spec.ts:21`, `availability.spec.ts:190`. All pin `getByRole("button", { name: "Build
- index" })` + `getByLabel("Build index output")` (aria-label is `${title} output`,
- `deploy/components/JobLane.tsx:201` — route-independent). `build.spec.ts:79` pins h2 "Build
- index" visible AND "Build static export" absent on `/build`, then `/deploy` (`:86`) →
- "Individual steps" click → h2 "Build static export", button, label "Skip data rebuild
- (index, stats, charts)". Three specs carry the same six-line build helper inline.
-- `/deploy` (8 gotos): `deploy-page.spec.ts:19,43,52,68,111,127` (all `?site=<id>`; pins h2
- "Release notes" / "Build & deploy" / "Build all sites" and their vertical order; button
- "Build & deploy" exact enabled/disabled; `/has no Cloudflare Pages project configured/i`;
- group "Build mode" → "Basic"/"Docker" `aria-pressed`; `/Docker builds are a follow-up/i`
- (`BuildModeToggle.tsx:58`); group "Build specific sites" → "Select Alpha"/"Select Beta", "2
- selected", "Deploy after build", "Build selected"/"Build & deploy selected", `/Basic mode
- runs these one at a time/i`); `settings.spec.ts:93` (bare `/deploy`, Build mode → Docker
- pressed); `site-scope.spec.ts:74,87` (`?site=__all__` → `/select a specific site from the
- sidebar to build & deploy\./i` + "Build & deploy" disabled; `?site=alpha` → text count 0).
-- `/aliases` (3 gotos): `aliases.spec.ts:16,25,52` — testids `alias-section-global|site`,
- `alias-label-*`, `alias-triggers-*`, `alias-suggestion-*`, `alias-add-site`, `alias-save-*`,
- `alias-saved-*` (templated in `EditorAliasesClient.tsx`; route-independent). `:25` uses
- `?site=testsite`; `:16,:52` are bare (Global section). Reads `test-transcripts/
- search-aliases.json` (global) and `sites/testsite/search-aliases.json` (per-site).
-- `/charts` (2 gotos): `site-scope.spec.ts:63,66` — `?site=__all__` → `/select a specific
- site/i`; `?site=alpha` → `/author the default dashboard/i`.
-- `/homepage`: **zero e2e coverage**. h1 "Homepage (project site)" (`homepage/page.tsx:16`).
-- `dashboard.spec.ts:108-119`: `sidebar.getByRole("link", { name: /build/i })` →
- `href="/build"` — the ONLY nav-href assertion for any of the five.
-
-**In-app links to the five** (non-e2e): `nav.ts:91-95`; `sites/[siteId]/page.tsx:59`
-`href={`/charts?site=${siteId}`}` "Edit charts dashboard →" (the one existing per-site
-cross-link); `aliases/page.tsx:47` → `/build`; `charts/page.tsx:59` → `/build`, `:27` →
-`/sites`; `settings/components/SettingsForm.tsx:288` `<a href="/deploy">`. No `router.push`/
-`redirect()` targets them. `common/` has none.
-
-**`revalidatePath`:** `homepage/actions.ts:50` (`/homepage`); `build/buildAction.ts:64`
-(`/charts`); `deploy/buildModeAction.ts:24` (`/deploy`); `deploy/cutReleaseAction.ts:112-114`
-(`/`, `/changelog`, `/deploy`); `sites/actions.ts:192-193,207,217-218`.
-
-**Comment-only mentions to reword:** `nav.ts:42,89-90`; `channels/[slug]/normalizeActions.ts:10`;
-`common/controller/normalizeAll.ts:16`; `common/jobs/jobKinds.ts:134`;
-`deploy/components/BuildSitesPanel.tsx:62`; `SiteScopeSelect.tsx:14-16,25-30`;
-`deploy-page.spec.ts:5-7`, `site-scope.spec.ts:88`, `build.spec.ts:99`.
-
-**HAZARD — `SiteScopeSelect.tsx:30`:** `seedsSiteParam = !pathname.startsWith("/sites")` —
-the picker deliberately does not seed `?site=` on `/sites*` routes. Charts and Deploy read
-`?site=` today; under `/sites/[siteId]/…` the site is the PATH segment, so those pages must
-read `params.siteId`, not `searchParams.site`, and the picker's guard stays.
-
-**No `/api/*` route** belongs to any of the five. Charts preview data comes via
-`next.config.ts` `rewrites()` (`/stats|/summaries|/transcripts` → `/exported/…`), absolute
-paths — unaffected by the move.
-
-**Layout:** `layout.tsx:66-120` `renderLink` is flat, one level; a per-site sub-nav is new
-construction. `sites/[siteId]/page.tsx`: `notFound()` guard `:36-38` (`isValidSiteId` +
-`listSiteIds`), `force-dynamic`, breadcrumb `:49-55`, h1 `{siteTitle || siteId}` `:57`,
-`generateMetadata` `${siteId} — Sites`.
-
-## Census (b) — what the five pages actually are (the IA bullet's premise is wrong for 2 of 5)
-
-| page | files / lines | scope | reads | writes (actions) | `?site=` |
-|---|---|---|---|---|---|
-| `/charts` | 3 / 171 | **per-site** (templates); preview DATA = last-composed site | `readTemplates(paths, siteId)` → `sites/<id>/chart-templates.json`; `useStats`/`useSummaries` fetch `/stats/*` = `export/public/stats` = whichever site `compose-site` ran last (`compose-site.ts:682-686`) | `saveDefaultDashboardAction(siteId, dashboard)` (`charts/actions.ts:13-22`), no revalidate | yes, REQUIRES one site (`page.tsx:38-48`); `resolveActiveSite` (`lib/activeSite.ts:30-51`) |
-| `/aliases` | 3 / 453 | **global + per-site overlay** | `readGlobalAliases` → `transcripts/search-aliases.json` (`DEFAULT_ALIASES` fallback); `readSiteAliases` → `sites/<id>/search-aliases.json`; merged at compose (`effectiveSiteAliases`, `aliasesStore.ts:68-73`, per-site id SHADOWS global) | `saveGlobalAliasesAction`, `saveSiteAliasesAction` (`aliases/actions.ts:15-29`), no revalidate | optional; all-sites renders Global only; `EditorAliasesClient` draws h2 "Global" + h2 `This site — <id>` |
-| `/deploy` | 13 / 1706 | **per-site target + global chrome** | `listSites` (active site's `siteTitle`/`cloudflareProject` AND the whole batch list); `export/CHANGELOG.md` (global); `export/out/index.html` mtime (`resolveOutDir` ignores siteId, `buildDeployCore.ts:20-22`); `settings.buildPipeline.mode` (global) | `cutReleaseAction` (`revalidatePath` `/`,`/changelog`,`/deploy`), `setBuildModeAction` (`/deploy`), `deployExportAction(siteId)` (kind `deploy-export`, queue `deploy`); from `build/buildAction`: `buildExportAction`, `buildAndDeployAction`, `buildAllSitesAction`, `buildAndDeployAllSitesAction` | optional; null = single-site controls disabled, batch panel still lists every site |
-| `/build` | 4 / 889 | **corpus-wide, no site notion at all** | `activeQueueNames()`, `liveJobRows(BUILD_KINDS)` — no `searchParams`, no `getPaths`, no `listSites` | 11 actions in `build/buildAction.ts` (index, stats [`revalidatePath("/charts")` `:64`], export(siteId), build-deploy, normalize/archive ×3 transcripts, ×3 live-chat, build-all, build-deploy-all) | **never** |
-| `/homepage` | 3 / 170 | **global — the hub's identity** | `getHomepageConfig` → `transcripts/sites/_homepage/homepage.json` (`_homepage` is inside `sitesDir` with an underscore so it can never be a siteId, `paths.ts:22-28`) | `saveHomepageConfigAction` (`revalidatePath("/homepage")`) | **never**; page is sync |
-
-**Deploy's sections** (`deploy/page.tsx`): h2 "Release notes" (`:84`, `CutReleaseForm
-workspace="export"`), h2 "Build & deploy" (`:111`, `BuildModeToggle`, `BuildDeployButton`),
-`<details><summary>Individual steps` (`:135`: h3 "Build static export" `BuildExportButton`,
-h3 "Deploy static export" `DeployButton`), h2 "Build all sites" (`:173`, `BuildAllSitesButton`,
-h3 "Or pick specific sites" `BuildSitesPanel` `role=group aria-label="Build specific sites"`,
-visible `<span>{s.siteTitle}</span>` at `:83`).
-
-**Build's sections** (`build/components/BuildButtons.tsx`): eight `StreamActionLog`s (Build
-index, Build stats dataset, Normalize transcripts, Archive transcripts, Archive combined
-transcripts, Normalize live chat, Archive live chat, Archive combined live chat), each with a
-`QueueControl`, archives with `ArchiveOptionsControl`; then `RunningJobsList` over
-`BUILD_KINDS` (six kinds — missing the three live-chat kinds it enqueues and including
-`build-export` which no button here enqueues; pre-existing, note only).
-
-**`build/` ↔ `deploy/` are already circular:** `build/buildAction.ts:34` imports
-`deploy/buildDeployCore`; four `deploy/components/*` import `build/buildAction`. Also
-`changelog/page.tsx:12` imports `deploy/components/CutReleaseForm` (`workspace="editor"`;
-`cut-release.spec.ts` drives it on `/changelog`).
-
-**Homepage extra facts:** the hub package (`homepage/`) has its own `compose`/`build`/`deploy`
-scripts (`deploy` hardcodes `--project-name archilyzer`, so the form's `cloudflareProject`
-field is NOT what `pnpm deploy:homepage` uses); no editor action/job/button builds or deploys
-the hub. `socialLinks` exists on `HomepageConfig` but has no form field. Three adjacent
-globals: `HomepageConfig.siteUrl` (this page) vs `SiteSettings.homepageUrl` ("Family hub URL"
-on `/settings`) vs per-site `Site.hubUrl` (`SiteForm.tsx:249-251`). Dead neighbour:
-`readHomepageTemplates`/`writeHomepageTemplates` (`chartsStore.ts:90-105`) have no consumer.
-
-**The site picker** (`SiteScopeSelect.tsx`): localStorage key `"activeSite"`
-(`lib/activeSite.ts:13`), `ALL_SITES = "__all__"`, `usePathname`/`useSearchParams`/`useRouter`,
-`router.replace(`${pathname}?${params}`)`; seeds `?site=` from storage on every non-`/sites`
-route (`:30`). No cookies anywhere in the five directories.
-
-**Only poll among the five:** `deploy/components/JobLane.tsx:56-85` — `/api/jobs/<id>/log?from=…`
-at 1 s until terminal (a `/jobs` route; unaffected).
-
-## Census (c) — the `/sites` tree, the site model, scoping, precedents (Next 16.2.3)
-
-- **`/sites` tree** is six files: `sites/page.tsx` (59, sync, no `searchParams`; list + `+ New
- site` + `MigrateButton`/`DeleteSiteButton`), `sites/[siteId]/page.tsx` (73: `force-dynamic`,
- `generateMetadata` `${siteId} — Sites`, `notFound()` at `:36-38`, breadcrumb div `:49-55`,
- h1 `{siteTitle || siteId}` `:57`, the `/charts?site=` link `:58-63`, `<SiteForm>`),
- `sites/new/page.tsx` (53), `sites/actions.ts` (220: `saveSiteAction` one FormData over every
- field incl. `cloudflareProject`, `archives`, `archiveMaxBytes`, `duplicates`, `pwa`, `hubUrl`;
- `deleteSiteAction` rm -rf the site dir incl. `chart-templates.json` + `search-aliases.json`;
- `migrateToSitesAction`), `components/SiteForm.tsx` (693, four fieldsets Channels / Channel
- groups / Social links / Related sites, `role=status` "Saved."), `SiteListActions.tsx`.
- **No `layout.tsx`, no tabs; `[siteId]` is a leaf.** `/sites/new` is a static sibling —
- static wins over `[siteId]`, so a static child of `[siteId]` is fine, but a static child of
- `/sites` (e.g. `/sites/publish`) would shadow a real site with that id (`SITE_ID_RE =
- /^[a-z0-9][a-z0-9-]*$/`). Don't add static siblings of `[siteId]`.
-- **Model** (`common/lib/site.ts`): `Site` type `:38-100`; `getSite` `:356` (sync, throws on a
- malformed id), `listSiteIds` `:371` (dir + `site.json`, sorted), `listSites` `:388`,
- `defaultSiteId` `:394`, `writeSite` `:399` (atomic), `deleteSite` `:469`. Charts' store =
- `siteChartTemplatesFile` `:124`; aliases' per-site store = `siteAliasesFile` `:131`.
- `HomepageConfig` (`common/lib/homepage.ts:21-34`) at `sites/_homepage/homepage.json` —
- `_homepage` is rejected by `isValidSiteId`, so the hub can never be a `[siteId]`.
-- **Scoping**: `lib/activeSite.ts` — `ALL_SITES="__all__"`, `ACTIVE_SITE_KEY="activeSite"`
- (localStorage, no cookie), `resolveActiveSite(param, ids)` (lone site when unset).
- Consumers today: `/` (`page.tsx:50-56`), `/channels` (`:117-123`), `/charts`, `/aliases`,
- `/deploy`, `/channels/new` (client, `window.location.search`). `SiteScopeSelect.tsx`:
- `seedsSiteParam = !pathname.startsWith("/sites")` `:30` (comment `:26-29`: seeding there
- clobbered an in-flight push to `/sites/<id>`); reconcile effect `:41-62` WRITES storage when
- a valid `?site=` is in the URL; `onChange` `:64-71` writes storage then `router.replace
- (pathname?site=)`; "All sites" option only when `sites.length > 1`. **On a `/sites/<id>/…`
- URL the picker would show the previously stored site while the page shows another.**
-- **`site-scope.spec.ts` test 5 (`:70-93`)** pins copy that says "from the sidebar" and an
- all-sites disabled state that cannot exist under `/sites/<id>/…`; test 4 (`:61-68`) likewise
- pins `/charts?site=__all__`. Both must be rewritten, not repointed. `sites-crud.spec.ts` (11
- tests, 307 lines) is the `/sites` contract: `/site id/i`, `/site title/i`, `/save site/i`,
- `getByRole("status").filter({ hasText: "Saved" })`, `getByRole("link", { name: /Alpha Site/
- })` (`:59,65`), `getByText("Doomed")).toHaveCount(0)` after delete (`:91`); note `:56-59` —
- the site title also appears in the picker, so bare `getByText(title)` matches two elements.
-- **Layout/nav**: `layout.tsx:60-63` reads `listSites()` only for the picker; `renderLink`
- `:66-120` flat; **no active-link highlighting exists anywhere in the sidebar** (only
- `ChannelTabs.tsx:37` uses `aria-current`). Docs verified: layouts do not rerender and cannot
- read search params/pathname (`layout.md:154,180,240`); layout `params` is a Promise.
-- **Precedent for a dynamic segment with children**: `channels/[slug]/layout.tsx` (73 lines:
- `force-dynamic`, own `notFound()` `:37`, React `cache()`d config read `:36`, breadcrumb
- `:47-53`, h1 `:54-56`, `<ChannelTabs>` `:64`) + `ChannelTabs.tsx` (`"use client"`,
- `useSelectedLayoutSegment()`, `aria-current="page"`, `aria-label="${label} tab"`). No
- `loading.tsx` anywhere (navigation.spec header: it breaks 404 status). `/operations/sync` is
- NOT a directory — it is `[id]/page.tsx` with a catalog entry; not a precedent here.
-- **Redirects** (`next.config.ts:48-80`): fixed source → fixed destination, always
- `permanent: false`; docs `redirects.md:43-53,134-142`: query values pass through, `/:param`
- path params, and `has: [{ type: "query", key, value: "(?<name>…)" }]` with `:name` in the
- destination is the config-level way to route on `?site=`. `revalidatePath("/operations/[id]",
- "page")` (`channels/actions.ts:312,388`) is the precedent for revalidating a dynamic route.
-- **`/api`**: nothing site/build/deploy/homepage-specific (26 handlers, zero `siteId` hits).
- `exported/[...path]/route.ts` serves `exportPublicDir` for the charts preview; not
- site-scoped (pre-existing).
-- **e2e helper** `helpers.ts:74-99` `writeSite(siteId, site)` supports `channels`, `groups`,
- `cloudflareProject`, `siteUrl`, `relatedSites`, `socialLinks`; omits `pwa`/`archives`/
- `duplicates`/`archiveMaxBytes`/`hubUrl`. `helpers.ts:12` imports only `type { Page }` from
- Playwright.
diff --git a/plans/editor-ia-slice-6.md b/plans/editor-ia-slice-6.md
@@ -1,575 +0,0 @@
-# Editor IA slice 6 — the video page: one panel per operation
-
-## Context
-
-**Verified read-only against `ce2ebd9` (clean) on 2026-08-28.** Slice 6 is the IA doc's bullet
-(`plans/editor-operations-ia.md:151-156`): `DigestPanel.tsx` generalizes to an `OperationPanel`
-built per enabled kind from `readVideoFiles()`; `hasDigest()` and `hasAttribution()` go;
-attribution and diarization get a per-video view for free; the "Open in umtool" link
-(`VideoPanel.tsx:219-231`, `data-umtool-link`) stays above the panels. The vision test (`:43-45`):
-a new operation is a registry entry and appears on the video page without a new page.
-
-**Decided (operator, 2026-08-28):** (a) panels are the four registry operations (`OPERATIONS`,
-`operations.ts:1498-1510`), shown when `op.enabled(settings)` OR one of `op.outputs` is in the
-listing; the three external operations (download / transcode / transcription) already have
-their per-video surface — the `PipelineStageCard`s inside `VideoPanel.tsx` (`:257-358`) — and
-get **no** panel. (b) State is `Operation.state(probe)`, never re-derived. (c) One generic
-frame, one body per `settingsBlock`, the digest body byte-identical in its labels. (d) One
-`stateCopy` table; the `digest.spec.ts` pill contract survives verbatim. (e) The speaker
-operations get a per-video **Run** via `ids` threaded through the backfill channel job.
-(f) `hasAttribution` deleted; `hasDigest` becomes a private helper of the channel count.
-(g) The reader lives in `common/controller/videoOperations.ts`; the `Operation` type is not
-changed.
-
-**What the census found (corrects the bullet in six places):**
-
-1. **`hasDigest` is not a video-page helper.** Its one caller is
- `common/controller/channels.ts:94`, inside `countDataFiles` (`:67`) under
- `listChannelStatsFromDisk` (`:214`) — the batch ground-truth walk. It is identity-blind on
- purpose (`digest-server.ts:84-90`: "is there a digest at all", never "is it current") and
- `channelProjection.test.ts:66-67` pins that a record with a non-empty section counts. It is
- defined at `digest-server.ts:91-98`, not `:89`. Moving it into `channels.ts` as a private
- function and deleting the export is the whole of "deletes `hasDigest()`".
-2. **`hasAttribution` was already dead** (`attribution-server.ts:36-38`; zero callers in
- `common editor export homepage umtool mcp`). **`hasDiarization` is NOT dead** and stays:
- `cleanAudioFromTranscribed.ts:125` (the audio-deletion guard), `diarizeOne.ts:185`, and
- `diarization.test.ts:57-92`. (`files.hasDiarization` on `VideoFiles` is a listing flag, a
- different thing, untouched.)
-3. **The page duplicates digest `state()`.** `page.tsx:155-184` calls `resolveDigestTarget`
- with `lane: "local"` and folds `isSectionFresh` + the `derivedFrom` rule per section; the
- registry's `digest.state()` (`operations.ts:1104-1185`) does the same fold at `:1153` and
- `:1176-1178`, and its `resolveTarget` (`:1096-1103`) calls the same resolver with no lane,
- which `resolveDigestChunking` (`digestTarget.ts:69-79`) resolves to `localAppId` — the same
- identity. Dropping the page's copy changes no displayed value. The per-section
- `{present, fresh, provenance}` detail (`DigestPanel.tsx:38-43`) stays as the digest body's
- `sections`, and this slice makes it the SAME fold: a `digestSectionStates()` helper in
- `common/lib/digest.ts` that both `state()` and the body use.
-4. **`readVideoFiles` has never been called from `editor/`.** The page's own `loadVideoDir`
- (`page.tsx:57-77`) is a `readdir` + per-file `stat` for size/mtime — the Files card needs
- those, so it stays; `readVideoFiles` is a second `readdir` (~free) that the registry's
- `state()` requires as its probe.
-5. **`ids` already exists on the batch and not on the job.** `runBackfillBatch` takes
- `ids?: string[]` (`backfillBatch.ts:99`, intersected with disk at `:290-291`);
- `BackfillChannelJobOptions` (`operationJobs.ts:60-75`) does not, and `countBackfillWork`
- (`backfillBatch.ts:869-926`) walks every dir with no filter — so a per-video job would size
- its progress bar to the whole channel. `editor/app/jobs/jobReplayRegistry.ts:281-284` reads
- `p.kindIds` only. `digestBucketAction` (`digestActions.ts:83-135`) is the precedent for an
- id-scoped job on the other lane. The job's summary line (`operationJobs.ts:120-121`) is
- `Backfill <slug>: N done, …` — what the new e2e waits on.
-6. **The e2e surface.** `digest.spec.ts:569-680` are the three panel tests; every selector
- they use is in the aria table below. `video-page.spec.ts` has 20 tests, all on `VideoPanel`
- labels; its fixture video has metadata + `transcript.en.vtt` and no `transcript.cues.json`,
- so digest classifies it `deferred` there (nothing asserts the pill in that spec today). No
- fixture on disk carries an AI sidecar. `attribution.spec.ts` `seedChannel()` (`:137-148`,
- writes `diarization.json` for `attrvid0001` by default) + `attributionSettings()`
- (`:101-135`, **diarization capture off**) is the seeding pattern — and it is exactly the
- "shown because its output is present" case for the diarization panel. `runBackfill()`
- (`:150-161`) shows the stub-backed run works in that spec.
-
-**Hazards carried through every commit:**
-
-- **Client graph.** `common/lib/operations.ts` imports `digest-server`, `diarization-server`,
- `attribution-server`, `videoStatus` — all `node:fs`. Every `"use client"` file in this
- slice imports from it **as `import type` only** (`OperationClassification`,
- `OperationSettingsBlock`, `OperationGroup`) — the `pauseControl.tsx` lesson. `common/lib/
- digest.ts`, `diarization.ts`, `attribution.ts` have **no imports at all** (verified) and are
- safe for types and pure values. `deferredHint` and `dependsOn` labels reach the client as
- **props**, never by reading the registry.
-- **`"use server"` files must not re-export types** (`digestActions.ts:37-48` explains: the
- transform emits a runtime binding). The new action file declares nothing but functions.
-- **`StreamActionLog` contract** (`common/components/StreamActionLog.tsx`): `accessibleName =
- label ?? buttonLabel` (`:46`); the log is `role="log" aria-label="${accessibleName} output"`
- (`:238`); cancel `"Cancel ${accessibleName}"`; error `"${accessibleName} error"`; queue
- banner `"${accessibleName} queue status"`; the button is disabled until hydrated; on
- completion it calls `router.refresh()` (`:163`), which re-renders the pill.
-- **`resolveDigestTarget` reads `getSettings()` from disk** (`digestTarget.ts:69, 88`), not
- the probe's `settings`, and `getPaths()` memoizes. The reader's unit test sets
- `TRANSCRIPTS_DIR` and `SETTINGS_FILE` at module top before any import
- (`laneForOperation.test.ts:20-29` is the pattern; `readDigestContext` tolerates a missing
- note).
-- **The guard** `noCorpusWalkInRenderPaths.test.ts` bans `listChannelStatsFromDisk |
- buildBackfillSweepPlan | buildDigestSweepPlan` textually under `editor/app`, comments
- included. Nothing new mentions them. (`countBackfillWork` runs inside the job `fn`, as
- `backfillActions.ts` already does — not a render path.)
-- **`revalidatePath` in `onDone`** fires at job end outside a request; `backfillActions.ts:33`
- and `digestActions.ts:76` already do this.
-- **"held — " + `deferredHint`.** Both hints are plural fragments completing "N videos are …"
- (`operations.ts:397-399`): diarization ends "…to include **them**" (`:641-642`), digest
- "…to make **them** digestable" (`:1064-1065`). After "held — " they read acceptably for one
- video. Keep them verbatim — one copy, `operations.test.ts:1163-1177` pins the digest one —
- and say so in the comment. Do not add a singular copy.
-- **A shown-but-disabled operation** (finding 6) would read "stale — regenerating would
- replace this" beside nothing that can regenerate it. The frame adds a muted
- `<span aria-label="${op.id} off">switched off</span>` beside the pill when `!view.enabled`,
- and the speaker body's Run button is not drawn for it.
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/editor-ia-slice-6.md`; commit alone: `plans: slice 6 planned`.
-
-## Order: five commits after the plan
-
-1. **`common: a video's operations are read once, from the registry`** — `videoOperations.ts`
- + test; `digestSectionStates` in `digest.ts` and `digest.state()` on it; `hasDigest` moves
- into `channels.ts`; `hasAttribution` deleted.
-2. **`backfill: a channel job can be scoped to video ids`** — `ids` through
- `runBackfillChannelJob` → `countBackfillWork` → `runBackfillBatch`; in `spec.params`; the
- replay handler and `backfillChannelAction` carry it; the ids test.
-3. **`video page: one panel per operation`** — `OperationPanel` frame, `DigestBody` (renamed
- `DigestPanel`), `SpeakerBodies`, `operationState.ts` + unit test, the page on
- `inspectVideoOperations`; `isSectionFresh` and `resolveDigestTarget` leave `page.tsx`.
-4. **`video page: a speaker operation runs for one video`** — `operationActions.ts`, the Run
- button in the speaker bodies, two new e2e in `attribution.spec.ts`, one assertion in
- `video-page.spec.ts`.
-5. **`plans: slice 6 shipped, and the docs say so`** — CHANGELOG, IA doc, STATE, FACTS, memory.
-
-Gates after each of 1–4: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export homepage
-umtool mcp`; `pnpm -C common test` (867 at plan time — re-measure before commit 1 — plus the
-new file's tests); `pnpm -C editor exec tsx --test "app/**/*.test.ts"` (90 + the
-`operationState` tests). e2e once after commit 5, detached (memory `e2e-run-detached`).
-
----
-
-## Commit 1 — `common: a video's operations are read once, from the registry`
-
-**New helper in `common/lib/digest.ts`, beside `isSectionFresh` (`:513`):**
-
-```ts
-// One row per section kind the current settings ask for. THE SAME FOLD the digest
-// operation's state() counts — a section is fresh here iff state() counts it fresh —
-// so the per-video panel and the channel's work list cannot disagree about one section.
-// A SHARED digest (derivedFrom) is fresh for the receiving video as long as it still
-// points at its canonical member (isSharedFrom's contract; state() returns present on
-// the same condition).
-export type DigestSectionState = {
- kind: DigestSectionKind;
- present: boolean;
- fresh: boolean;
- provenance?: DigestProvenance;
-};
-export function digestSectionStates(
- record: DigestRecord | null,
- sections: readonly DigestSectionKind[],
- target: DigestFreshnessTarget,
-): DigestSectionState[];
-```
-
-`operations.ts:1176-1178` becomes `digestSectionStates(record, sections, freshness).filter((s) => s.fresh).length`
-(the `derivedFrom` early return at `:1153` stays; behaviour identical — `operations.test.ts`
-digest cases stay green). `DigestSectionState` is deleted from `DigestPanel.tsx:38-43` in
-commit 3 and imported from here.
-
-**New `common/controller/videoOperations.ts`:**
-
-```ts
-import type { OperationClassification, OperationGroup, OperationSettingsBlock } from "../lib/operations";
-
-export type VideoOperationView = {
- id: string;
- label: string;
- group: OperationGroup;
- settingsBlock?: OperationSettingsBlock;
- state: OperationClassification; // Operation.state(probe), never re-derived
- enabled: boolean; // op.enabled(settings)
- outputs: { name: string; present: boolean }[]; // op.outputs × files.entries
- deferredHint?: string;
- dependsOn: { id: string; label: string }[]; // operationLabel(depId), operations.ts:1416
- // The resolved target, erased exactly as Operation.resolveTarget erases it. The one
- // consumer that narrows it is the digest body (it needs {target, sections} for its
- // per-section rows). Never crosses to a client.
- target: unknown;
-};
-
-// ONE readVideoFiles per page, ONE resolveTarget + state per operation. Walks OPERATIONS
-// in registry order; filters nothing — `shownOnVideoPage` is the rule.
-export async function inspectVideoOperations(opts: {
- paths: Paths; channelSlug: string; videoId: string; settings: SiteSettings;
-}): Promise<VideoOperationView[]>;
-
-// Shown when the feature is on OR its output is on disk: a sidecar captured before the
-// feature was switched off is still a thing the operator needs to see.
-export function shownOnVideoPage(view: VideoOperationView): boolean;
-
-// Group order first (OPERATION_GROUP_ORDER, operations.ts:332-337: media, transcript,
-// digest, speakers — the order the channel stages and /channels columns use), registry
-// order within a group: Digest, then the three speaker operations. Pure.
-export function orderForVideoPage(views: VideoOperationView[]): VideoOperationView[];
-```
-
-Probe per operation, verbatim from decision (b):
-`{ videoDir, videoId, files: await readVideoFiles(videoDir, { checkUntranscribable: true }), target: await op.resolveTarget({ settings, paths, channelSlug }), settings }`
-— the shape `countBackfillWork` builds at `backfillBatch.ts:886-916` and
-`operations.test.ts:176-186` drives. Header comment: the external operations are deliberately
-absent (their per-video surface is `VideoPanel`'s stage cards); this reader is pure over the
-registry and is the reason a fifth operation needs no page.
-
-**`common/controller/videoOperations.test.ts`** (node:test; env seam at module top as
-`laneForOperation.test.ts:20-29`; fixtures as `operations.test.ts:107-168` — a temp
-`ROOT/channels/<slug>/data/<id>` with `transcript.json`, optional `diarization.json`,
-`attribution.json`, `ai-digest.json` + `transcript.cues.json`): one view per registry entry,
-in `OPERATIONS` order; a diarized video under diarization-enabled settings reads
-`diarization: present`, `attribution-diarized: missing`, `attribution-text: missing`; an
-undiarized one reads `attribution-diarized: blocked` with `dependsOn[0].label ===
-"Speaker diarization"`; `outputs[0].present` tracks the listing; `shownOnVideoPage` is false
-for a disabled operation with no output and true for a disabled one whose sidecar exists;
-`orderForVideoPage` puts `digest` first; an untranscribed dir reads `not-applicable` on the
-speaker operations and `blocked` on digest; a video with no `cues.json` reads digest
-`deferred` with `deferredHint` populated.
-
-**`hasDigest` moves.** `common/controller/channels.ts:15` imports `loadDigest` instead; a
-private `async function hasDigestWithItems(dir: string): Promise<boolean>` above
-`countDataFiles` (`:67`) carries the identity-blind comment from `digest-server.ts:84-90`
-verbatim and the body from `:91-98`; `:94` calls it. Delete `digest-server.ts:84-98`.
-`channelProjection.test.ts:66-67` stays green (its comment may say "the channel count").
-
-**`hasAttribution` deleted:** `attribution-server.ts:36-38`. Its `:14-20` comment cites
-`hasDiarization` — still true, leave it.
-
----
-
-## Commit 2 — `backfill: a channel job can be scoped to video ids`
-
-- `common/controller/operationJobs.ts:60-75` `BackfillChannelJobOptions` gains
- `ids?: string[]` — comment: "Only these videos (intersected with disk by the batch). A stage
- card passes none; the video page passes one. In `spec.params` so a replay stays scoped."
- `:80` destructures it; `:93` → `params: { kindIds, queueKey: opts.queueKey, ids }`;
- `:96` → `countBackfillWork(paths, channelSlug, kindIds, ids)`; `:97-110` passes `ids`.
- `runOperationChannelJob` is unchanged — the dispatcher stays channel-scoped.
-- `common/controller/backfillBatch.ts:869-878` `countBackfillWork(paths, channelSlug, kindIds?,
- ids?)`: filter the dir list to `ids` when given, before the walk. Comment: "the progress
- target must count what THIS run will pull, and an ids-scoped run pulls only those."
- `backfillSweep.ts:168` (three args) is unaffected.
-- `editor/app/channels/[slug]/backfillActions.ts:25-35` `backfillChannelAction(slug, queueKey?,
- kindIds?, ids?)` passes `ids` through.
-- `editor/app/jobs/jobReplayRegistry.ts:281-284`: parse `ids` exactly as `kindIds`
- (`Array.isArray(p.ids) ? p.ids.filter((k): k is string => typeof k === "string") : undefined`)
- and pass it as the fourth argument. Comment: a replayed per-video run stays per-video.
-- Test, in `videoOperations.test.ts` (it owns the settings seam; `backfillBatch.test.ts` is
- pure and has none): `countBackfillWork(paths, slug, ["attribution-text"], [idB])` over two
- transcribed dirs returns `reachable: 1`.
-
----
-
-## Commit 3 — `video page: one panel per operation`
-
-All under `editor/app/channels/[slug]/videos/[id]/`.
-
-**`components/operationState.ts`** (no directive; pure; imported by client and server):
-
-```ts
-import type { OperationClassification, OperationGroup, OperationSettingsBlock } from "yt-dlp-transcript-common/lib/operations";
-
-// The serializable half of VideoOperationView — what crosses to the client. No `target`.
-export type OperationPanelView = {
- id: string; label: string; group: OperationGroup; settingsBlock?: OperationSettingsBlock;
- state: OperationClassification; enabled: boolean;
- outputs: { name: string; present: boolean }[];
- deferredHint?: string; dependsOn: { id: string; label: string }[];
-};
-
-// THE ONE TABLE. The present / stale / missing rows are digest.spec.ts's contract
-// (`:580` "not generated", `:585,620` "current", `:628` contains "stale") and must not move.
-export function stateCopy(view: OperationPanelView): string;
-export function stateTone(state: OperationClassification): "success" | "warning" | "muted";
-```
-
-| `state` | pill text | tone |
-|---|---|---|
-| `present` | `current` | success |
-| `stale` | `stale — regenerating would replace this` | warning |
-| `partial` | `partly stale — regenerating would replace the stale sections` | warning |
-| `missing` | `not generated` | muted |
-| `missing-input` | `input gone — needs media` | warning |
-| `deferred` | `held — ` + `deferredHint` (verbatim; `held` alone if none) | muted |
-| `blocked` | `waiting on ` + `joinLabels(dependsOn.map(d => d.label))` ("A", "A and B" — copy `OperationDetail.tsx:284-287`) | muted |
-| `not-applicable` | `not applicable` | muted |
-
-`partial` contains "stale", so `digest.spec.ts:628` (`toContainText("stale")`) passes whether
-the config change leaves the video `stale` or `partial` — say so in the test comment. Tone
-classes: `text-success` / `text-warning` / `text-muted-foreground`, as `DigestPanel.tsx:84-90`.
-
-**`components/operationState.test.ts`** (node:test, `app/**/*.test.ts` glob): the eight rows;
-`deferred` with and without a hint; `blocked` with one and two dependencies; the three digest
-strings asserted as literals with a comment naming `digest.spec.ts`.
-
-**`components/OperationPanel.tsx`** (`"use client"`; type imports only):
-
-```tsx
-export type OperationPanelBody =
- | { block: "digest"; data: DigestBodyData }
- | { block: "diarization"; data: DiarizationBodyData }
- | { block: "attribution"; data: AttributionBodyData }
- | { block: undefined }; // an operation with no settings block: outputs list only
-
-export function OperationPanel({ slug, videoId, view, body }: {
- slug: string; videoId: string; view: OperationPanelView; body: OperationPanelBody;
-})
-```
-
-Frame: `<section aria-label={`${view.id} panel`} className="flex flex-col gap-4 rounded border border-border p-3">`,
-header row with `<h2 className="text-lg font-semibold">{view.label}</h2>`, the pill
-`<span aria-label={`${view.id} freshness`}>{stateCopy(view)}</span>`, and, when
-`!view.enabled`, `<span aria-label={`${view.id} off`} className="text-xs text-muted-foreground">switched off</span>`.
-Body: `switch (body.block)` — **exhaustive**, the `settingsFormFor` precedent
-(`operations/[id]/page.tsx:71-110`). The `undefined` arm renders
-`<ul aria-label={`${view.id} outputs`}>` of `outputs` with present / absent — that arm is the
-vision test's guarantee for a registered operation with no body yet.
-
-**`components/DigestBody.tsx`** = `git mv DigestPanel.tsx DigestBody.tsx`, then: delete the
-`<section>`/`<h2>`/pill (`:76-98`) — the frame owns them; export `DigestBody` (was
-`DigestPanel`) and `DigestBodyData` (was `DigestPanelData`, `:45-60`, same fields; `sections:
-DigestSectionState[]` now imported from `common/lib/digest`); delete `:38-43`. Everything else
-stays byte-for-byte: `SharedFrom`, `Warnings`, `SectionProvenance`, `Chapters`, `Tags`,
-`OverridesEditor`, the `StreamActionLog` block (`:127-150`, `digestBucketAction`, "Regenerate
-digest", the lane select). Header comment (`:3-17`) is kept and gains one line: the frame is
-`OperationPanel`; this is the digest's body.
-
-**`components/SpeakerBodies.tsx`** (`"use client"`; `import type { DiarizationEngine }` from
-`common/lib/diarization`, `import type { AttributionProvenance }` from `common/lib/attribution`):
-
-```ts
-export type DiarizationBodyData = {
- record: { generatedAt: string; audioSeconds?: number; durationMs?: number; speakers: number;
- turns: number; engine: DiarizationEngine;
- windowing?: { windows: number; windowSeconds: number; overlapSeconds: number } } | null;
-};
-export type AttributionBodyData = {
- record: { generatedAt: string;
- speakers: { index: number; label: string; cluster?: number; confidence?: number; seconds?: number }[];
- segments: number; warnings: number; provenance: AttributionProvenance } | null;
-};
-export function DiarizationBody({ slug, videoId, view, data }: …)
-export function AttributionBody({ slug, videoId, view, data }: …)
-```
-
-(Field names above follow `DiarizationRecord` (`diarization.ts:52-82`) and `AttributionRecord`
-(`attribution.ts:91-138`) — verify each against the types and project only what exists.)
-
-`DiarizationBody`: `record === null` → `<p aria-label="diarization empty">No speaker turns have been captured for this video.</p>`;
-else `<dl aria-label="diarization provenance">` with `Row`s (copy `DigestPanel.tsx:323-330`)
-for `engine`, `segmentationModel`, `embeddingModel`, `model`, `version`, `threshold` (each
-only when set), `generated`, `audio` (m:ss), `took` (`durationMs`), `windows` when present;
-then `<p aria-label="diarization summary">{speakers} speakers · {turns} turns</p>`.
-`AttributionBody`: `record === null` → `<p aria-label="attribution empty">No speaker names for this video yet.</p>`;
-else `<dl aria-label="attribution provenance">` for `method`, `engine` (`appId`), `model`
-(the `modelRequested → model` rule from `DigestPanel.tsx:277-284`), `promptVersion`,
-`transcriptSource`, `diarizationGeneratedAt`, `chunks` (`chunksOk of chunks usable`),
-`generated`, `cost`; `<ul aria-label="attribution speakers">` one
-`<li aria-label={`attribution speaker ${index}`}>` per speaker; `<p aria-label="attribution summary">{segments} segments · {warnings} warnings</p>`.
-File header comment: **both attribution operations share `attribution.json`**
-(`operations.ts:789-812`), so `attribution-diarized` and `attribution-text` panels read the
-same record with their own `state()` — the pill differs, the body does not; the
-`provenance.method` row is how a reader tells which lane wrote it. The Run button is commit 4.
-
-**`lib/videoOperationPanels.ts`** (server-only, no directive):
-
-```ts
-export type VideoOperationPanel = { view: OperationPanelView; body: OperationPanelBody };
-export async function loadVideoOperationPanels(opts: {
- paths: Paths; channelSlug: string; videoId: string; settings: SiteSettings;
-}): Promise<VideoOperationPanel[]>
-```
-
-Calls `inspectVideoOperations`, `.filter(shownOnVideoPage)`, `orderForVideoPage`, and per view
-loads the body by `settingsBlock`: `"digest"` → `loadDigest` + `loadDigestOverrides` (one
-`Promise.all`, as `page.tsx:159-163` today), narrows `view.target as { target:
-DigestFreshnessTarget; sections: DigestSectionKind[] }`, builds `DigestBodyData` with
-`sections: digestSectionStates(record, sections, target)`, `digest: effectiveDigest(record,
-overrides)`, `hasMachineDigest: record !== null`, `hasOverrides`, `note`, `remoteEnabled:
-settings.digest.remoteEnabled`; `"diarization"` → `loadDiarization`, projected;
-`"attribution"` → `loadAttribution` **once, memoized across the two attribution views**;
-`undefined` → `{ block: undefined }`. Strips `target` before returning.
-
-**`page.tsx`:** delete the imports of `loadDigest`, `loadDigestOverrides`, `effectiveDigest`,
-`isSectionFresh`, `resolveDigestTarget`, `DigestPanel`/`DigestPanelData`/`DigestSectionState`
-(`:30-45`); delete `:155-184`; add
-`const panels = await loadVideoOperationPanels({ paths: getPaths(), channelSlug: slug, videoId: id, settings: getSettings() })`
-(keep the `getSettings` import); `:275` becomes
-`{panels.map((p) => <OperationPanel key={p.view.id} slug={slug} videoId={id} view={p.view} body={p.body} />)}`.
-`loadVideoDir`, `loadMeta`, the VTT provenance loop, coverage, `RunningJobsList`, `VideoPanel`
-and its `umtoolUrl` prop (`:254-273`) are untouched. Comment above the map: the external
-operations' per-video surface is the stage cards inside `VideoPanel`; these panels are the
-registry's.
-
-**Aria-label table (old → new; which spec pins it):**
-
-| old (`DigestPanel.tsx`) | new | pinned by |
-|---|---|---|
-| `section[aria-label="digest panel"]` (`:77`) | `"${id} panel"` → `digest panel` | none (kept) |
-| `h2` "AI digest" (`:81`) | `view.label` → **"Digest"** | none (grep: "AI digest" only in `sections.tsx:154` prose) |
-| `"digest freshness"` (`:83`) | `"${id} freshness"` → `digest freshness` | `digest.spec.ts:580,585,620,628` |
-| `"digest shared from"` (`:173`) | unchanged | none |
-| `"digest empty"` (`:105`) | unchanged | `digest.spec.ts:579` |
-| `"digest warnings"` / `"digest warnings empty"` (`:215,202`) | unchanged | `:602,605` |
-| `"digest provenance"` / `"digest section ${kind}"` (`:256,260`) | unchanged | `:592,629` |
-| `"digest chapters"` / `"digest chapters empty"` (`:343,335`) | unchanged | `:588,671` |
-| `"digest tags"` (`:367`) | unchanged | none |
-| "Correct this digest" / `"digest override note"` / "Save corrections" / `role="status"` "Saved." | unchanged | `:648-654` |
-| "Regenerate digest" / `"lane for Regenerate digest"` (`:130-139`) | unchanged | none |
-| — | `diarization panel`, `diarization freshness`, `diarization empty`, `diarization provenance`, `diarization summary`, `diarization off` | new e2e (commit 4) |
-| — | `attribution-diarized panel` / `attribution-text panel`, `… freshness`, `attribution empty`, `attribution provenance`, `attribution speakers`, `attribution speaker ${index}`, `attribution summary` | new e2e (commit 4) |
-| — | `"${id} outputs"` (no-block arm) | unit-tested shape only |
-
-`getByLabel("digest freshness")` is substring-matched; no new label contains that string, and
-`digest empty` / `digest warnings` retain their `exact` guards.
-
----
-
-## Commit 4 — `video page: a speaker operation runs for one video`
-
-**New `editor/app/channels/[slug]/videos/[id]/operationActions.ts`** (`"use server"`):
-
-```ts
-// Run ONE registry operation over ONE video, from its panel. The speaker lane only:
-// digest keeps digestBucketAction (its own lane, its own guards).
-export async function runOperationForVideoAction(
- slug: string, videoId: string, operationId: string,
-): Promise<StreamActionResult>
-```
-
-Body: `const lane = backfillLaneOperations(getSettings())` (`operations.ts:1554`); if no entry
-has `id === operationId` → `{ ok: false, error: \`${operationLabel(operationId)} is not switched on, so there is nothing to run — enable it on its Operations page.\` }`
-(a disabled operation's panel does not draw the button; this is the belt); else
-`runBackfillChannelJob({ paths: getPaths(), channelSlug: slug, kindIds: [operationId], ids: [videoId], onDone: () => { revalidatePath(\`/channels/${slug}/videos/${videoId}\`); revalidatePath(\`/channels/${slug}\`); } })`.
-No `queueKey` (the lane's own key, `operationJobs.ts:83`); no `background` (a hand-clicked run
-goes in front of the sweep's — `backfillActions.ts:18`).
-
-**`SpeakerBodies.tsx`:** both bodies render, when `view.enabled`, after the record:
-
-```tsx
-<div className="flex flex-col gap-2 border-t border-border pt-3">
- <StreamActionLog
- trigger={() => runOperationForVideoAction(slug, videoId, view.id)}
- cancelAction={cancelJobAction} // jobs/actions, as DigestPanel.tsx:33
- buttonLabel={`Run ${view.label}`} // "Run Speaker diarization", "Run Speaker names (from the audio)", "Run Speaker names (from the transcript)"
- runningLabel="Running…"
- label={`Run ${view.label}`} // → aria-label "Run <label> output"
- />
- <p className="text-xs text-muted-foreground">Runs this one video on the speaker lane, behind nothing — the channel's Speakers stage runs the whole channel.</p>
-</div>
-```
-
-**e2e — `editor/e2e/attribution.spec.ts`, two tests after `:291`, reusing `seedChannel`,
-`attributionSettings`, `dataRel`, `readAttribution`, `pathExists`, `SLOW`, `CHANNEL`,
-`DIARIZED`, `TEXTONLY`:**
-
-1. `"the video page draws one panel per operation, with the registry's own state"`:
- `await seedChannel(); await writeSettings(attributionSettings());`
- `goto(/channels/${CHANNEL}/videos/${DIARIZED})`:
- `getByLabel("diarization panel")` visible (shown because `diarization.json` exists while
- capture is off) and `getByLabel("diarization off")` visible;
- `getByLabel("diarization provenance")` contains `fake-diarize`;
- `getByLabel("diarization summary")` contains `2 speakers` (check `diarizationRecord()`);
- `getByLabel("attribution-diarized freshness")` has text `not generated`;
- `getByLabel("attribution-text freshness")` has text `not generated`;
- `getByLabel("attribution empty")` count `2` (both attribution panels, one shared file);
- `getByLabel("digest freshness")` has text `not generated` (`writeDigestVideo` writes a
- fresh `cues.json`, so digest is `missing`, not `deferred`);
- `getByRole("heading", { name: "Speaker names (from the audio)" })` visible.
- Then `goto(…/${TEXTONLY})`: `getByLabel("diarization panel")` count `0` (off, no sidecar);
- `getByLabel("attribution-diarized freshness")` has text `waiting on Speaker diarization`.
-2. `"Run from the video page runs that video and no other"` (`test.setTimeout(SLOW)`):
- `seedChannel(); writeSettings(attributionSettings());` `goto(…/${TEXTONLY})`;
- `getByRole("button", { name: "Run Speaker names (from the transcript)", exact: true }).click()`;
- `expect(getByLabel("Run Speaker names (from the transcript) output")).toContainText("1 done", { timeout: 90_000 })`
- (the summary line `operationJobs.ts:120-121`);
- `readAttribution(TEXTONLY).provenance.method === "text-only"`;
- `pathExists(dataRel(DIARIZED, "attribution.json")) === false` — DIARIZED is reachable for
- this operation too, so only the `ids` scope kept it untouched;
- `expect(getByLabel("attribution-text freshness")).toHaveText("current")` (after
- `router.refresh()`).
-
-**`editor/e2e/video-page.spec.ts`, one assertion appended to the first test (`:11-27`):**
-`await expect(page.getByLabel("digest freshness")).toContainText("held — waiting on a normalized transcript")` —
-the fixture has no `cues.json`; this is the first place the digest's deferred reason is visible
-per video.
-
----
-
-## Commit 5 — `plans: slice 6 shipped, and the docs say so`
-
-- `editor/CHANGELOG.md` `[Unreleased]` first bullet, house voice (the slice 7 bullet at `:4` is
- the model): the video page shows one panel per operation — Digest as before, and now
- Speaker diarization and both Speaker names operations, each with what produced its record,
- the same state word the channel's counts use (*current*, *stale*, *partly stale*, *not
- generated*, *held — …*, *waiting on …*), and a **Run** button that runs that one video on
- the speaker lane; a record whose feature is switched off is still shown, marked *switched
- off*; the digest panel's heading is **Digest** rather than *AI digest* and nothing else about
- it moved; a replayed per-video run stays per-video; **nothing on disk changes**.
-- `plans/editor-operations-ia.md:151-156` → SHIPPED with hashes; new "## Slice 6, as shipped"
- between the Slice 4 (`:324`) and Slice 7 (`:379`) sections, recording: `hasDigest` was the
- channel count's, not the page's; `hasAttribution` was dead and `hasDiarization` is a cleanup
- guard and stays; the page re-derived digest `state()` and `digestSectionStates` is now the
- one fold; the external operations' surface is the stage cards; `ids` on the channel job; the
- "switched off" case; the vision test now holds for the video page (the no-block arm).
-- `plans/STATE.md`: "Last updated" prepend; "Recommended next" (`:184`) adds a DONE line.
-- `plans/FACTS.md`: `## Verified 2026-08-28 — editor IA slice 6 seams` (this census + "As
- shipped"), after the slice 7 section; the stale `:2316` line about `DigestPanel.tsx:144`
- ("metered — disabled in Settings", already fixed by slice 3) corrected.
-- Memory: `ia-slice-6-shipped.md` + a `MEMORY.md` line; amend `ia-slice-7-shipped`'s "next
- candidates".
-
----
-
-## Verification
-
-1. After each of commits 1–4: tsc in `common editor export homepage umtool mcp`;
- `pnpm -C common test` (867 + `videoOperations` tests; re-measure first); editor units
- (90 + `operationState` tests).
-2. Grep gates after commit 3, over `common/ editor/` excluding `node_modules`/`.next`:
- - `hasDigest\b` → only `common/components/digestCache.ts` and `PlayerProvider.tsx` (a
- different function: the published manifest check) and the private `hasDigestWithItems`
- in `channels.ts`; **0** in `digest-server.ts`.
- - `hasAttribution` → **0** in code (plans/ prose is commit 5's).
- - `hasDiarization` → unchanged set (`diarization-server.ts`, `cleanAudioFromTranscribed.ts`,
- `diarizeOne.ts`, `diarization.test.ts`, comments, and the `VideoFiles` field sites).
- - `isSectionFresh|resolveDigestTarget|effectiveDigest` in `videos/[id]/page.tsx` → **0**.
- - `DigestPanel\b|DigestPanelData` → **0** anywhere.
- - `from "yt-dlp-transcript-common/lib/operations"` in any `"use client"` file under
- `videos/[id]/components` → every hit is `import type`.
- - `listChannelStatsFromDisk|buildBackfillSweepPlan|buildDigestSweepPlan` under `editor/app`
- → 0 (run the guard: `pnpm -C common exec tsx --test controller/noCorpusWalkInRenderPaths.test.ts`).
- - `"AI digest"` → only `sections.tsx:154`.
-3. e2e once after commit 5, detached (`cd editor && setsid nohup sh -c 'pnpm e2e -- <specs>;
- echo exit=$?' > $CLAUDE_JOB_DIR/tmp/e2e.log 2>&1 < /dev/null & disown`):
- `digest.spec.ts video-page.spec.ts attribution.spec.ts diarization.spec.ts backfill.spec.ts
- do-not-clean.spec.ts truncated-check.spec.ts incomplete-transcript.spec.ts
- transcript-source.spec.ts whisper-video.spec.ts saved-videos.spec.ts cleanup-holds.spec.ts
- reconcile.spec.ts undownloaded.spec.ts reconstruct-download-url.spec.ts
- download-format-guard.spec.ts media-file-abort.spec.ts auto-report-refresh.spec.ts
- jobs-active-order.spec.ts perf-budget.spec.ts`. Port fallback `PORT=3111 EXPORT_PORT=3110
- OLLAMA_STUB_PORT=11535`; never kill anything.
-4. **No editor boot against `transcripts/`, nothing written under it.**
-5. Manual (optional, `PORT=3021 pnpm dev:test`): a `writeDigestVideo`-shaped video shows four
- panels in the order Digest, Speaker diarization, Speaker names (from the audio), Speaker
- names (from the transcript); the umtool link (with `UMTOOL_URL` set) is above them inside
- `VideoPanel`; the two-pane `/channels/<slug>/videos?video=` shows no panels.
-
-## Out of scope
-
-- The two-pane `/channels/[slug]/videos?video=` route stays `VideoPanel`-only
- (`videos/page.tsx:202-224`).
-- The external operations' cards in `VideoPanel.tsx`; any `Operation` type change; the channel
- counts' semantics (`hasDigestWithItems` is a move, not a rewrite); slices 5/8/9.
-- `hasDiarization` (live guard). `readVideoDigestAction` (`digestActions.ts:149`) has zero
- callers — note it in FACTS, do not delete it here.
-- `runOperationChannelJob` gaining `ids`; a per-video digest Run via the backfill job (digest
- keeps `digestBucketAction`); a per-video Run for a disabled operation.
-- Restyling `StreamActionLog`; any change to `writeDigestVideo` or the ollama stub.
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`): write the plan to
-`plans/editor-ia-slice-6.md`, commit it alone, then spawn one `general-purpose` agent,
-`model: "opus"`, with: the plan path, the fish-shell caveats (`git commit -F <file under
-$CLAUDE_JOB_DIR/tmp>`; quote `[slug]`/`[id]` paths and globs; POSIX loops only inside
-`sh -c`), never boot against `transcripts/`, e2e detached, tmp under `$CLAUDE_JOB_DIR/tmp`,
-the two trailer lines, and the report contract (shas + one line each; exact gate outputs;
-e2e per spec with retries; every divergence and why; anything undone). Fable reviews on
-return (`git log --oneline ce2ebd9..`; `videoOperations.ts` + test, `digest.ts`'s
-`digestSectionStates` and the `operations.ts:1176` hunk, `channels.ts`, `operationJobs.ts`,
-`backfillBatch.ts:869-`, `jobReplayRegistry.ts`, `OperationPanel.tsx`, `DigestBody.tsx`
-diff-against-rename, `SpeakerBodies.tsx`, `operationState.ts` + test,
-`videoOperationPanels.ts`, `page.tsx`, `operationActions.ts`, the new specs; re-runs grep
-gates + `pnpm -C common test` + editor units, not e2e), sends fixes via SendMessage, and
-reports.
diff --git a/plans/editor-ia-slice-7.md b/plans/editor-ia-slice-7.md
@@ -1,377 +0,0 @@
-# Editor IA slice 7 — one pause
-
-## Context
-
-**Verified read-only against `494cbee` (clean) on 2026-08-28.** Slice 7 is the IA doc's bullet
-(`plans/editor-operations-ia.md:157-161`): `Pause{Downloads,Transcriptions,Backfill}Button` →
-one button, "the six actions" → one pair, the polarity normalization in `laneState.ts` goes,
-**keep the aria labels**. Its reconciliation (`:87-91`) fixes the definition: *"pause operation
-X" = "pause the root of the tree that dispatches X"*, one action mapping onto the **four legacy
-fields**, **no new settings block** — unified-ops step 6 (slice 9) migrates storage later.
-A pause is a hold, never a stop (`unified-operations-model.md:137`): every gate returns
-`limit() === 0` and `runPool` idle-waits.
-
-**Decided (operator, 2026-08-28):** (a) the button and the action are keyed **by lane** — the
-gate is per lane, three speaker operations share one, and "a per-operation page is not a
-per-operation switch" (`STATE.md:401`); `pauseLaneFor(operationId)` is how an operation page
-finds its lane. (b) The single definition reaches the **dispatch holds too**, not just the
-readers. (c) The runner pages get a pause beside Start/Drain/Stop.
-
-**What the census found (corrects the IA bullet in four places):**
-
-1. **Four gates, three polarities, eight actions in two files.** `transcriptionsPaused`
- (`settings.ts:152`; plus the LIVE `WorkerPool.pauseAll/resumeAll/isPaused`,
- `workerPool.ts:283-316`, re-applied at boot by `editor/instrumentation.ts:56-73`),
- `downloadsPaused` (`:157`), `digest.digestsPaused` (`:474`), `backfill.enabled`
- (`:289-292`, **inverted**, shared by diarization / attribution-text / attribution-diarized,
- and deliberately also written by the `LaneSettingsForm` checkbox,
- `operations/settingsActions.ts:214` — keep that; "two places to set it, and they cannot
- drift", `jobs/actions.ts:331-342`). Actions: `jobs/actions.ts:150-178` (downloads),
- `:180-215` (digests), `:329-379` (backfill); `workers/actions.ts:9-23,60-83`
- (`pauseAllWorkersAction`/`resumeAllWorkersAction`: pool + best-effort persist).
-2. **Three UI copies, one dead.** `PauseTranscriptionsButton.tsx` (2 sites:
- `jobs/active/page.tsx:37`, `workers/components/WorkersView.tsx:125-129`);
- `PauseDownloadsButton.tsx` (**zero** importers); four inline `LaneControl` descriptors in
- `LaneDeck.tsx` (`:126-148,216-238,283-309,437-459`, rendered by `LaneCard` through
- `LaneActionButton`, the shared primitive); and `SweepLane.tsx:187-211` on ui `Button` with a
- *composed* aria-label (`"Pause Digest"`, `"Pause Speakers"`) and the **opposite emphasis**
- (warning tint when NOT held; `LaneActionButton`'s `active` variant is warning-filled when
- held — "a held lane is visible from across the room"). `CommandPalette.tsx:110-131` calls
- the workers pair.
-3. **The inversion lives in three readers, and the widget ships it raw.** `LaneDeck.tsx:471`
- (`gateHeld: !laneEnabled`), `operations/lanes.ts:334-336`, `jobs/active/buildActiveJobs.ts:337`;
- `api/widget/sync/route.ts:72,96,289,296` sends `digest.paused` and `backfill.enabled`.
- Readers of those two wire fields: `LaneDeck.tsx:255,403,471,551` only — no spec, no unit
- test, nothing in `MonitorWidget`/`WidgetControls` (precedent for a wire rename: slice 4's
- `noDigest → digestReachable`).
-4. **Every existing label survives one canonical table.** Playwright's `getByRole(…, {name})`
- is case-insensitive substring unless `exact`, and **no pause/resume lookup uses `exact`**
- (grep verified). So `auto-queue.spec.ts:1186`'s `"Pause Digest"` (scoped to
- `section[data-lane="digest"]`) matches the canonical `"pause digests"`, and
- `backfill.spec.ts:809,820` / `widget.spec.ts:803,810` `"pause backfill"` are kept
- byte-identical. `"Pause Speakers"`, `"Pause Derived"`, `"Resume Digest"`, `"Hold the lane"`
- are asserted nowhere.
-5. **Transcription's `held` is the live pool on every UI surface, never the flag.**
- `isGateHeld(settings, "transcription")` answers "will the pool be paused after a restart",
- not "is it paused now"; the e2e harness rewrites `test-settings.json` wholesale between
- tests while the pool keeps its `pausedSnapshot`. Surfaces (all live, unchanged):
- `LaneDeck.tsx:67`, `WorkersView.tsx:119`, `jobs/active/page.tsx:19`, `MonitorWidget.tsx:229`,
- `buildQueueView.ts:243`, `/api/pulse`, `/api/worker/health`. The flag is read in exactly
- two places after this slice: the boot hook and the action's no-op check.
-6. **The runner pages have no pause at all** (`RunnerOperationView`/`LaneHeader.tsx:51-84`:
- Start/Drain/Stop only; `AutoQueueKindStatus` `status.ts:33-53` carries no held field;
- `railStates.ts:36` hard-codes `gateHeld: false` so the rail can never show a runner
- holding). Worse, `/operations/transcription` says **"no enabled worker to run it"** while
- paused, because `pauseAll` disables every worker and `autoRunner.ts:598` reports
- `no-workers`.
-
-**Hazards carried through every commit:** the runner section's contract
-(`RunnerOperationView.tsx:21-35`) forbids nested `<section>` and reserves `role="status"` —
-`LaneActionButton` is a plain `<button>` plus a `role="alert"` span only on error, fine.
-`laneGuards.test.ts:22` casts a `{digest}`-only object to settings, so `isGateHeld` must
-switch on lane and touch only that lane's field. `pauseControl.tsx` is a client module: import
-`PauseLane` as a **type** only (a value import drags `operations.ts`/`settings.ts` and `fs`
-into the client graph). Resume must always be reachable: `disabled` applies to the pause side
-only (`PauseTranscriptionsButton.tsx:44-47` — and `SweepLane.tsx:191` gets this wrong today).
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/editor-ia-slice-7.md`; commit alone: `plans: slice 7 planned`.
-
-## Order: five commits after the plan
-
-1. **`common: a pause gate has one definition`** — `pauseGates.ts` + test; the three dispatch
- holds and the boot hook read it.
-2. **`editor: one action pair holds every lane, and the wire says held`** — the pair in
- `operations/actions.ts`; eight actions deleted; payload builders and the widget payload
- read `isGateHeld`; `LaneDeck`'s inversion goes.
-3. **`lanes: one pause control, drawn wherever a lane is`** — `pauseControl.tsx`
- (`pauseLaneControl` + `PauseLaneButton`); LaneDeck, SweepLane, Workers, Active Jobs,
- CommandPalette on it; two button files deleted; new e2e.
-4. **`operations: a runner page has its pause beside Start, Drain and Stop`** — `held` on
- the runner status, the button in `LaneHeader`, the rail shows a runner holding, the
- `workers-paused` idle reason.
-5. **`plans: slice 7 shipped, and the docs say so`** — CHANGELOG, IA doc, unified-ops doc,
- STATE, FACTS, memory.
-
-Gates after each of 1–4: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export homepage
-umtool mcp`; `pnpm -C common test` (861 → 861 + the new file's tests); `pnpm -C editor exec tsx
---test "app/**/*.test.ts"` (90). e2e once after commit 5, detached (memory `e2e-run-detached`).
-
----
-
-## Commit 1 — `common: a pause gate has one definition`
-
-**New `common/lib/pauseGates.ts`:**
-
-```ts
-export type PauseLane = "transcription" | "download" | "digest" | "backfill";
-// The union of the two id spaces that already exist: AutoQueueKind (the runners) and the
-// editor's SweepLaneId (the sweeps). Asserted here for the first; lanes.ts asserts the second.
-type _RunnerLanesArePauseLanes = AutoQueueKind extends PauseLane ? true : never; // import type from ../jobs/autoQueueState
-
-// Which lane's gate holds this operation. `runner` FIRST: transcode shares
-// TRANSCRIPTION_QUEUE and has no runner, and a queue-key map alone would hand it a
-// transcription pause. Then BACKFILL_QUEUE → backfill; the two digest queues → digest; else null.
-// Walks operationCatalog() (all seven ids), not OPERATION_BY_ID (the four registry entries).
-export function pauseLaneFor(operationId: string): PauseLane | null;
-
-// THE ONLY PLACE POLARITY IS KNOWN. backfill's field is `enabled`, so held = !enabled.
-// Touches only the named lane's field (laneGuards.test.ts casts a {digest}-only settings).
-export function isGateHeld(settings: SiteSettings, lane: PauseLane): boolean;
-
-// The only writer AMONG THE PAUSE CONTROLS (the LaneSettingsForm checkbox writes
-// backfill.enabled too, on purpose). Pure: returns a new settings object, no I/O.
-// Spreads ...settings.backfill / ...settings.digest so sweepEnabled etc. are untouched.
-export function withGateHeld(settings: SiteSettings, lane: PauseLane, held: boolean): SiteSettings;
-```
-
-Header comment states the transcription asymmetry (finding 5): the flag is what the boot
-hook re-applies; "is it paused now" is the pool, and no UI may read the flag for it.
-
-**`common/lib/pauseGates.test.ts`** (node:test, shape of `laneGuards.test.ts:1-12`): round
-trip `withGateHeld`→`isGateHeld` for all four lanes; backfill polarity pinned
-(`enabled: false` ⇒ held); `pauseLaneFor` over all seven catalog ids, **`transcode → null`**;
-`withGateHeld(…, "backfill", true)` leaves `sweepEnabled`, `sweepKinds`, `sweepChannels`,
-`allowRedownload` untouched; `isGateHeld({digest} as …, "digest")` works on a partial object.
-
-**The dispatch holds read it** (each a one-liner; behaviour identical):
-`common/controller/autoRunner.ts:640` (`settings.downloadsPaused` →
-`isGateHeld(settings, "download")`), `common/controller/backfillBatch.ts:734-736`
-(`!live.enabled` → `isGateHeld(liveSettings, "backfill")`),
-`common/controller/laneGuards.ts:129` (`digest.digestsPaused` → `isGateHeld(settings, "digest")`).
-`laneGuards.test.ts:25` still passes (the hold beats every other reason).
-
----
-
-## Commit 2 — `editor: one action pair holds every lane, and the wire says held`
-
-**`editor/app/operations/actions.ts`** (already `"use server"`, beside `snoozeAutoQueueAction`):
-
-```ts
-async function setLaneHeld(lane: PauseLane, held: boolean): Promise<{ ok: boolean; error?: string }>
-// transcription: the LIVE hold first — getWorkerPool().pauseAll() / resumeAll() — then persist.
-// all lanes: const cur = getSettings(); const next = withGateHeld(cur, lane, held);
-// if (isGateHeld(cur, lane) !== held) await writeSettings(next) — inside try; a failed
-// write returns {ok:false, error} (for transcription AFTER the pool flipped: the button shows
-// the error inline and the label follows the pool — say so in a comment; today
-// persistTranscriptionsPaused swallowed it).
-// revalidatePath("/jobs"); revalidatePath("/workers"); revalidatePath("/operations/[id]", "page").
-// NOT "/": carry workers/actions.ts:60-66's note — "/" reads its pauses from polls
-// (DashboardCockpit.tsx:74-75) and revalidating it wipes the client router cache app-wide.
-export async function pauseLaneAction(lane: PauseLane)
-export async function resumeLaneAction(lane: PauseLane)
-```
-
-**Delete** `jobs/actions.ts:150-215, 329-379` (the three pairs and their `set*` helpers and
-result types; drop the now-unused `writeSettings` import, keep `getSettings` for `:278`);
-`workers/actions.ts:9-23, 60-83` (`persistTranscriptionsPaused` and the workers pair; drop the
-settings import). `common/lib/settings.ts:151` comment "See pauseAllWorkersAction" →
-"See pauseLaneAction".
-
-**Readers lose the inversion:** `operations/lanes.ts:308,336` → `isGateHeld(settings, "digest"
-| "backfill")` (delete the INVERTED comment); `jobs/active/buildActiveJobs.ts:322,337` same;
-`workers/buildWorkers.ts:53` → `isGateHeld(settings, "download")` (the field name
-`downloadsPaused` on the workers payload stays — `dashboard.spec.ts:87` documents that the
-workers poll re-reads it; not a polarity problem); `channels/[slug]/pipelineActions.ts:108`
-and `channels/groupActions.ts:116` → `isGateHeld(…, "download")` (messages unchanged —
-`dashboard.spec.ts:105` pins "Downloads are paused"); `editor/instrumentation.ts:65` →
-`isGateHeld(getSettings(), "transcription")`.
-
-**Widget sync payload** `api/widget/sync/route.ts`: `digest.paused` → `digest.held` (`:72,289`),
-`backfill.enabled` → `backfill.held` (`:96,296`), both via `isGateHeld`; type comments say
-"held — computed by isGateHeld; nothing downstream inverts anything". `LaneDeck.tsx:255,403`
-read `.held`; `:471` becomes `gateHeld: backfillHeld`; `:551` `backfillSweeping && backfillHeld`;
-the `:35-39` comment and `laneState.ts:16-19` rewritten: "every lane's gate reaches the wire
-as `held`, computed once by `isGateHeld`; no reader inverts". A stale pinned widget tab reads
-`undefined ?? false` until reload — harmless; CHANGELOG says so.
-
-**Callers of the deleted actions, rewired in this commit so it is green** (labels untouched
-here): `LaneDeck.tsx:12-22` imports and `:134,145,224,235,294,305,446,457` →
-`pauseLaneAction("…")`/`resumeLaneAction("…")`; `SweepLane.tsx:12-21,193-202` →
-`lane.gateHeld ? resumeLaneAction(lane.id) : pauseLaneAction(lane.id)`;
-`CommandPalette.tsx:114-131` → `pauseLaneAction("transcription")` /
-`resumeLaneAction("transcription")` (entry labels, icons, toasts unchanged);
-`PauseTranscriptionsButton.tsx:4-7,34,48` → the pair. **`git rm` `PauseDownloadsButton.tsx`**
-(zero importers; `:56` was its only reference). `operations/lanes.ts` gains
-`type _SweepLanesArePauseLanes = SweepLaneId extends PauseLane ? true : never`.
-
----
-
-## Commit 3 — `lanes: one pause control, drawn wherever a lane is`
-
-**New `editor/app/components/lanes/pauseControl.tsx`** (`"use client"`; `import type
-{ PauseLane }`):
-
-```ts
-export function pauseLaneControl({ lane, held, onChange, disabled }: {
- lane: PauseLane; held: boolean; onChange?: () => void | Promise<void>; disabled?: boolean;
-}): LaneControl
-export function PauseLaneButton(props: Parameters<typeof pauseLaneControl>[0] & { dense?: boolean })
- // = <LaneActionButton {...pauseLaneControl(props)} dense={dense} /> (LaneCard supplies
- // dense itself from useSectionFrame; the standalone button takes it as a prop)
-```
-
-The table — **byte-identical to LaneDeck today**, which is the aria contract:
-
-| lane | held | label | ariaLabel | title from |
-|---|---|---|---|---|
-| transcription | no | Pause Transcriptions | Pause Transcriptions | `LaneDeck.tsx:143` |
-| transcription | yes | Resume Transcriptions | Resume Transcriptions | — |
-| download | no | Pause Downloads | Pause Downloads | `:233` |
-| download | yes | Resume Downloads | Resume Downloads | — |
-| digest | no | Hold the lane | pause digests | `:303` |
-| digest | yes | Resume the lane | resume digests | `:292` |
-| backfill | no | Hold the lane | pause backfill | `:444` |
-| backfill | yes | Resume the lane | resume backfill | `:455` |
-
-glyph `❙❙` / `▶`; `variant: held ? "active" : "idle"`; `key: \`${lane}-gate\``;
-`action: () => held ? resumeLaneAction(lane) : pauseLaneAction(lane)`;
-**`disabled: held ? undefined : disabled`** — a Resume is always reachable (a paused pool with
-zero workers must be releasable; this also fixes `SweepLane.tsx:191`, which disables both
-sides on `!lane.available`). Header comment: the runner lanes say *Pause*, the sweep lanes say
-*Hold*, on purpose — CHANGELOG `:34`: the feed **sweeps**, the gate **holds**; the aria-labels
-are the contract `backfill.spec`, `widget.spec`, `dashboard.spec`, `auto-queue.spec`,
-`workers.spec`, `parakeet-partial.spec` select by, and Playwright's name match is
-case-insensitive substring, which is why `"Pause Digest"` finds `"pause digests"`.
-
-**Sites:**
-- `LaneDeck.tsx:126-148,216-238,283-309,437-459` → `pauseLaneControl({ lane, held, onChange })`
- with `onChange: onWorkersChange` for transcription/download (their `held` comes from the
- WORKERS payload: `workers.paused` live pool, `workers.downloadsPaused`) and `onSynced` for
- digest/backfill (`sync.digest.held`, `sync.backfill.held`). The card rules stay in LaneDeck:
- digest gate only when `sweeping || held` (`:283`), backfill controls only when `anyKind`
- (`:412`).
-- `WorkersView.tsx:14,125-129` → `<PauseLaneButton lane="transcription" held={paused}
- disabled={workers.length === 0} onChange={refetch} />`; `jobs/active/page.tsx:8,37` →
- `<PauseLaneButton lane="transcription" held={paused} />` (no `onChange` ⇒ `router.refresh()`,
- page is `force-dynamic`). **`git rm` `PauseTranscriptionsButton.tsx`.**
-- `SweepLane.tsx:184-211` → `<PauseLaneButton lane={lane.id} held={lane.gateHeld}
- disabled={!lane.available} onChange={onRefresh} />`, rendered unconditionally as today
- (`auto-queue.spec.ts:1186` expects it with no sweep armed). Its aria-label becomes the
- canonical one and it adopts the dashboard's emphasis (held = warning-filled). Two things
- change and the comment says so: the pause no longer shares `working` with the sweep button
- (each has its own pending state; a sweep start no longer disables the pause mid-flight), and
- `LaneActionButton`'s `px-3 py-1.5 text-sm` sits beside ui `Button size="sm"` — accept; do
- **not** restyle `LaneActionButton` (it is on the dashboard and the widget). Delete the
- `:184-186` "normalised in lanes.ts" comment.
-- `CommandPalette` already on the pair from commit 2.
-
-**e2e — new test in `backfill.spec.ts` after `:824`**, "an operation page holds the same lane
-the dashboard does": `resetData("one-transcribe-channel-with-audio")`,
-`writeSettings(backfillSettings())`, `goto("/operations/diarization")`,
-`page.locator('section[data-lane="backfill"]').getByRole("button", { name: "pause backfill" })`,
-`toBeEnabled({ timeout: 30_000 })` (the hydration wait — `awaitHydration` is local to
-`auto-queue.spec.ts`), click, `expect.poll(laneEnabled).toBe(false)`, `sweepFlag()` still
-false, then `goto("/")`, `"resume backfill"` enabled, click, `laneEnabled` true. Helpers
-already in the file: `backfillSettings()` `:60`, `sweepFlag()` `:123`, `SLOW` `:130`.
-
----
-
-## Commit 4 — `operations: a runner page has its pause beside Start, Drain and Stop`
-
-- `operations/status.ts:33` `AutoQueueKindStatus` gains `held: boolean`; filled in `buildKind`
- (`:80-92`): transcription from `getWorkerPool().isPaused()` (live — finding 5), download
- from `isGateHeld(settings, "download")`. Comment: why the two differ.
-- `LaneHeader.tsx:18-30` gains `onChange`; renders `<PauseLaneButton lane={status.kind}
- held={status.held} onChange={onChange} />` after Stop (`:83`, inside the existing
- `span.ml-auto`). `RunnerOperationView.tsx:85-91` passes `onChange={onRefresh}`. Contract
- check: a plain `<button>`; `role="alert"` only on error; no `<section>`, no `role="status"`.
-- `railStates.ts:36` `gateHeld: false` → `gateHeld: status.held` — the operations rail can
- show a runner lane *Holding* for the first time (note at `:50-53` already handles it).
-- **The honest idle reason** (H4): `common/controller/autoRunner.ts:598` reports `no-workers`
- while the pool is paused (pauseAll disables every worker), so the transcription page says
- "no enabled worker to run it" next to a *Resume Transcriptions* button. Add
- `"workers-paused"` to the idle-reason union (`:123-124`), check `getWorkerPool().isPaused()`
- before the no-workers branch, map it in `dispatch.ts:108` ("transcriptions are paused") and
- `buildActiveJobs.ts:399` ("transcriptions paused globally"), mirroring `downloads-paused`.
-- e2e: in `auto-queue.spec.ts` after `:1174` (the `/operations/download` block of "each
- operation page carries its own lane"): `const download = page.locator('section[data-lane="download"]')`
- (the runner section carries `data-lane={kind}`, `RunnerOperationView.tsx:82`);
- `awaitHydration(download)`; `download.getByRole("button", { name: "Pause Downloads" })`
- visible → click → `expect.poll` on `test-settings.json` `downloadsPaused === true` →
- `"Resume Downloads"` visible → click → false (so the test leaves the fixture as it found
- it — the digest block after it does not care, but the next test's `writeSettings` does the
- real reset). Assert nothing about `role="status"`.
-
----
-
-## Commit 5 — `plans: slice 7 shipped, and the docs say so`
-
-- `editor/CHANGELOG.md` `[Unreleased]` first bullet, house voice (slice 4's bullet is the
- model): one pause control on every surface that draws a lane, and now on the runner pages
- too, beside Start/Drain/Stop; a held runner shows as *Holding* on the operations rail and
- says "transcriptions are paused" rather than "no enabled worker"; *Resume* is always
- clickable, even when the lane has no workers or is switched off; the operation page's
- hold button now emphasises a held lane the way the dashboard does. Every button name is
- unchanged. **Nothing on disk changes** — the same four settings fields, the Speaker-lane
- checkbox and the pause button still write the same one. The monitor widget's own data feed
- renames `digest.paused` / `backfill.enabled` to `held`; a pinned tab shows the lane as not
- held until reloaded.
-- `plans/editor-operations-ia.md:157-161` → SHIPPED with hashes; new "## Slice 7, as shipped"
- after the Slice 4 section, recording: keyed by lane, not operation, and why; four gates /
- three polarities / eight actions (the bullet's "six"); `PauseDownloadsButton` was dead;
- the canonical-label finding (case-insensitive substring); transcription's live/persisted
- asymmetry; the runner pages got their pause; what stayed (the `LaneSettingsForm` checkbox
- as the second writer; the three copies of the lane NOTE strings — slice 8).
-- `plans/unified-operations-model.md:3,124-127` — step 5 **partly**, honestly: one definition
- (`isGateHeld`/`withGateHeld`) and one writer among the controls; still four settings fields,
- not tree state; step 6 migrates storage behind two functions.
-- `plans/STATE.md`: "Last updated" prepend; `:364` (the `pause|resumeBackfillAction` names
- "stay") → gone, aria-labels stayed; "Recommended next" adds a DONE line.
-- `plans/FACTS.md`: `## Verified 2026-08-28 — editor IA slice 7 seams` (census + "As shipped");
- `:2212` mapping row updated.
-- Memory: `ia-slice-7-shipped.md` + `MEMORY.md` line; amend `ia-slice-4-shipped`'s "next
- candidates".
-
----
-
-## Verification
-
-1. After each of commits 1–4: tsc in `common editor export homepage umtool mcp`;
- `pnpm -C common test` (861 + pauseGates tests); editor units (90).
-2. Grep gates after commit 3, over `editor/ common/` excluding `node_modules`/`.next`:
- `pauseAllWorkersAction|resumeAllWorkersAction|pauseDownloadsAction|resumeDownloadsAction|pauseDigestsAction|resumeDigestsAction|pauseBackfillAction|resumeBackfillAction|persistTranscriptionsPaused`
- → 0 in code (plans/ prose is commit 5's); `PauseTranscriptionsButton|PauseDownloadsButton`
- → 0; `!settings.backfill.enabled|!live.enabled|digestsPaused` in `editor/app` → only
- `settingsActions.ts:102` (the preserve-on-save) and `LaneSettingsForm`; `\.digestsPaused|\.downloadsPaused|\.transcriptionsPaused|backfill\.enabled` outside `pauseGates.ts`,
- `settings.ts`, `settingsActions.ts`, `settings/actions.ts` → 0; `INVERTED` → 0.
-3. e2e once after commit 5, detached (`cd editor && setsid nohup sh -c 'pnpm e2e -- <specs>;
- echo exit=$?' > $CLAUDE_JOB_DIR/tmp/e2e.log 2>&1 < /dev/null & disown`):
- `backfill.spec.ts widget.spec.ts dashboard.spec.ts auto-queue.spec.ts
- parakeet-partial.spec.ts workers.spec.ts disk-space.spec.ts operation-settings.spec.ts
- attribution.spec.ts jobs-active-order.spec.ts queues.spec.ts navigation.spec.ts
- perf-budget.spec.ts`. Known flakes (`auto-queue.spec.ts:411`) retried individually and
- reported. Port fallback `PORT=3111 EXPORT_PORT=3110 OLLAMA_STUB_PORT=11535`; never kill
- anything.
-4. **No editor boot against `transcripts/`, nothing written under it.**
-5. Manual (optional, `PORT=3021 pnpm dev:test`): dashboard band — four gates, labels
- unchanged; `/operations/attribution-text` *Hold the lane* → `/operations/diarization` shows
- *Resume the lane* and the rail says Holding; `/operations/transcription` has *Pause
- Transcriptions* beside Stop, pausing turns the idle line to "transcriptions are paused";
- `/workers` with zero workers: Pause disabled, Resume (after pausing) enabled.
-
-## Out of scope
-
-- Unified-ops step 6 (tree state; `sweepEnabled`/`sweepKinds`/`sweepChannels`/`weight`) — slice 9.
-- Snooze (`SnoozeControl`, `snoozeAutoQueueAction`), the disk gate, Start/Drain/Stop, the
- `LaneSettingsForm` checkbox (stays the second writer of `backfill.enabled` on purpose).
-- Folding `buildActiveJobs.ts:346-379`'s copy of `deriveLaneState` precedence and the three
- copies of the lane NOTE strings (`buildActiveJobs.ts:369-378`, `railStates.ts:44-56`,
- `SweepLane.tsx:226-233`) — slice 8.
-- Renaming the workers payload's `paused`/`downloadsPaused`, the `/api/widget/sync` path, or
- any settings key/field `name`. Restyling `LaneActionButton`.
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`): write the plan to
-`plans/editor-ia-slice-7.md`, commit it alone, then spawn one `general-purpose` agent,
-`model: "opus"`, with: the plan path, the fish-shell caveats (`git commit -F <file under
-$CLAUDE_JOB_DIR/tmp>`; quote `[slug]`/`[id]` paths and globs; POSIX loops only inside
-`sh -c`), never boot against `transcripts/`, e2e detached, tmp under `$CLAUDE_JOB_DIR/tmp`,
-the two trailer lines, and the report contract (shas + one line each; exact gate outputs;
-e2e per spec with retries; every divergence and why; anything undone). Fable reviews on
-return (`git log --oneline 494cbee..`; `pauseGates.ts` + test, `operations/actions.ts`,
-`pauseControl.tsx`, `LaneDeck.tsx`, `SweepLane.tsx`, `LaneHeader.tsx`, `status.ts`,
-`widget/sync/route.ts`, the new specs; re-runs grep gates + `pnpm -C common test` + editor
-units, not e2e), sends fixes via SendMessage, and reports.
diff --git a/plans/editor-ia-slice-8ab.md b/plans/editor-ia-slice-8ab.md
@@ -1,655 +0,0 @@
-# Editor IA slice 8a+8b — sync is an operation; its settings and the workers' live on their pages
-
-## Context
-
-**Verified read-only against `6f6c307` (clean) on 2026-08-29.** This is the Sync and Workers
-thirds of the IA doc's slice 8 (`plans/editor-operations-ia.md:168-171`); the `/jobs` +
-`/jobs/active` + `/jobs/queue` fold is a later plan of its own. The noun-model row for Sync
-(`:57`): an operation, channel-scoped and cadence-triggered; `OperationDescriptor` gains
-`scope` and `trigger`; it gets a board row and `/operations/sync` (today's `/scheduler`) and
-"keeps its own runner"; the keep-latest checks and the saved-video backup on the same
-heartbeat (`editor/app/scheduler/runTick.ts:25-27`) are Storage chores and labelled so. The
-nav end state (`:66-80`) has the Operations group down to one entry.
-
-**Decided (operator, 2026-08-29):** (A) `/scheduler` → `/operations/sync`; `scope`/`trigger`
-on the descriptor; a `sync` catalog entry; the board's SyncRow becomes a rail row; a 307
-redirect; the nav's interim "Schedule" entry goes; the Storage chores are labelled. (B) **The
-whole `syncScheduler` block — headline and advanced fields — is the sync operation's
-settings form on its page** (slice 3's rule), declared as `settingsBlock: "syncScheduler"`,
-with `saveSchedulerSettingsAction` its one writer and `/settings` preserving the block the way
-it preserves `digest`/`diarization`. (C) `WorkersField.tsx` moves to `/workers` with its own
-action writing only `settings.workers`. (D) The lane NOTE strings become one.
-OUT: the `/jobs` fold; any change to tick logic, `SchedulerRun`, `syncSchedulerState` or a
-settings key; `Field.tsx`/`CardField`; moving `editor/app/scheduler/{runTick,heartbeat,status,
-auth,actions,intervalPresets}.ts`.
-
-**What the census found — every place the IA doc's wording cannot be implemented literally,
-and what to do instead:**
-
-1. **"Keeps its own runner" cannot be `runner`.** `OperationDescriptor.runner` is typed
- `AutoQueueKind` (`common/lib/operations.ts:1382`; `autoQueueState.ts` = `"transcription" |
- "download"`), `operations.test.ts:1245-1262` pins it `undefined` for every other id, and
- `operations/[id]/page.tsx:138` feeds it straight into `RunnerOperationView`. The heartbeat
- is not an auto-queue runner. **Instead:** `trigger: "cadence"` is the switch — the page
- builds the scheduler console as a server slot when `op.trigger === "cadence"` (the
- `operationSettings`/`laneSettings`/`channelWork` slot pattern, `page.tsx:152-214`) and
- `OperationDetail` renders it where it would otherwise draw `NoConsoleView`
- (`OperationDetail.tsx:113-115`). `runner` stays `undefined` on sync; the test says why.
-2. **Sync has no band, so "a real rail row" is composed, not folded.** `OperationRail` draws
- one `RailRow` per `OperationBand` (`OperationRail.tsx:74-81`) and a band's populations are
- videos (`band.ts`); the sync row's figures are channels (`syncRow.ts:8-22`).
- `buildOperationBands` (`buildBands.ts:159-193`) must not gain a sync band — "coverage
- unknown" over a hollow outline for a thing with no per-video coverage. **Instead:**
- `OperationRail` takes `sync?: SyncRowView` and renders a `SyncRailRow`
- `<li data-operation="sync">` first in the same `<ul>`, same link/dot/state/figures
- anatomy; the board's `SyncRow` (`OperationsBoard.tsx:55-130`) is deleted. Still SSR, not
- polled (`:65-67` says why; `useOperationsStatus.ts`'s 3 s poll is untouched).
-3. **`group` is required and exhaustive in three places.** `OperationGroup` (`:322`) is
- switched by `groupLabel` (`:339`) and `groupActionLabel` (`:1455`) and keyed by
- `GROUP_STAGES: Record<OperationGroup, readonly StageId[]>`
- (`channels/[slug]/lib/stageStatus.ts:85-90`); `operations.test.ts:1296-1305` requires a
- group. Sync is not `media` (download + transcode's `/channels` column group).
- **Instead:** a fifth group `"sync"` (label "Sync", action label "syncs"), **not** added to
- `OPERATION_GROUP_ORDER` (`:332-337` — the `/channels` column order and the transit line's
- station order; `stageOrder.test.ts` pins the derived list), and `GROUP_STAGES.sync = []`
- with the comment that sync's channel surface is the hand-listed `playlist` bookend
- (`JOB_KIND_TO_STAGE` `sync: "playlist"`, `stageStatus.ts:107`) and `:80-84` says not to
- finish that derivation. `rank()` in `channels/page.tsx:81-85` and
- `videoOperations.ts:122-125` give an unknown group the last rank and never see `sync`.
-4. **"Three copies of the lane NOTE strings" are two copies and a paraphrase.**
- `railStates.ts:48-56` and `buildActiveJobs.ts:368-375` are byte-identical tables (`"no
- operation switched on"`, `"sweep armed, lane paused"`, `"lane paused"`, `"no sweep
- armed"`); `SweepLane.tsx:215-222` is a sentence over the same `deriveLaneState`.
- `buildActiveJobs.ts:356-363` also re-states `deriveLaneState`'s precedence (slice 7's
- out-of-scope note, `editor-ia-slice-7.md:359-361`). **Instead:** one `sweepLaneNote()`
- beside `deriveLaneState` in `laneState.ts`; both tables and the precedence copy deleted;
- the sweep panel keeps its prose and says in a comment it is the long form. No spec pins
- any of the four strings (grep verified).
-5. **"Wherever they show" is smaller than it sounds.** `keptChecksQueued` /
- `savedVideoBackupQueued` (`runTick.ts:37-40`) reach no UI: `SchedulerView.tsx:44-67` reads
- `queued`/`skipped`/`reason`; `SchedulerRun` records neither. They show as (a) the
- `skipped` reasons `kept-check: …` (`runTick.ts:172`) and the pseudo-slug `(saved-video
- backup)` (`:196`), (b) the "Keep-latest check interval" field (moving with the block,
- commit 3), (c) `/saved-videos` "the sync scheduler runs the backup"
- (`SavedVideosControls.tsx:86-87`). Recording chores in `SchedulerRun` is a state-shape
- change and out of scope. **Instead:** label those surfaces, add a "storage chores" clause
- to the Run-now message from the POST body, one paragraph on the console. No tick logic
- changes.
-6. **The catalog is walked by a test that pins its length.** `pauseGates.test.ts:100-101`
- asserts `ids.length === 7` and every id in an expected map; `pauseGates.ts:60` says "all
- seven ids". A `sync` entry needs `sync: null` and `8`.
-7. **A worker tag would grow a `sync` entry.** `settings/page.tsx:82-87` builds `knownTags`
- from `operationCatalog().map(o => o.id)`; a tag names a per-video operation a delegate
- can take a UNIT of (`lanes.ts:264-296`). The builder moves to `/workers` (commit 4) and
- filters on `scope === "video"` — the first consumer that uses `scope` for the reason the
- field exists.
-8. **`editor/app/scheduler/` is the runner, not the page.** The `/actionable` precedent
- deleted only `page.tsx` and left the lib in place. `runTick.ts`, `heartbeat.ts`,
- `status.ts`, `auth.ts`, `actions.ts`, `intervalPresets.ts` are imported by
- `instrumentation.ts`, both API routes (`api/scheduler/{status,tick}/route.ts`),
- `syncRow.ts:2`, `ChannelForm.tsx`, `SettingsForm.tsx:20`. They stay. Only `page.tsx` is
- deleted; the four view components + `cadence.ts` move under
- `operations/components/sync/` by `git mv` (review is diff-against-rename). A route
- directory with no `page.tsx` is not routable; the 307 answers `/scheduler`.
-9. **Two writers of the headline scheduler fields become one.** `SettingsForm.tsx:314-464`
- ("Sync scheduler", 14 fields) and `SchedulerSettingsForm.tsx` (3 of the same names) both
- wrote `syncScheduler` — the `settings/actions.ts:172-226` parse and
- `saveSchedulerSettingsAction` (`scheduler/actions.ts:111-152`, already `intOrKeep` +
- whole-object preserve). Decision (B) makes `saveSchedulerSettingsAction` the only
- writer, exactly the slice-3 shape; `/settings` preserves the block. The keep-latest
- interval is a Storage chore's knob but a field of this block: it moves with it and its
- hint says whose knob it is.
-
-**Hazards carried through every commit:**
-
-- **Client graph.** `common/lib/operations.ts` reaches `node:fs`; every `"use client"` file
- imports from it `as type` only. `SyncRowView` is a type import from `../syncRow` (a server
- module; `OperationsBoard.tsx:5` already does this). The sync row's `label` reaches the
- client as a prop. `WorkersField.tsx:3-4`'s two `import type` lines are load-bearing
- (`workers.ts:15-21 → transcriptionApps.ts:13 → paths.ts → node:fs`) — the tag vocabulary
- is built on the server and passed down, as today.
-- **`"use server"` files export functions only** (`digestActions.ts:37-48`); a `type` export
- is fine (`workers/actions.ts:16` already has one).
-- **The guard** `noCorpusWalkInRenderPaths.test.ts` bans `listChannelStatsFromDisk |
- buildBackfillSweepPlan | buildDigestSweepPlan` textually under `editor/app`. Nothing new
- mentions them. `buildSchedulerStatusPayload` (`scheduler/status.ts`) is `listChannelConfigs`
- + `readSchedulerState` — configs, not a walk — and now runs on every operation page (for
- the rail row) and the board.
-- **`section[data-lane]` count is pinned at 0 on the board** (`auto-queue.spec.ts:1108`).
- The sync row is an `<li>`; the console's `<section>`s carry no `data-lane`.
-- **Playwright name matching is case-insensitive substring unless `exact`.** Use
- `getByRole("heading", { name: "Sync", level: 1 })`. `getByLabel("Default interval unit")`
- does not match "Default full sweep interval unit" (different substring) — verified.
-- **`role="status"` ×3 on `/workers`** (`WorkersView.tsx:132,141` + the config form) and
- **`form[data-settings-block]` count** — every new assertion scopes to
- `form[data-settings-block="workers"]` / `form[data-settings-block="syncScheduler"]`.
- `operation-settings.spec.ts:239-241` pins count **0** on `/operations/transcode` and
- `/download` — unaffected.
-- **`getByLabel("worker 1 name")` vs `aria-label="worker ${w.name}"`** (`WorkersView.tsx`):
- substring, but "worker 1 name" is a substring of no worker-name label. `getByRole
- ("listitem")` in `workers.spec.ts` is unaffected — `WorkerCard` rows are `<div>`s.
-- **`writeSettings` in e2e replaces the file wholesale** (`helpers.ts:66-69`) and
- `getSettings()` re-reads on every call. Both new actions read-then-write like every block
- action (`saveSchedulerSettingsAction` is the model).
-- **`revalidatePath("/operations/sync")`** — the literal, not `"/operations/[id]", "page"`:
- only the sync page changed.
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/editor-ia-slice-8ab.md`; commit alone:
-`plans: slice 8a+8b planned`.
-
-## Order: six commits after the plan
-
-1. **`common: sync is a catalogued operation, with a scope and a trigger`** — `scope`/`trigger`,
- `SYNC_OPERATION`, group `sync`, `ExternalOperation` de-duplicated, `GROUP_STAGES.sync`, tests.
-2. **`operations: sync has a rail row and a page, and /scheduler redirects`** — `SyncRailRow`,
- the cadence console slot, `scheduler/page.tsx` deleted, components moved, nav entry
- deleted, 307, Storage chores labelled, specs repointed.
-3. **`sync: its settings live on its page, and one action writes them`** —
- `settingsBlock: "syncScheduler"`, the full form on `/operations/sync`, the `/settings`
- fieldset and parse deleted, `cadence-ui.spec.ts` repointed + one new test.
-4. **`workers: the worker list is configured where the workers are`** — `WorkersField` moved,
- `WorkersConfigForm` + `saveWorkersAction`, the `/settings` fieldset and parse deleted,
- three specs moved.
-5. **`lanes: one note for why a lane is not working`** — `sweepLaneNote`; two tables and one
- precedence copy deleted; unit test.
-6. **`plans: slice 8a+8b shipped, and the docs say so`** — CHANGELOG, IA doc, STATE, FACTS,
- SCHEDULED_SYNC.md, memory.
-
-Gates after each of 1–5: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export homepage
-umtool mcp`; `pnpm -C common test` (876 at plan time — re-measure before commit 1 — plus the
-new cases); `pnpm -C editor exec tsx --test "app/**/*.test.ts"` (94 + `laneState.test.ts`).
-e2e once after commit 6, detached (memory `e2e-run-detached`).
-
----
-
-## Commit 1 — `common: sync is a catalogued operation, with a scope and a trigger`
-
-**`common/lib/operations.ts`.** Two unions beside `OperationDispatch` (`:243`):
-
-```ts
-// WHAT AN OPERATION ACTS ON, and WHAT MAKES IT RUN. Every media-derived
-// operation is per-video and backlog-driven: it has a state per video, and its
-// work list is whichever videos lack it. Sync is the one exception the IA doc
-// names (plans/editor-operations-ia.md, "Where the noun breaks"): a CHANNEL has
-// a sync state — last synced, next due — and nothing runs it but a cadence. A
-// surface that draws per-video things (a band, a video-page panel, a channel
-// column, a worker tag) filters on `scope`, never on the id.
-export type OperationScope = "video" | "channel";
-export type OperationTrigger = "backlog" | "cadence";
-```
-
-`OperationDescriptor` (`:1369-1387`) gains `scope: OperationScope; trigger: OperationTrigger;`
-(required). The `runner`/`appliesTo` comments move here from `ExternalOperation`
-(`:1300-1317`) and **`ExternalOperation` becomes**
-`Omit<OperationDescriptor, "dispatch" | "settingsBlock"> & { dispatch: "external" }` — the
-duplicate field list at `:1294-1318` goes, so the two new fields are declared once. `runner`'s
-comment gains: "typed to the auto-queue kinds on purpose; the sync heartbeat is a runner in
-the IA doc's sense but not one of these, which is why `/operations/sync` is chosen off
-`trigger`." Each of the three externals (`:1320-1367`) declares `scope: "video", trigger:
-"backlog"`; `operationCatalog()` (`:1389-1405`) maps registry entries with `scope: "video" as
-const, trigger: "backlog" as const` — the registry is per-video by construction
-(`Operation.state(probe)` is a per-video probe).
-
-New, before `EXTERNAL_OPERATIONS`, first in the catalog:
-
-```ts
-// THE SYNC OPERATION. Catalogued so the board, the rail and /operations/sync
-// come off the same table as everything else, and NOT in EXTERNAL_OPERATIONS —
-// that list is the media-derived pipelines the rail draws bands for (editor
-// buildBands.ts, EXTERNAL_BAND_IDS); sync has no per-video population. The lane
-// is the shape download declares: syncAction runs through runPipelineAction on
-// the per-platform download queue (pipelineActions.ts, downloadQueueKey).
-export const SYNC_OPERATION: OperationDescriptor = {
- id: "sync",
- label: "Sync",
- hint: "Noticing new videos: re-reading each channel's listing on its cadence and fetching what is new. Dispatched by the sync scheduler's heartbeat, and by hand per channel or all at once. A corpus that has stopped noticing new videos is not idle — it is broken.",
- group: "sync",
- shortLabel: "Sync",
- costBasis: "one listing fetch per channel, over the network",
- lane: { queueKey: "download:<platform>", contendsFor: "network" },
- dispatch: "external",
- scope: "channel",
- trigger: "cadence",
-};
-```
-
-`operationCatalog()` returns `[SYNC_OPERATION, ...EXTERNAL_OPERATIONS, ...OPERATIONS.map(…)]`
-— upstream first; the `:1366-1368` comment ("what a future scheduler enumerates") is
-rewritten: the scheduler is in it. `OperationGroup` gains `"sync"`; `groupLabel` `case
-"sync": return "Sync"`; `groupActionLabel` (`:1455`) `case "sync": return "syncs"`.
-`OPERATION_GROUP_ORDER` unchanged, plus one comment line (finding 3).
-
-**`editor/app/channels/[slug]/lib/stageStatus.ts:85-90`** — `sync: []` with finding 3's
-comment. `stageOrder.test.ts` stays green untouched.
-
-**`common/lib/pauseGates.ts:60`** "all seven ids" → "all eight ids — sync included, and its
-answer is null: the scheduler's `enabled` is its own switch, not a lane gate".
-**`pauseGates.test.ts:88-104`**: `sync: null` in `expected`; `assert.equal(ids.length, 8)`.
-
-**`common/lib/operations.test.ts`:** `:1223-1233` add `"sync"`; the runner test (`:1245`)
-adds `assert.equal(runners.get("sync"), undefined)` with finding 1's reason; `:1320-1329`
-add `assert.equal(operationGroup("sync"), "sync")`; the `settingsBlock` test (`:1266`) is
-untouched here (sync's block arrives in commit 3). New test after `:1329`:
-
-```ts
-test("`scope` and `trigger`: sync is the one channel-scoped, cadence-triggered operation", () => {
- // The two fields exist so a per-video surface can EXCLUDE sync by a declared
- // fact rather than by its id. Every other entry is per-video and backlog-fed.
- for (const op of operationCatalog()) {
- assert.equal(op.scope === "channel", op.id === "sync", `${op.id} scope ${op.scope}`);
- assert.equal(op.trigger === "cadence", op.id === "sync", `${op.id} trigger ${op.trigger}`);
- }
- assert.equal(operationCatalog()[0].id, "sync"); // upstream first
-});
-```
-
-**Every consumer of the catalog, and what each does with a `sync` entry** (verified):
-
-| consumer | today | after |
-|---|---|---|
-| `operations.ts:1412-1438` `operationApplies/Label/Group/ShortLabel/CostBasis` | `find` by id | unchanged; `operationLabel("sync")` = "Sync" |
-| `pauseGates.ts:63` `pauseLaneFor` | walks catalog | `null` for sync (no runner; queue key is neither sweep's) — test pins it |
-| `operations/[id]/page.tsx:60-62,131` `descriptorFor` | 404 gate | `/operations/sync` resolves; commit 2 reads `op.trigger` |
-| `settings/page.tsx:84` worker tags | every id | moves to `workers/page.tsx`, filtered `scope === "video"` (commit 4) |
-| `channels/page.tsx:77-107` `pipelineColumns` | Map lookup; ids = `EXTERNAL_BAND_IDS + allOperations` | unchanged — sync never in `ids`; comment gains "sync is catalogued but channel-scoped, so no column" |
-| `channels/[slug]/lib/channelFlow.ts:191` | Map lookup over `buildChannelBands` ids | unchanged, same reason |
-| `operations/lanes.ts:74-81` `sweepLaneIdFor` | queue-key switch | `null` for sync |
-| `buildBands.ts:157-193` | `EXTERNAL_BAND_IDS` + `allOperations` ids | unchanged — no sync band; comment at `:87-99` gains one sentence |
-| `controller/videoOperations.ts` (slice 6) | walks `OPERATIONS` | unchanged; header gains "sync is `scope: "channel"` — a per-video reader has nothing to ask it" |
-| `allOperations` / `backfillLaneOperations` / `countBackfillWork` / arbiter / `SweepScope` | `OPERATIONS` | untouched |
-
----
-
-## Commit 2 — `operations: sync has a rail row and a page, and /scheduler redirects`
-
-**`editor/app/operations/syncRow.ts`:** header `:4-6` rewritten (the row is the rail's; the
-schedule is `/operations/sync`); `SyncRowView` gains `id: string; label: string;` from
-`SYNC_OPERATION.id` / `operationLabel(SYNC_OPERATION.id)`.
-
-**`OperationRail.tsx`:** prop `sync?: SyncRowView`. Inside the `<ul>` (`:73-82`), before the
-band rows: `{sync && <SyncRailRow sync={sync} selected={selectedId === sync.id} />}`.
-
-```tsx
-// THE ONE ROW THAT IS NOT A BAND. Sync is channel-scoped and cadence-triggered
-// (the descriptor says so: scope/trigger), so it has no reachable/blocked
-// population to draw and a StateBand here would be a hollow outline over a
-// fact that does not exist. Same anatomy as every other row — the name is the
-// link, the dot is aria-hidden, the state word stands alone — and its figures
-// are channels. First because it is upstream of everything else. RENDERED FROM
-// THE SSR PAYLOAD, not the 3-second poll: a cadence measured in minutes does
-// not need one, and a second poll would buy a spinner nobody asked for.
-function SyncRailRow({ sync, selected }: { sync: SyncRowView; selected: boolean })
-```
-
-`<li data-operation="sync" data-scope="channel" className={RailRow's, :103-105}>`;
-`<Link href={`/operations/${sync.id}`} className={RailRow's, :114-116}>` + dot + `{sync.label}`;
-in the band's slot `<span className="text-xs text-muted-foreground" aria-label="Sync scope">per
-channel, on a cadence</span>`; then the state word + note **moved verbatim** from
-`OperationsBoard.tsx:73-86`; then the figures span verbatim from `:107-126` ("channels on a
-cadence", "due now", "overdue"). `OperationsBoard.tsx`: delete `SyncRow` (`:55-130`) and the
-`Link`, `LANE_*` imports; `<OperationRail … sync={sync} />`.
-
-**`OperationDetail.tsx`:** props gain `sync: SyncRowView` (to `OperationRail`) and
-`cadenceConsole?: ReactNode`; `:113-115` becomes
-`: cadenceConsole ? <>{cadenceConsole}{operationSettings}</> : <NoConsoleView … />` — comment:
-built on the server off `op.trigger`, never off the id; `NoConsoleView` stays the
-fallthrough for a registered operation nothing drives. (`operationSettings` is rendered
-here so commit 3's form has a slot; today it is drawn only in `SweepOperationView`.)
-
-**`operations/[id]/page.tsx`:** `:143-146` `Promise.all` gains `buildSyncRow()`; after `:173`:
-
-```ts
-// THE CADENCE CONSOLE, off the descriptor's trigger. A cadence-triggered
-// operation has no backlog to sweep and no runner to start — its console is
-// its schedule. `runner` cannot say this (it is typed AutoQueueKind, and the
-// heartbeat is not one), so `trigger` does. ONE such operation exists; a
-// second would need the descriptor to name its console, not this file to
-// branch on an id. buildSchedulerStatusPayload runs ONLY in this arm.
-const cadenceConsole =
- op.trigger === "cadence" ? (
- <SyncConsole key="sync" initial={await buildSchedulerStatusPayload()} />
- ) : null;
-```
-
-passed as `cadenceConsole={cadenceConsole} sync={sync}`. `generateMetadata` already titles
-it "Sync".
-
-**`git mv editor/app/scheduler/components/SchedulerView.tsx
-editor/app/operations/components/sync/SyncConsole.tsx`** (export `SyncConsole`; every label
-byte-for-byte). Additions: the intro paragraph from `scheduler/page.tsx:20-33` above the
-status bar (drop "and toggle the headline global controls … here too" and the `/settings`
-pointer — commit 3 moves those fields onto this page); the `runNow` message (`:56-61`)
-reads `keptChecksQueued`/`savedVideoBackupQueued` and appends
-`` · storage chores: ${k} keep-latest check${k===1?"":"s"}${backup ? ", saved-video backup" : ""} ``
-when either is non-zero; under Recent ticks: `<p className="text-xs text-muted-foreground">Two
-Storage chores ride this heartbeat and are not sync: the keep-latest deletion check (its
-interval is in the settings below) and the saved-video backup (Saved videos).</p>`. Header
-comment notes the two polls on this page (5 s status here, 3 s auto-queue from the rail)
-and why they are not merged. **`git mv`** likewise `SchedulerSettingsForm.tsx`,
-`ChannelCadenceEditor.tsx`, `BulkCadenceBar.tsx`, `cadence.ts` into the same directory
-(imports become `../../../scheduler/actions` etc.). **`git rm editor/app/scheduler/page.tsx`.**
-`runTick.ts:1` gains a header line: this directory is the sync operation's runner — the
-heartbeat, the tick, the status payload; its page is `/operations/sync` (rendered by
-`operations/[id]`), and `/scheduler` redirects there.
-
-**Storage chores, labelled** (no logic change): `runTick.ts:22-27` imports get "STORAGE CHORES
-riding this heartbeat because it is the one timer the editor has. Neither is sync (IA doc,
-the Sync row): the keep-latest check consumes outputs, the backup copies them"; the comments
-at `:154-158` / `:181-183` open "Storage chore:"; `:172` reason → `` `storage chore
-(keep-latest check): ${result.error}` ``; `:196` slug → `"storage chore (saved-video
-backup)"`; `SchedulerTickResult` field comments (`:37-40`) say "Storage chore".
-`SavedVideosControls.tsx:86-87` → "the sync heartbeat runs this Storage chore on the cadence
-below".
-
-**Nav and redirect.** `lib/nav.ts:85-86` deleted, `CalendarClock` dropped from the import,
-the Operations entry's `keywords` (`:83`) gains `" sync schedule cadence cron"` (the palette,
-`CommandPalette.tsx:254`, still finds it). `next.config.ts:66-67` gains `{ source:
-"/scheduler", destination: "/operations/sync", permanent: false }` and the comment
-(`:48-62`) one sentence: "/scheduler was the sync operation's page before sync was
-catalogued; `/api/scheduler/*` is NOT redirected — the cron client and the console's own
-poll never moved." `HowPriorityWorks.tsx:41` → `href="/operations/sync"`.
-`scheduler/actions.ts:102,152` → `revalidatePath("/operations/sync")`.
-`api/scheduler/status/route.ts` comment → "the /operations/sync console".
-
-**Specs (commit 2):** `scheduler.spec.ts` — header `:6-12` and the `:86` comment →
-`/operations/sync`; all seven `goto`; test 1 (`:26-93`) adds `getByRole("heading", { name:
-"Sync", level: 1 })` visible and `page.locator('li[data-operation="sync"]')` contains
-"channels on a cadence". `navigation.spec.ts:108-114`: after the `/actionable` block,
-`goto("/scheduler")` → `toHaveURL(/\/operations\/sync$/)` → the "Sync" h1; comment gains
-"/scheduler was the sync operation's page before sync was catalogued".
-`auto-queue.spec.ts:1088-1093`: comment gains "and sync, the one channel-scoped row"; add
-`rail.filter({ hasText: "Sync" }).first()` visible and `rail.getByRole("link", { name: "Sync",
-exact: true })` has `href="/operations/sync"`. `:1108` and `:1166` pass unchanged.
-
----
-
-## Commit 3 — `sync: its settings live on its page, and one action writes them`
-
-**`common/lib/operations.ts`:** `OperationSettingsBlock` (`:327`) gains `"syncScheduler"`;
-`SYNC_OPERATION.settingsBlock = "syncScheduler"`. **`operations.test.ts:1266-1280`** expected
-map gains `sync: "syncScheduler"`.
-
-**`operations/[id]/page.tsx` `settingsFormFor`** (`:71-110`) gains the arm — the exhaustive
-switch is exactly why the union grew:
-
-```tsx
-case "syncScheduler":
- return (
- <SchedulerSettingsForm
- key="syncScheduler"
- scheduler={settings.syncScheduler}
- heartbeatSeconds={resolveHeartbeatSeconds()} // scheduler/heartbeat.ts:43, server-only
- />
- );
-```
-
-`OperationDetail` already renders `operationSettings` in the cadence branch (commit 2).
-
-**`operations/components/sync/SchedulerSettingsForm.tsx`** becomes the whole block: h2
-"Global controls" → **"Sync scheduler"**; the `/settings` "Advanced (…)" link (`:33-35`)
-deleted; `<form … data-settings-block="syncScheduler">` (the slice-3 forms' attribute,
-`DigestSettingsForm.tsx:41` etc.); the eleven fields it lacks moved **verbatim** from
-`SettingsForm.tsx:314-464` — `Full-sweep auto-confirm cap`, `Full-sweep shrink guard`, `Max
-concurrent syncs`, `Keep-latest check interval`, `Quiet hours start (0–23)`, `Quiet hours end
-(0–23)`, `Backoff base`, `Backoff max` (its three existing fields keep their names:
-`syncSchedulerEnabled`, `syncSchedulerDefaultIntervalMinutes`,
-`syncSchedulerFullSweepIntervalMinutes`, `syncSchedulerHeartbeatSeconds`); the
-`Field`/`DurationField`/`FULL_SWEEP_PRESETS`/`SYNC_INTERVAL_*` imports come with them. Keep
-the button **"Save controls"** and `role="status"` "Saved." / `role="alert"` — pinned. The
-keep-latest hint → "A Storage chore on the sync heartbeat, not sync: how often channels with
-a keep-latest limit are re-checked so old videos get pruned even when nothing new arrived."
-**`SyncConsole.tsx`** stops rendering `SchedulerSettingsForm` (`:130-133` + import): the
-page's settings slot draws it below the console.
-
-**`scheduler/actions.ts` `saveSchedulerSettingsAction`** (`:111-152`) parses every field of
-the block. Move `hourOrNull` from `settings/actions.ts:176-181`; keep `intOrKeep` for every
-numeric field (an absent or blank field keeps the saved value — the existing contract at
-`:117-121`, now true of the whole block); header: "THE ONE WRITER OF settings.syncScheduler.
-Reads the current file and replaces this block only; every other block is preserved
-verbatim — the contract `cadence-ui.spec.ts` holds every settings writer to."
-`revalidatePath("/operations/sync")` + `"/settings"` stays (the `/settings` pointer prose).
-
-**Deletions on `/settings`:** `SettingsForm.tsx:314-464` (the fieldset) and the now-unused
-imports (`FULL_SWEEP_PRESETS` `:20`, `SYNC_INTERVAL_MIN/MAX_MINUTES` `:14-17`, `DurationField`
-`:18` if no other user — tsc/lint decide); `settings/actions.ts:172-226` (the parse) →
-`syncScheduler: getSettings().syncScheduler,` at `:301` with the `:311-322` preserve comment
-extended ("syncScheduler: edited on /operations/sync"). `settings/page.tsx:55-77` pointer
-paragraph gains `<Link href="/operations/sync">Sync</Link>` beside the four operation links.
-
-**Specs (commit 3):** `cadence-ui.spec.ts:104-138` → `goto("/operations/sync")`, `const form =
-page.locator('form[data-settings-block="syncScheduler"]')`, `form.getByLabel(…)` for the four
-fields, `form.getByRole("button", { name: "Save controls" })`, `await
-expect(form.getByRole("status")).toHaveText("Saved.")` before the poll. `:140-171` (the
-unrelated `/settings` save) is **unchanged** and now passes by preservation rather than by
-re-parse — its comment says so. New test after it, in `cadence-ui.spec.ts`:
-`"the sync page's save writes its block and nothing else"` — `writeSettings({adminTitle:
-"Keep Me", …})`, goto `/operations/sync`, fill `Max concurrent syncs` = 3 in the form, Save
-controls, poll `test-settings.json` → `{ adminTitle: "Keep Me", syncScheduler: {
-maxConcurrentSyncs: 3 } }`. `scheduler.spec.ts:260-282` ("edits the global controls") passes
-unchanged — same labels, same button. `operation-settings.spec.ts:239-241` (count 0 on
-transcode/download) unaffected.
-
----
-
-## Commit 4 — `workers: the worker list is configured where the workers are`
-
-**`git mv editor/app/settings/components/WorkersField.tsx
-editor/app/workers/components/WorkersField.tsx`** — header `:7-12` "the save action" →
-`saveWorkersAction`; nothing else (the aria-labels at `:231,240,251,260,267,277,286,301,498`
-are the contract).
-
-**New `editor/app/workers/components/WorkersConfigForm.tsx`** (`"use client"`; `import type
-{ Worker }`, `import type { TranscriptionAppDescriptor }` — both load-bearing type-only):
-
-```tsx
-export function WorkersConfigForm({ initial, apps, knownTags }: {
- initial: Worker[]; apps: TranscriptionAppDescriptor[]; knownTags: string[];
-})
-```
-
-`useActionState(saveWorkersAction, undefined)` (`SettingsForm.tsx:37-40`); `<form
-action={formAction} data-settings-block="workers" className="flex flex-col gap-3 rounded border
-border-border p-3">`; `<h2 className="text-sm font-semibold">Configuration</h2>`; the prose
-from `SettingsForm.tsx:72-82` with its last sentence "Enable, disable and drain individual
-workers live in the list above."; `<WorkersField initial={initial} apps={apps}
-name="workersJson" knownTags={knownTags} />`; button **"Save workers"**; `<span
-role="status">Saved.</span>` / `<span role="alert">{error}</span>` (`SettingsForm.tsx:530-546`).
-Header: this form writes ONE block and nothing else on the page is a form, which is what
-lets a save here never read another block's checkbox as off.
-
-**`editor/app/workers/actions.ts`** (already `"use server"`): header `:7-14` rewritten; add
-
-```ts
-export type SaveWorkersResult = { ok: true } | { ok: false; error: string };
-// THE ONE WRITER OF settings.workers. Reads the current file and replaces this
-// block only — every other block is preserved verbatim, the contract
-// cadence-ui.spec.ts holds every settings writer to. Then the live pool: a
-// saved Enabled change is an explicit intent and takes effect now
-// (applyEnabled), exactly as the whole-object settings form did before this
-// moved here.
-export async function saveWorkersAction(_prev: SaveWorkersResult | undefined, formData: FormData): Promise<SaveWorkersResult>
-```
-
-Body: `settings/actions.ts:86-96` verbatim (parse → `sanitizeWorkers` → `validateWorkers`),
-`await writeSettings({ ...getSettings(), workers })` in `try`, `getWorkerPool().reconfigure
-(workers, { applyEnabled: true })` (`:332-334`), `revalidatePath("/workers")`.
-
-**`editor/app/workers/page.tsx`:** delete the "Configure workers" `Link` (`:13-16`) and the
-"Worker config … lives on the Settings page" sentence (`:23-28`); server reads
-`getSettings().workers`, `listTranscriptionApps()` and
-
-```ts
-// The tag vocabulary a worker can be matched on: every PER-VIDEO operation (a
-// delegate takes a UNIT of one — lanes.ts, runsOnFor) plus the resources.
-// `scope` is the filter, not the id: sync is catalogued and channel-scoped,
-// and no worker will ever be handed a channel.
-const knownTags = [...new Set([
- ...operationCatalog().filter((o) => o.scope === "video").map((o) => o.id),
- ...WORKER_RESOURCE_TAGS,
-])];
-```
-
-(`settings/page.tsx:82-87` was this without the filter.) Render `<WorkersConfigForm …/>`
-after `<WorkersView>`.
-
-**Deletions on `/settings`:** `SettingsForm.tsx:13` (`TranscriptionAppDescriptor`), `:26`
-(`WorkersField`), `:30-34` (`apps`, `workerTags`), `:36` destructure, `:68-90` (the fieldset).
-`settings/page.tsx:5-7` imports and `:80-87` props; the pointer paragraph gains "The
-transcription worker list is configured on <Link href="/workers">Workers</Link>, beside the
-workers it describes." `settings/actions.ts:31-35` imports, `:84-96` parse, `:329-334`
-reconfigure, `:336` `revalidatePath("/workers")` deleted; `:282` → `workers:
-getSettings().workers,` with the preserve comment extended ("workers: edited on /workers").
-
-**Specs (commit 4):** `settings.spec.ts:60-118` (three tests: migrated defaults + add, copy,
-no-enabled-workers) → **moved to `workers.spec.ts`** (same `beforeEach resetData("empty")`),
-`goto("/workers")`, `const form = page.locator('form[data-settings-block="workers"]')`,
-`form.getByRole("button", { name: "Save workers" })`, `await
-expect(form.getByRole("status")).toHaveText("Saved.")`, `form.getByRole("alert")`; the
-`page.reload()` re-check (`:83-84`) stays. `settings.spec.ts` keeps its other five tests.
-`transcription-app-migration.spec.ts:21,37` → `/workers` (header `:3-6` "the Settings page"
-→ "the Workers page"). `parakeet-partial.spec.ts:206-215` → `/workers`, "Save workers",
-form-scoped status. `workers.spec.ts:1-3` header: "plus the persisted worker list, which is
-configured here now".
-
----
-
-## Commit 5 — `lanes: one note for why a lane is not working`
-
-**`editor/app/components/lanes/laneState.ts`**, after `deriveLaneState` (`:23-47`; no
-directive, imports only a type — safe on both sides):
-
-```ts
-// WHY A SWEEP LANE IS NOT WORKING, in words; null when it is, or when there is
-// nothing to say. ONE COPY: the operations rail (railStates.ts) and the Active
-// Jobs lane strip (buildActiveJobs.ts) carried this table twice, byte for
-// byte, and the sweep panel says the same two facts in sentences. Takes
-// deriveLaneState's input and follows its precedence, so the word and the
-// note cannot disagree about which fact wins.
-export function sweepLaneNote(input: Parameters<typeof deriveLaneState>[0]): string | null {
- if (input.available === false) return "no operation switched on";
- if (input.gateHeld) return input.feedRunning ? "sweep armed, lane paused" : "lane paused";
- if (input.feedRunning || (input.activeCount ?? 0) > 0) return null;
- return "no sweep armed";
-}
-```
-
-`railStates.ts:41-57` → build `input` once; `state: deriveLaneState(input), note:
-sweepLaneNote(input)`. `buildActiveJobs.ts:346-379` `sweepLane` → the same two calls over
-`{ available, gateHeld, feedRunning: sweeping, activeCount: inFlight }`, deleting its
-precedence copy (`:356-363`) and table (`:367-375`). `SweepLane.tsx:215-222`: comment only —
-the long form of `sweepLaneNote`'s `holding` row. New **`laneState.test.ts`** (node:test,
-`app/**/*.test.ts` glob): the four strings as literals naming the two consumers; `null` for
-feed-running and for in-flight; precedence (`available: false` beats `gateHeld`, `gateHeld`
-beats `feedRunning`); `deriveLaneState` and `sweepLaneNote` agree on `holding` ⇔ a paused
-note.
-
----
-
-## Aria-label / URL table (old → new; which spec pins it)
-
-| old | new | pinned by |
-|---|---|---|
-| `/scheduler` | `/operations/sync` (307 from the old) | `scheduler.spec.ts` ×7, `cadence-ui.spec.ts:184`, `navigation.spec.ts:108-114` (extended) |
-| h1 "Sync schedule" | h1 `op.label` **"Sync"** | new in `scheduler.spec.ts` + `navigation.spec.ts` |
-| sidebar "Schedule" → `/scheduler` | gone | none (`dashboard.spec.ts:108-125` pins Channels/Build/Jobs/Settings only) |
-| board `Link` "Sync schedule" | rail `li[data-operation="sync"]` link **"Sync"** | new assertion in `auto-queue.spec.ts` |
-| "Run scheduler now", "Scheduler enabled/disabled", `select ${slug}`, "Edit cadence for ${slug}", "Auto-sync interval for ${slug}" (+ unit/amount), row /Slow A/, "Save", `bulk cadence`, "Bulk full sweep interval", "Apply" | **unchanged** | `scheduler.spec.ts`, `cadence-ui.spec.ts:184-215` |
-| "Enable scheduled auto-sync", "Default interval" (+ unit/amount), "Default full sweep interval", "Internal heartbeat", "Save controls", "Saved." | unchanged, now in `form[data-settings-block="syncScheduler"]` | `scheduler.spec.ts:260-282` |
-| `/settings` "Default full sweep interval", /full-sweep auto-confirm cap/i, "Keep-latest check interval unit/amount" | same labels on `/operations/sync` | `cadence-ui.spec.ts:104-138` (repointed) |
-| `/settings` worker labels (`worker N …`, "+ Local worker", "copy worker 1", /chough server URL/i, /^Device/) | **unchanged**, now on `/workers` | `settings.spec.ts:60-118` (moved), `transcription-app-migration.spec.ts`, `parakeet-partial.spec.ts:206-215` |
-| /save settings/i (for worker / sync edits) | "Save workers" / "Save controls" | the moved tests |
-| `page.locator("form").getByRole("alert")` | `form[data-settings-block="workers"]` `role="alert"` | moved test |
-| — | `aria-label="Sync scope"` on the rail row | none |
-| lane notes (four strings) | unchanged strings, one source | none |
-
-## Verification
-
-1. After each of commits 1–5: tsc in the six packages; `pnpm -C common test`; editor units.
-2. Grep gates after commit 5, over `editor/ common/` excluding `node_modules`/`.next`:
- - `"/scheduler"` → only `next.config.ts` (the redirect source); `revalidatePath("/scheduler")` → 0.
- - `SchedulerView\b|scheduler/components` → 0; `editor/app/scheduler/page.tsx` and
- `editor/app/scheduler/components/` do not exist.
- - `label: "Schedule"|CalendarClock` in `nav.ts` → 0. `SyncRow\b` → 0.
- - `syncScheduler` in `settings/actions.ts` → exactly the one preserve line;
- `syncScheduler(Enabled|DefaultInterval|…)` field names in `SettingsForm.tsx` → 0.
- - `WorkersField` → only under `editor/app/workers/`; `workersJson` → only
- `workers/actions.ts` and `WorkersConfigForm.tsx`; `sanitizeWorkers|validateWorkers|
- getWorkerPool` in `settings/actions.ts` → 0; "Transcription workers" legend → 0.
- - `"no sweep armed"|"lane paused"|"no operation switched on"` → only `laneState.ts` + test.
- - `all seven` in `pauseGates.ts` → 0.
- - `from "yt-dlp-transcript-common/lib/operations"` in any `"use client"` file under
- `operations/components` and `workers/components` → every hit is `import type`.
- - the render-path guard: `pnpm -C common exec tsx --test controller/noCorpusWalkInRenderPaths.test.ts`.
-3. e2e once after commit 6, detached (`cd editor && setsid nohup sh -c 'pnpm e2e -- <specs>;
- echo exit=$?' > $CLAUDE_JOB_DIR/tmp/e2e.log 2>&1 < /dev/null & disown`):
- `scheduler.spec.ts cadence-ui.spec.ts navigation.spec.ts auto-queue.spec.ts
- operation-settings.spec.ts settings.spec.ts workers.spec.ts
- transcription-app-migration.spec.ts parakeet-partial.spec.ts worker-remote.spec.ts
- dashboard.spec.ts widget.spec.ts jobs-active-order.spec.ts backfill.spec.ts
- saved-videos.spec.ts channels-actions.spec.ts sync-deep.spec.ts perf-budget.spec.ts`.
- Port fallback `PORT=3111 EXPORT_PORT=3110 OLLAMA_STUB_PORT=11535`; never kill anything.
-4. **No editor boot against `transcripts/`, nothing written under it.**
-5. Manual (optional, `PORT=3021 pnpm dev:test`): `/operations` rail reads Sync, Download,
- Transcription, Digest, …; `/scheduler` lands on `/operations/sync` with the Sync row
- highlighted, the cadence table, bulk bar, recent ticks and the full Sync scheduler form
- below; sidebar Operations group has one entry; `/workers` shows the live list then
- Configuration with Save workers; `/settings` has neither fieldset and points at both.
-
-## Commit 6 — `plans: slice 8a+8b shipped, and the docs say so`
-
-- `editor/CHANGELOG.md` `[Unreleased]` first bullet, house voice (`:4` is the model): **Sync
- is an operation on the board, and the schedule is its page.** The rail's first row is Sync
- — channels on a cadence, due now, overdue, the same four state words — and
- `/operations/sync` is the schedule that was `/scheduler` (per-channel cadences, bulk retune,
- recent ticks; every control unchanged) with **every Sync scheduler setting below it** — the
- fieldset that was on Settings, saved by one button. `/scheduler` redirects; the API paths
- and the cron client never moved; the sidebar's Schedule entry is gone. The two Storage
- chores that ride the heartbeat — the keep-latest check and the saved-video backup — are
- named as such on the console and on Saved videos. **Transcription workers are configured on
- Workers now**, under the live list, with their own Save; Settings keeps the machine and the
- site and points at both pages. The reason a lane is not working is one table. **Nothing on
- disk changes; no setting is renamed.**
-- `plans/editor-operations-ia.md:57` Sync row → SHIPPED with findings 1 and 2; `:71` loses
- the interim; `:168-171` → "8a+8b SHIPPED `<sha>` → `<sha>`; the `/jobs` fold is its own
- plan"; new "## Slice 8a+8b, as shipped" after "Slice 7, as shipped": the six commits;
- findings 1–9; the group decision; the settings-block decision (the operator moved the
- whole block; the keep-latest interval moved with it, labelled a Storage chore's knob);
- what stayed (the runner directory, the widget's scheduler strip, `SweepLane`'s prose).
-- `plans/STATE.md`: "Last updated" prepend; "Recommended next" DONE line; the `/jobs` fold
- as the next IA candidate with the design question ("one table" over three sources).
-- `plans/FACTS.md`: `## Verified 2026-08-29 — editor IA slice 8a+8b seams` after the
- slice 6 section: the catalog-consumer table, `pauseGates.test.ts:100`'s pin, the
- `ExternalOperation` fold, two-copies-and-a-paraphrase, where the chores show, the
- `scheduler/` directory decision, the one-writer rule for `syncScheduler` and `workers`.
-- `SCHEDULED_SYNC.md`: "Settings → Sync scheduler" → "Operations → Sync (`/operations/sync`),
- below the schedule"; a sentence that `/scheduler` redirects.
-- Memory: `ia-slice-8ab-shipped.md` + a `MEMORY.md` line; amend `ia-slice-7-shipped` (the
- three-copies note is done) and `ia-slice-6-shipped`'s "remaining candidates".
-
-## Out of scope
-
-- The `/jobs` fold (its own plan). Any change to `runSchedulerTick`, `SchedulerRun`,
- `syncSchedulerState` or a settings key. The widget's "Auto-sync scheduler" strip and
- `/api/widget/sync`. `Field.tsx`/`CardField`. Moving the `scheduler/` runner modules. A
- `console` field on the descriptor (one cadence operation exists). `SweepLane`'s prose.
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`): write the plan to
-`plans/editor-ia-slice-8ab.md`, commit it alone, then spawn one `general-purpose` agent,
-`model: "opus"`, with: the plan path, the shell caveats (the Bash tool runs zsh here — no
-word-splitting of `$VAR` commands; POSIX loops inside `sh -c`; `git commit -F <file under
-$CLAUDE_JOB_DIR/tmp>`; quote `[slug]`/`[id]` paths and globs), never boot against
-`transcripts/`, e2e detached, tmp under `$CLAUDE_JOB_DIR/tmp`, the two trailer lines, and
-the report contract (shas + one line each; exact gate outputs; e2e per spec with retries;
-every divergence and why; anything undone). Fable reviews on return (`git log --oneline
-6f6c307..`; `operations.ts` hunks + tests, `pauseGates.test.ts`, `stageStatus.ts`,
-`syncRow.ts`, `OperationRail.tsx`, `OperationsBoard.tsx`, `OperationDetail.tsx`,
-`operations/[id]/page.tsx`, `SyncConsole.tsx` + `SchedulerSettingsForm.tsx`
-diff-against-rename, `scheduler/actions.ts`, `next.config.ts`, `nav.ts`, `runTick.ts`
-comment hunks, `WorkersConfigForm.tsx`, `workers/actions.ts`, `workers/page.tsx`,
-`settings/{page,actions,components/SettingsForm}` deletions, `laneState.ts` + test,
-`railStates.ts`, `buildActiveJobs.ts`, the moved specs; re-runs grep gates + `pnpm -C common
-test` + editor units, not e2e), sends fixes via SendMessage, and reports.
diff --git a/plans/editor-ia-slice-8c.md b/plans/editor-ia-slice-8c.md
@@ -5,7 +5,7 @@
**Verified read-only against `a609566` (clean) on 2026-08-30.** Slice 8a+8b shipped at
`ecf80a5`; the twelve commits since (`de9efeb` → `a609566`, another session's export
responsive redesign) touch only `export/`, `common/components/*`, `common/lib/useMediaQuery.ts`
-and `plans/export-responsive-redesign.md` — nothing under `editor/`, `common/jobs/*` or any
+and `plans/archive/sites-and-publishing.md` (entry `export-responsive-redesign.md`) — nothing under `editor/`, `common/jobs/*` or any
`common/lib` file this plan anchors (each checked with `git diff --quiet ecf80a5..HEAD`). This
is the last third of the IA doc's slice 8 (`plans/editor-operations-ia.md:168-175`). STATE.md
#12 (`:286-291`) asked the question first — *what is a ROW* — and the answer is the whole
diff --git a/plans/editor-operations-ia.md b/plans/editor-operations-ia.md
@@ -60,7 +60,7 @@ and concludes the model was wrong.
| **Sync** | **SHIPPED 2026-08-29** (slice 8a+8b). An operation, but channel-scoped and cadence-triggered: `scope: "video" \| "channel"` and `trigger: "backlog" \| "cadence"` are on `OperationDescriptor`, `SYNC_OPERATION` is first in `operationCatalog()`, and `/operations/sync` is its page. Two corrections to the wording above. **(1) "Keeps its own runner" could not be `runner`** — that field is typed `AutoQueueKind` and the heartbeat is not one of them, so the page chooses the cadence console off `trigger` and `runner` stays `undefined` (`operations.test.ts` pins it, with the reason). **(2) The board row is composed, not folded into a band** — `OperationBand`'s five populations are videos and sync's figures are channels, so `buildOperationBands` gains no sync band and `OperationRail` draws a `SyncRailRow` first in the same `<ul>`. The keep-latest checks and the saved-video backup that ride the same heartbeat (`editor/app/scheduler/runTick.ts`) are **Storage chores**, not sync, and are labelled as such on the console, in the skip reasons and on Saved videos. |
| **Build / deploy** | **Not** operations. Per-site, no per-video state, no lane. They are the Site's *publish* verb → `/sites/[siteId]`. |
| **Cleanup / saved-videos / relocate** | **Not** operations: they consume outputs rather than producing derived artifacts. Third noun, **Storage**, filed under Machine. The channel `cleanup` stage stays where it is. |
-| **Transcode** | **REMOVED 2026-08-30 — never fired in production; the band question is closed.** The census that settled it (read-only `jq` over 68 channels, 2026-08-30): `buckets.untranscoded` non-empty in **0 of 68**, `multipleAudioFormats` non-empty in 0 of 68, `cleanupBytes.foreignAudio > 0` in 0 of 68, both `failed-transcodings` files on disk **0 bytes**, and only **4** channels passing the gate `handling === "transcribe" && !!audioFormat`. It could not have mattered either: `transcribeOne`'s `resolveAudioFile` falls back to any real audio file when `audio.<fmt>` is absent. **Deleted**: the four controllers, the four job kinds, the channel page's Transcode stage and station, `buckets.untranscoded` as a to-do list, the video list's "transcoded" dot and failed filter, the catalog entry and with it `appliesTo`/`operationApplies` (the entry was the only taker) — catalog 8 → 7. **Kept**: `transcodeAudio` and the download path (`extractionMode: "app"`, two callers), the per-file *Transcode <file> → <fmt>* rows on the video page, and both wrong-format-audio sweeps, re-gated on `!!config.audioFormat`; the bucket is `wrongFormatAudio` now. **`EXTERNAL_BAND_IDS` stays `["download", "transcription"]` permanently** — there is no third band to add. Plan: `plans/editor-transcode-removed.md`; census in FACTS.md, "Verified 2026-08-30 — transcode: what it was, what stayed". |
+| **Transcode** | **REMOVED 2026-08-30 — never fired in production; the band question is closed.** The census that settled it (read-only `jq` over 68 channels, 2026-08-30): `buckets.untranscoded` non-empty in **0 of 68**, `multipleAudioFormats` non-empty in 0 of 68, `cleanupBytes.foreignAudio > 0` in 0 of 68, both `failed-transcodings` files on disk **0 bytes**, and only **4** channels passing the gate `handling === "transcribe" && !!audioFormat`. It could not have mattered either: `transcribeOne`'s `resolveAudioFile` falls back to any real audio file when `audio.<fmt>` is absent. **Deleted**: the four controllers, the four job kinds, the channel page's Transcode stage and station, `buckets.untranscoded` as a to-do list, the video list's "transcoded" dot and failed filter, the catalog entry and with it `appliesTo`/`operationApplies` (the entry was the only taker) — catalog 8 → 7. **Kept**: `transcodeAudio` and the download path (`extractionMode: "app"`, two callers), the per-file *Transcode <file> → <fmt>* rows on the video page, and both wrong-format-audio sweeps, re-gated on `!!config.audioFormat`; the bucket is `wrongFormatAudio` now. **`EXTERNAL_BAND_IDS` stays `["download", "transcription"]` permanently** — there is no third band to add. Plan: `plans/archive/editor-ia.md` (entry `editor-transcode-removed.md`); census in FACTS.md, "Verified 2026-08-30 — transcode: what it was, what stayed". |
| **Social channels** | A channel whose operation set is `{fetch-posts}`. An explicit **non-goal** here: leave the short-circuit at `editor/app/channels/[slug]/page.tsx:156` alone. |
| **The channel stage list** | Half-derived and that is correct. The middle (`download … backfill`) derives from `OPERATION_GROUP_ORDER`; the bookends (`configure`, `playlist` / `cleanup`, `diagnostics`, `danger`) are **channel chores**, not operations, and stay hand-listed. Say so in the code so the next reader does not "finish" the derivation. |
| **Digest's two lanes** | A **registry defect**, not a noun problem. `common/controller/arbiter.ts` special-cased `DIGEST_KIND_ID` because digest runs on its own queue. **Resolved in slice 2** by giving digest its own `laneFor(settings)` and resolving every operation through `laneForOperation` — but NOT by "giving every kind a `laneFor` defaulting to `lane`": `laneFor` is optional and its PRESENCE is what `backfillBatch.ts` keys the GPU idle-only rule off, so a default would enrol every operation in that rule (FACTS.md, "laneFor? is OPTIONAL"). Add one only where the lane genuinely varies. |
@@ -288,7 +288,7 @@ id set the runner has no parameter for).
Five commits: `9515083` (the plan) → `f14ceb5` (the seams) → `43bb519` (the move) →
`b303817` (copy, the `/settings` pointer, docs) → `7c34bc5` (one collision the move created).
-The plan is [`editor-ia-slice-3.md`](editor-ia-slice-3.md).
+The plan is [`editor-ia-slice-3.md`](archive/editor-ia.md).
**The one thing the move broke, and it is worth knowing why.** Putting a form inside
`section[data-lane]` puts its PROSE in that section's scope too. The lane form's paragraph
@@ -355,7 +355,7 @@ the dashboard rename) → `68f1079` (`/channels` reports, `/cleanup` tables) →
`97ee12a`: the slice's e2e run found `channels-sort.spec.ts` asserting on "Downloads" /
"Transcripts" headers that had matched nothing since the per-operation strip (`4d57a5e`)
relabelled them; it now iterates the fixed columns, "Report" included. The plan is
-[`editor-ia-slice-4.md`](editor-ia-slice-4.md).
+[`editor-ia-slice-4.md`](archive/editor-ia.md).
**The dashboard's digest number is a RENAME, not a re-sourcing, and the slice-4 bullet above
had it wrong.** `actionableNoDigestCount` already returned `digestWorkOf(row.snapshot).reachable`
@@ -407,7 +407,7 @@ than a move.
Five commits: `6986efc` (the plan) → `731f9fa` (`common/controller/videoOperations.ts` + its
test, `digestSectionStates`, `hasDigest` moved, `hasAttribution` deleted) → `1eae26e` (`ids`
through the backfill channel job) → `6966239` (the panels) → `d5ca90a` (the per-video Run and
-the e2e). The plan is [`editor-ia-slice-6.md`](editor-ia-slice-6.md).
+the e2e). The plan is [`editor-ia-slice-6.md`](archive/editor-ia.md).
**`hasDigest` was the CHANNEL COUNT's, not the page's, and the bullet above had it backwards.**
Its one caller was `countDataFiles` in `controller/channels.ts` — the batch ground-truth walk
@@ -464,7 +464,7 @@ satisfies it.
Five commits: `c924f73` (the plan) → `fdef74c` (`common/lib/pauseGates.ts` + its test, and the
three dispatch holds on it) → `fbc2d36` (one action pair; eight actions deleted; the wire says
`held`) → `841372a` (`pauseControl.tsx`, every lane surface on it, two button files deleted) →
-`685cba3` (the runner pages). The plan is [`editor-ia-slice-7.md`](editor-ia-slice-7.md).
+`685cba3` (the runner pages). The plan is [`editor-ia-slice-7.md`](archive/editor-ia.md).
**Keyed by LANE, not by operation, and that is the decision the bullet above got wrong.** The
gate is per lane: diarization, attribution-diarized and attribution-text all ride
@@ -529,7 +529,7 @@ and they are one `sweepLaneNote` now. See below.)*
## Slice 8a+8b, as shipped
-Six commits after the plan ([`editor-ia-slice-8ab.md`](editor-ia-slice-8ab.md), `b8c485b`):
+Six commits after the plan ([`editor-ia-slice-8ab.md`](archive/editor-ia.md), `b8c485b`):
`ea04b4e` (the catalog entry, `scope`/`trigger`, group `sync`) → `23d2cd8` (the rail row, the
page, the redirect, the Storage-chore labels) → `f8e0185` (the whole `syncScheduler` block on
`/operations/sync`, one writer) → `1cdb823` (`WorkersField` and the persisted list on
@@ -699,7 +699,7 @@ bar to its elapsed timer — the bars are a shared component, and the table's St
## Slice 5, as shipped
-Four commits after the plan ([`editor-ia-slice-5.md`](editor-ia-slice-5.md), `5660fae`):
+Four commits after the plan ([`editor-ia-slice-5.md`](archive/editor-ia.md), `5660fae`):
`140212a` (a site has tabs; Charts and Search aliases are two of them) → `ffd5ac6` (Publish is
the site's tab; the family page cuts the release and batches the builds) → `a756049` (the pool
runs from the family page) → `df9b839` (the hub is the family's, and the Sites group is one
diff --git a/plans/editor-transcode-removed.md b/plans/editor-transcode-removed.md
@@ -1,541 +0,0 @@
-# The slice-5 leftovers, then the transcode operation is removed: it never fired in production
-
-## Context
-
-**Verified read-only against `f3b187a` (clean) on 2026-08-30/31**, the commit that closed
-slice 5. Every file:line was re-read at this sha by the design pass; where the initial brief's
-anchors or wording were off, a finding says so. The `duplicates-page` worktree exists (HEAD
-`7baef40`, merge-base `43bb519`) — another session commits into this checkout.
-
-The IA docs' remaining editor item was "the transcode band" (`plans/editor-operations-ia.md:60`,
-`STATE.md:328-331`): teach the snapshot writer a transcode population so `EXTERNAL_BAND_IDS`
-could go to three. The operator's instinct — that the transcode feature was built for a bug
-that never occurred — is confirmed by the census, and **the band question closes by deletion,
-not by a snapshot-shape change**.
-
-**The production census** (read-only `jq` over `transcripts/channels/*/{snapshot,config}.json`;
-nothing booted, nothing written):
-
-| fact | figure |
-|---|---|
-| channels / snapshots | **68 / 68** — every snapshot carries a `buckets.untranscoded` key |
-| `generatedAt` | 44 on 2026-08-27, 19 on 08-30, 5 on 08-31 (UTC) |
-| `buckets.untranscoded` non-empty | **0 of 68** |
-| `buckets.multipleAudioFormats` non-empty | **0 of 68** |
-| `cleanupBytes.foreignAudio > 0` | **0 of 68** |
-| `failed-transcodings` files on disk | **2** (`cornbreadman` mtime Jun 29, `the-quartering-rumble` mtime May 16), **both 0 bytes** |
-| channels passing `handling==="transcribe" && !!audioFormat` | **4**: cornbreadman, hasanabi, omnimirror, the-quartering-rumble (all mp3) |
-| `keepLatest > 0` (forces `extractionMode: "app"`, `persistencePlan.ts:92-94`) | **2**: nuxanor-kick 1, quarteringvlogs 5 |
-
-**Transcode is three layers wearing one name.** (1) *Download-time extraction*: the app runs
-ffmpeg itself (`transcodeAudio`, `common/controller/transcode.ts`) when
-`extractionMode === "app"` — two callers, `audioCheckedDownload.ts:44,768` and
-`downloadOneManaged.ts:30,224` — forced for keep-latest videos; **live in production, KEPT.**
-(2) *The transcode OPERATION* (`70ed00f` 2026-05-19 "transcode failure handling"; half of
-`bb380c6` 2026-06-18): a channel-page Transcode stage, a `failed-transcodings` ledger, four
-job kinds, `buckets.untranscoded`, a "transcoded" dot and failed filter on the video list, a
-registry entry carrying the catalog's only `appliesTo`, and `/operations/transcode` — built
-for yt-dlp's `-x` step failing or a codec whisper could not read. Neither happened, and it
-could not have mattered: `transcribeOne.ts:22-31` `resolveAudioFile` falls back to ANY real
-audio file when `audio.<fmt>` is absent (strict is opt-in per manual batch, default false —
-`whisperBatch.ts:73,99`). **DELETED.** (3) *Wrong-format audio cleanup* (the other half of
-`bb380c6`): `multipleAudioFormats`/`foreignAudio`, both sweeps and their bulk actions.
-**KEPT**, re-gated on `!!config.audioFormat`.
-
-**Decided (operator, 2026-08-30):**
-
-- **(A) The slice-5 leftovers ride first**, one commit: `measure-nav.mjs` names live routes
- and warns on a 3xx; `BUILD_KINDS` is the Pool's eight; `EditorAliasesClient` always has a
- site.
-- **(B) Option "the operation".** DELETE layer 2 — the four controllers, four job kinds and
- their actions/replay handlers, the stage everywhere it is wired, the registry entry and
- (sole taker) `appliesTo`/`operationApplies`. KEEP `transcodeAudio` and the download path,
- the per-file "Transcode <file> → <fmt>" rows on the video page (`transcodeAudioAction`,
- the one escape hatch), both cleanup sweeps, `buckets.multipleAudioFormats`.
-- **(C) `buckets.untranscoded` is kept and renamed `wrongFormatAudio`** — it is the orphan
- sweep's list; its name presupposed a transcode. Old snapshots keep a stray key and read
- `[]` until their next regen; **no regen tooling** (precedent `unified-ops-step-1.md:52-58`:
- no snapshot schema version, per-field optionality; an offline writer would race
- `snapshotScheduler`). Production has 0 in the bucket, so nothing rendered moves.
-- **(D) `EXTERNAL_BAND_IDS` stays `["download","transcription"]` permanently**
- (`buildBands.ts:163`; `buildBands.test.ts:243-246,322` keep pinning two).
-- **(E) Stale `failed-transcodings` files stay on disk** (both empty); nothing reads them
- after this.
-- **Cadence:** Fable reviews; one Opus agent implements. Stage by explicit path; `git rm`;
- e2e detached, once, at the end; never boot the editor against `transcripts/`.
-
-**What the census found — every place the obvious move cannot be made literally, and what
-instead:**
-
-1. **The worker tag is on `/workers`, not `/settings`.** `workers/page.tsx:21-28` builds
- `knownTags` from `operationCatalog().filter(o => o.scope === "video")`. The "transcode"
- tag disappears with the catalog entry, no edit needed — FACTS.md:2240 names the wrong
- page; the docs commit corrects it.
-2. **`transcode-audio` is not a registered job kind.** Only `videoActions.ts:84` (the kept
- per-file action) and `stageStatus.ts:119` (the stage map). Drop the map entry with the
- stage; the job still shows in `RunningJobsList` and marks no stage as running — right,
- there is no stage.
-3. **`bulkVideoActions.ts:215-218` is Clear-failed-markers, not bulk delete.** The prune of
- `failedTranscodingsFile` goes, `succeeded` becomes `trxn.pruned`, comment `:202-204` says
- "the failed-transcriptions file".
-4. **Editor before common, or tsc breaks mid-series.** Five editor files import the doomed
- common modules. Commit 2 removes every editor reader; commit 3 deletes the common side.
- Each commit passes all six tscs.
-5. **The bucket rename crosses the package boundary and must be one commit** (commit 4:
- writer + `normalizeBuckets` + the two readers). The e2e fixtures spelling
- `untranscoded: []` are untyped JSON literals — **left alone**: `normalizeBuckets` picks
- only keys it knows, exactly as production's stray key is ignored.
-6. **The catalog count is pinned at eight.** `pauseGates.test.ts:104` `ids.length === 8`,
- `:87-93` expects `transcode: null`; `pauseGates.ts:60` "all eight ids";
- `operations.test.ts:1222-1235` lists `"transcode"`. All go to seven.
-7. **`jobKinds.test.ts:97` uses `transcode-failures` as its label-less example** →
- `clear-failed-transcriptions` (replayable, no label, in neither `OLD_LABELS` nor
- `ADDED_KINDS`).
-8. **The "runner first" order in `pauseLaneFor` stays justified without naming transcode** —
- it is a property of the catalog's shape (an external entry sharing a runner's queue with
- no runner of its own must answer null). Same rewording for the four "external with no
- runner" comments (`operations.ts:1422-1427`, `operations.test.ts:1246-1251`,
- `operations/[id]/page.tsx:149-152`, `operations/lanes.ts:64-70`) and
- `OperationDetail.tsx:137-139` ("transcode today"); `NoConsoleView` stays as the
- fallthrough. This is what makes the `transcod` grep gate exact.
-9. **`GROUP_STAGES` stays a `Record` of arrays** (`sync: []` still needs it); `media:
- ["download"]`, paragraph rewritten around sync.
-10. **The page's stage-order filter has nothing left to filter.** `page.tsx:256-261` and
- `stageOrder.test.ts:28-39` both become the bare
- `...OPERATION_GROUP_ORDER.flatMap((g) => GROUP_STAGES[g])`; the "without transcode" test
- case (`:56-71`) goes.
-11. **`?stage=transcode` bookmarks already have a rule** — unknown `?stage=` lands on the
- overview at 200 (`channel-stage-selection.spec.ts:89`); the comment at `page.tsx:267-271`
- gains transcode as its real example.
-12. **`FlowStationId` is a key of four `Record`s** (`stationById`, `sidingsOf`,
- `reachableInto`, `GAP_LABEL`) — all four lose their `transcode` key with the union member.
-13. **The "Transcoded" dot was never the operation's fact** — `VideoPanel.tsx:233`
- `transcoded={transcodeSources.length === 0}` is true of any `audio.*` file, so a video in
- the channel's own format read "not transcoded". Nothing pins it. **Deleted** (`:233,535,
- 540,555`); the strip is Downloaded · Transcribed. The per-file rows (`:119-126,169,
- 202-205,304-318,763-821`) and `transcodeAudioAction` stay; `video-page.spec.ts:118-133,
- 398-440` pin exactly those.
-14. **`transcodeAudio` has TWO download-path callers** (`audioCheckedDownload.ts:768`,
- `downloadOneManaged.ts:224` `finalizeAppExtraction`) — both KEEP, both in the grep gate's
- allowed list.
-15. **`operation-settings.spec.ts:238-239`** (the transcode goto + assertion) is deleted;
- the `/operations/download` pair at `:240-241` keeps the same assertion on the same shape.
-16. **`bulk-actions.spec.ts:176-206` is trimmed, not deleted** — the failed-transcoding half
- goes, counts 2 → 1, the transcription half stays.
-17. **`channelFlow.ts:153` `config` is an unused input already** — out of scope; do not "fix"
- in passing.
-18. **No doc outside `plans/` describes the Transcode stage.** README/SETUP/install.md say
- ffmpeg does "audio transcode" — that is the download path and stays true.
-19. **The `test-transcribe` fixture's `audio.m4a` files stay** (`audioFormat: "m4a"` — its
- `untranscoded` bucket was always empty; `video-page`/`whisper`/`bulk-actions` all use the
- files for kept features).
-20. **`bb380c6` is two things** — the FACTS section says which half went.
-
-**Hazards carried through every commit:**
-
-- **Another session commits into this checkout.** `git status` before every commit; explicit
- paths; never `git add -A`. The **`duplicates-page` worktree** edits `common/jobs/jobKinds.ts`
- (its +30 hunk at `:251-290` vs our deletions at `:348-371` — same file, auto-merge needs a
- human eye), adds `/duplicates` to `nav.ts` (main's `nav.test.ts` pins eleven; `/review` is
- the folded slot the IA doc reserved), and still carries files main deleted
- (`build/page.tsx` with its own `BUILD_KINDS`, `actionable/page.tsx`). Their merge; recorded
- so nobody is surprised.
-- **Playwright strict mode:** deletions only, no new locators. `"Select failed"` unchanged.
-- **`stageStatus.ts` keeps `config`** (the configure stage reads it); only the
- `operationApplies` call goes. **`whisperActions.ts` keeps** `AUDIO_FORMAT_VALUES`/
- `AudioFormat` and `clearFailedTranscriptions`; **`jobReplayRegistry.ts` keeps**
- `AudioFormat`.
-- **`grep` reads `common/controller/sweepRecency.ts` as binary** — identifier sweeps skip it;
- trust tsc.
-- **e2e detached once after commit 5; never against `transcripts/`.**
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/editor-transcode-removed.md`; commit alone:
-`plans: the transcode removal planned`.
-
-## Order: four code commits after the plan, then the docs
-
-1. **`editor: the slice-5 leftovers — the nav timer names live routes, the pool lists its
- eight kinds, the aliases tab always has a site`**
-2. **`channels: the transcode stage is gone`**
-3. **`transcode: the operation is deleted — it never fired in production`**
-4. **`snapshot: the untranscoded bucket is wrong-format audio`**
-5. **`plans: the transcode operation is removed, and the docs say so`**
-
-Gates after each of 1–4: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export homepage
-umtool mcp`; `pnpm -C common test`; `pnpm -C editor exec tsx --test "app/**/*.test.ts"`
-(**121 at `f3b187a` → 119 after commit 2**, unchanged after); `pnpm -C common exec tsx --test
-controller/noCorpusWalkInRenderPaths.test.ts`. e2e once after commit 5, detached.
-
----
-
-## Commit 1 — `editor: the slice-5 leftovers — the nav timer names live routes, the pool lists its eight kinds, the aliases tab always has a site`
-
-**`editor/scripts/measure-nav.mjs`**
-
-- `:38` comment →
- ```
- // Routes worth timing, with the segment name used to build a state tree. THE
- // ELEVEN SINGLE-SEGMENT PAGES IN THE SIDEBAR (editor/app/lib/nav.ts), and
- // only those: stateTree() below encodes ONE segment, so /sites/<id>/charts
- // and /operations/<id> cannot be listed — each would need the nested
- // [segment, {children: [param, …]}] form, a different tree per route. A
- // RETIRED ROUTE ANSWERS 307 (editor/next.config.ts redirects); with
- // redirect: "manual" that is a millisecond stub, not a page timing, and the
- // >= 400 check below let five of them pass silently for a while. A 3xx is
- // flagged now.
- ```
-- `:39-50` → the eleven: `["/", "__PAGE__"]`, `/channels`, `/review`, `/operations`,
- `/sites`, `/jobs`, `/workers`, `/cleanup`, `/saved-videos`, `/settings`, `/changelog`
- (each `["/x", "x"]`).
-- `:132` add `const moved = [doc, nav, refresh, pre].find((r) => r.status >= 300 && r.status < 400);`
- and extend `:144`'s warning ternary: `bad` first, else `moved ? \` ⚠️ ${moved.status}
- redirect — a stub, not a page timing\` : ""`. `APIS` (`:52-59`) unchanged (none redirected).
-
-**`editor/app/sites/page.tsx:29-41`** →
-```ts
-// Which live jobs the Pool section lists: the eight kinds the Pool's own
-// buttons enqueue (BuildButtons.tsx → sites/lib/buildAction.ts), and only
-// those. build-export and build-deploy are a site's Publish tab's, build-all
-// and build-deploy-all are the batch panel's above — each has its own console
-// and is not repeated here.
-const BUILD_KINDS = new Set([
- "build-index",
- "build-stats",
- "normalize-transcripts",
- "archive-transcripts",
- "archive-combined-transcripts",
- "normalize-live-chat",
- "archive-live-chat",
- "archive-combined-live-chat",
-]);
-```
-(Traced: `BuildButtons.tsx:12-20` imports exactly those eight actions; kinds at
-`buildAction.ts:44,59,164,179,194,208,223,238`; `:88,123,260,319` are the four excluded.)
-
-**`editor/app/sites/components/EditorAliasesClient.tsx`**: `:3-5` → "Authoring UI for search
-aliases. Two independent sections — the global dictionary and the site's overrides — each
-edits a list of concept rows and saves the whole list via a server action." `:82-83` →
-`siteConfig: AliasConfig; siteId: string;`. `:94-102` → the `<AliasSection … testid="site" />`
-unwrapped (delete `{siteId && siteConfig && (` and `)}`). Only renderer
-`sites/[siteId]/aliases/page.tsx:39-44` passes both non-null; `aliases.spec.ts` asserts
-presence only — unchanged.
-
----
-
-## Commit 2 — `channels: the transcode stage is gone`
-
-**`git rm editor/app/channels/[slug]/components/stages/TranscodeStage.tsx`** (244 lines; its
-labels "Transcode failures", "untranscoded list", "failed transcodings section" leave with it).
-
-**`editor/app/channels/[slug]/page.tsx`**: delete `:32` (`loadFailedTranscodings`), `:67`
-(`TranscodeStage`), `:74` (`operationApplies,`), `:202`, `:227`, `:237`, `:289-290`,
-`:378-387` (the `case "transcode"`), `:560-561`. `:253-261` → comment "`media`, `transcript`,
-`digest`, `speakers` each spread their stages; there is no per-channel filter — every stage in
-the Record applies to every channel." and `...OPERATION_GROUP_ORDER.flatMap((g) =>
-GROUP_STAGES[g]),`. `:267-271` → "…a saved link to a stage that no longer exists
-(`?stage=transcode`, retired 2026-08-30) should still open the channel." `:482` →
-`wrongFormatApplies={!!config!.audioFormat}` (`config!` — the block already spells
-`config!.keepLatest` at `:488`). `:476-481` (the `buckets.untranscoded` fold into
-`foreignAudioIds`) unchanged in this commit. `TRANSCRIPTION_QUEUE` (`:44`) stays (`:397`).
-
-**`…/lib/stageStatus.ts`**: `:9` delete `operationApplies,`; `:51` delete `| "transcode"`;
-`:74-78` →
-```
-// NOT 1:1 with the groups, and no honest derivation makes it so: `sync` owns
-// NO stage (below), and a group may own more than one — `media` did while the
-// transcode stage existed (retired 2026-08-30). So this is a Record of ARRAYS,
-// spread in OPERATION_GROUP_ORDER — which yields exactly today's order and
-// today's cardinality. It is a compile-time membership check, not a re-shaping
-// of the page.
-```
-`:85` → `media: ["download"],`; `:115-119` delete all five `"transcode…": "transcode"` map
-entries (incl. `transcode-audio`); `:162`, `:190`, `:214`, `:220-221` delete; `:325-362`
-delete the transcode block; `:630` delete `transcode,`.
-
-**`…/lib/channelFlow.ts`**: `:66` delete the union member; `:106-108` → "The pipelines that
-run at this station, in dependency order. Empty for playlist, which is not an operation the
-registry dispatches or counts — it keeps the plain coverage meter."; `:155-156`, `:230-231`
-delete; `:318-334` (station), `:387` (spread), `:435-437` (siding), `:508` (gap), `:517`
-(label) delete.
-
-**`…/components/flow/FlowStation.tsx:100-101`** → "The one station that is not a registry
-operation — playlist — keeps the plain meter."
-**`…/components/flow/AttentionStrip.tsx`**: `:37-38`, `:63-70` delete.
-**`…/videos/page.tsx`**: `:7`, `:14`, `:134-135`, `:143-144` delete.
-**`…/lib/videoRowsServer.ts`**: `:27-28`, `:49`, `:73`, `:76`, `:87`, `:105`, `:111` delete;
-`:91` → `if (isFailedT) status = "failed";`. **Keep `:39`** (the set feeds `:113`).
-**`…/lib/videoRows.ts`**: `:16-17`, `:30` delete; `:98-99` → `r.failedTranscription`; `:102`
-→ `return r.failedTranscription;`.
-**`…/components/VideoListPane.tsx`**: `:253` → "— no queued job."; `:279` →
-`if (r.failedTranscription) next.add(r.id);`; `:726-731` delete `tcColor`; `:740` →
-`row.failedTranscription ? "bg-destructive" : null`; `:756` delete the span.
-**`…/bulkVideoActions.ts`**: `:11-14` delete; `:113`/`:138` "never triggers a transcode" →
-"never queues a job"; `:202-204` → "Clearing failure markers is a set operation over the
-failed-transcriptions file, so `succeeded` reports how many ids were actually removed (some
-selected ids may not have been marked failed)."; `:215-218` delete; `:224` →
-`succeeded: trxn.pruned,`.
-**`…/whisperActions.ts`**: `:19-25` delete (keep `:26` `clearFailedTranscriptions`);
-`:239-346` delete the four actions.
-**`editor/app/jobs/jobReplayRegistry.ts`**: `:28`, `:30`, `:32-33`, `:216-235` delete.
-**`editor/app/cleanup/lib/loadCleanup.ts`**: `:10` delete; `:26` → "// Housekeeping list size
-(failed transcriptions)."; `:28`, `:90`, `:101` delete; `:137-143` → "// The brief already
-carries the snapshot; only the failed-transcriptions list is still a per-channel read." +
-`const failedT = await loadFailedTranscriptions(paths, channel.slug); return rowOf(channel,
-channel.snapshot, failedT.length);`; `:218` → "also reads the failed-transcriptions list per
-channel".
-**`editor/app/cleanup/components/ChannelCleanupCard.tsx`**: `:14`, `:27`, `:39` delete;
-`:45` → `const noHousekeeping = failedTranscriptions === 0;`; `:152-160` delete.
-**`editor/app/cleanup/page.tsx:142`** delete.
-**`…/components/stages/CleanupStage.tsx`**: `:28` → `// Both audio-format sweeps compare
-against the channel's audioFormat; a channel with none has no "wrong" format and neither
-section applies.` + `wrongFormatApplies: boolean;`; `:54` rename; `:136`, `:151` →
-`{wrongFormatApplies && (`.
-**`…/components/SocialChannelPanel.tsx:222`** → "no per-post download or transcription stage."
-**`…/videos/[id]/components/VideoPanel.tsx`**: `:233`, `:535`, `:540`, `:555` delete (finding
-13); the per-file rows untouched.
-**`editor/app/components/channelWork/sections.test.ts:79`** → "(diarization, attribution-*)".
-**`editor/app/operations/[id]/page.tsx:224-227`** → "diarization and both attribution
-operations get no table at all".
-
-**Unit tests:** `channelFlow.test.ts` — `:46,48,52,58,64-65` and `:286-309` delete
-(13 → 12). `stageOrder.test.ts` — `:6-9` the bare expression; `:17` trim; `:28-39` →
-`function stageOrder(): StageId[]` with the bare spread; `:41-54` → title "the derived stage
-order is the list that shipped", nine entries, no `"transcode"`; `:56-71` delete (3 → 2).
-Editor total **121 → 119**.
-
-**Specs:** `whisper.spec.ts:227-260` delete (its helpers all still used 8–14× elsewhere in
-the file). `bulk-actions.spec.ts`: `:128-129` delete; `:176` title → "Clear failed markers
-prunes the failure file and clears the glyph"; `:180` → "// vidA failed transcription.";
-`:182` delete; `:187` → "// One failure glyph is shown before clearing."; `:188` →
-`toHaveCount(1)`; `:191` → `"1 selected"`; `:197` comment singular; `:203-205` delete
-(`readFile` still used at `:200`). `helpers.ts:340` delete `| "transcode"` from
-`ChannelStage`.
-
----
-
-## Commit 3 — `transcode: the operation is deleted — it never fired in production`
-
-**`git rm`** `common/controller/transcodeFailures.ts`, `transcodeUntranscoded.ts`,
-`failedTranscodings.ts`, `removeFailedTranscodings.ts` (no other importer remains after
-commit 2 — verified).
-
-**`common/lib/mediaFiles.ts`**: `:145-156` → one paragraph:
-```
-// ---------------------------------------------------------------------------
-// Which audio file to use when a video dir holds more than one: mp3 first,
-// because that is what this corpus overwhelmingly holds (900 audio.mp3 against
-// 12 audio.mp4 and 1 audio.aac) and what the transcribe and diarize paths were
-// tuned against. A second ordering — the format most likely to be the ORIGINAL
-// download, for picking a transcode SOURCE — left with the transcode operation
-// on 2026-08-30; pickPreferredAudio keeps its `preference` parameter and every
-// caller (transcribeOne, diarizeOne, operations.ts) takes the default.
-```
-`:163-170` (`AUDIO_TRANSCODE_SOURCE_PREFERENCE`) delete.
-**`common/lib/mediaFiles.test.ts`**: `:5`, `:179-187`, `:198-203` delete (19 → 17).
-**`common/jobs/jobKinds.ts:348-371`** delete the four entries.
-**`common/jobs/jobKinds.test.ts:97`** →
-`assert.equal(jobKindLabel("clear-failed-transcriptions"), "clear-failed-transcriptions");`.
-**`common/lib/operations.ts`**: `:77` delete the `ChannelConfig` import; `:1364-1384` delete
-the entry; `:1422-1427` → "The auto-queue runner that dispatches this, when one does.
-`dispatch` alone cannot answer it: download and transcription are `external` WITH a runner,
-and an external operation with none is a legal entry (transcode was one, 2026-08-26 → 08-30).
-A console that guessed from the id would hand such an entry the transcription runner's
-controls — a live Start button over the wrong lane. Absent for every backfill kind: those are
-dispatched by the sweep and the arbiter."; `:1433-1440` (`appliesTo` field + comment) delete;
-`:1441-1443` → "// See Operation.settingsBlock. Absent for every external operation but sync:
-nothing in settings.json configures a download as an operation."; `:1471-1478`
-(`operationApplies`) delete.
-**`common/lib/operations.test.ts`**: `:12`, `:1227`, `:1268-1290` delete (65 → 64);
-`:1246-1251` reword per finding 8; `:1347-1348` → "// Sync is its own group, not `media`:
-that group is download's /channels column group, and sync draws no column."
-**`common/lib/pauseGates.ts`**: `:55-58` →
-```
-// `runner` IS ASKED FIRST, and that order is load-bearing. An external
-// operation may share a runner's queue and have no runner of its own (transcode
-// did, on TRANSCRIPTION_QUEUE, until 2026-08-30); a queue-key map alone would
-// hand it that runner's pause — a live Pause button over a lane that would
-// never dispatch it. Such an entry's own answer is null.
-```
-`:60` → "all seven ids".
-**`common/lib/pauseGates.test.ts`**: `:87` → "pauseLaneFor answers for every catalog id";
-`:90-93` delete; `:104` → `7`.
-**`common/controller/videoOperations.ts:16-17`** → "Download and transcription already have a
-per-video surface".
-**`editor/app/operations/[id]/page.tsx:149-152`**, **`OperationDetail.tsx:137-139`**,
-**`operations/lanes.ts:64-70`** → reword per finding 8 (the agent's exact texts; `NoConsoleView`
-stays).
-
-**Spec:** `operation-settings.spec.ts:238-239` delete (the `/operations/download` pair stays).
-`/operations/transcode` now 404s through the catalog-as-route-table (`[id]/page.tsx:143-147`);
-the `transcode` tag on `/workers` is gone with the entry.
-
----
-
-## Commit 4 — `snapshot: the untranscoded bucket is wrong-format audio`
-
-**`common/controller/channelSnapshot.ts`**: `:110` →
-```ts
- // Has audio on disk, none of it in the channel's audioFormat — the orphan
- // half of what "Remove wrong-format audio" deletes (the other half is
- // multipleAudioFormats: target present plus extras). Was `untranscoded`
- // until 2026-08-30, when the transcode operation that read it as a to-do
- // list was removed; the population itself is still the sweep's. Old
- // snapshots keep a stray `untranscoded` key and read this one as [] until
- // their next regen — no schema version, per-field optionality, as always.
- wrongFormatAudio: string[];
-```
-`:765` accumulator, `:923` push, `:1145` write → renamed; `:873-875` comment → "// audio —
-short-circuit so it doesn't land in wrongFormatAudio / downloadedNoTranscript (which would
-transcribe corrupt audio, or offer the kept file to the wrong-format sweep) or the
-wrong-format cleanup estimate (which would delete it)." The predicate (`:551-553`, `:918-922`)
-unchanged.
-**`…/lib/stageStatus.ts:25`** → `wrongFormatAudio: raw?.wrongFormatAudio ?? [],`.
-**`…/page.tsx:478`** → `...buckets.wrongFormatAudio,`.
-**`…/lib/videoRowsServer.ts`**: `:39` → `const wrongFormatAudio = new
-Set(buckets.wrongFormatAudio);`; `:113` → `wrongFormatAudio.has(id) ||
-multipleAudioFormats.has(id),`.
-No regen, no tooling (decided C).
-
----
-
-## Locator table — the specs
-
-| locator | before | after | spec |
-|---|---|---|---|
-| `channelStage("test-transcribe","transcode")`, `/^Transcode failures → mp3$/`, `"Transcode failures output"` | the stage | **gone** (test deleted; `ChannelStage` loses the member) | `whisper:227-260`, `helpers:340` |
-| `getByTitle("failure recorded")` count | 2 | **1** | `bulk-actions:188` |
-| `"2 selected"` | after Select failed | **`"1 selected"`** | `bulk-actions:191` |
-| `readFile(failedTranscodingsFile)` | asserted pruned | **gone** | `bulk-actions:203-205` |
-| `goto("/operations/transcode")` + no settings form | 200, no form | **gone** (404); `/operations/download` pair stays | `operation-settings:238-239` |
-| `/^Transcode audio\.m4a → mp3$/`, `"Transcode audio.m4a to mp3 output"`, `"Transcode stage summary"` | per-file rows | **unchanged** | `video-page:118-133,398-440` |
-| `getByLabel("pipeline status")` | three dots | unchanged (two dots) | `channel-embedded-video:25-55` |
-| unknown `?stage=` → overview, 200 | pinned | unchanged; `?stage=transcode` is now a real instance | `channel-stage-selection:89` |
-| `untranscoded: []` in seeded snapshot JSON | | **left** (stray key, ignored) | `auto-queue:80,133`, `channel-work:97`, `cleanup-actionable:30`, `disk-space:106`, `widget:42` |
-| `"Select failed"`, `"Clear failed markers"`, wrong-format labels | | unchanged | `bulk-actions`, `ChannelCleanupCard` |
-
-## Verification
-
-1. After each of commits 1–4: the six tscs; `pnpm -C common test` (operations.test 65 → 64,
- mediaFiles.test 19 → 17, pauseGates.test 6, jobKinds.test 4 — after commit 3); editor
- units **121 → 119** (commit 2); the render-path guard test.
-2. Grep gates after commit 4, over `editor/app common editor/scripts` (`*.ts *.tsx *.mjs`,
- excluding `node_modules`):
- - `transcod` (case-insensitive) → **only** the KEEP list: `common/controller/transcode.ts`;
- `common/ytdlp/audioCheckedDownload.ts`; `common/ytdlp/downloadOneManaged.ts`;
- `ffmpegStreamClassify.ts`/`ffmpegStreamProbe.ts`/`progressParsers.ts:180`/
- `scanCorruptMedia.ts:11,77`/`review/actions.ts:138`/`RunMediaScanButton.tsx:17` (probe
- prose); `channelConfig.ts:36`; `mediaFiles.ts` (download-path prose + rewritten
- `:145-152`); `mediaFiles.test.ts` (scratch-file prose); `pauseGates.ts` (rewritten);
- `operations.ts` (rewritten); `OperationDetail.tsx` (rewritten); `operations/lanes.ts`
- (rewritten); `VideoPanel.tsx` (per-file rows); `videoActions.ts`;
- `videos/[id]/page.tsx:235`; `channelSnapshot.ts` (the new `:110` comment);
- `stageStatus.ts:74-78`; `channels/[slug]/page.tsx:270`. Anything else is a miss.
- - `untranscoded` → **0** under `editor/app common` (the five e2e fixtures remain,
- deliberate).
- - `failedTranscod|FailedTranscod|failed-transcodings` → **0** under `editor/app common`
- and `editor/e2e` (the spec's const goes too).
- - `operationApplies|appliesTo` → **0**.
- - `TranscodeStage|transcodeApplies|transcodeDefaultQueueKey|AUDIO_TRANSCODE_SOURCE_PREFERENCE|runTranscodeFailures|runTranscodeUntranscoded|removeFailedTranscodings|clearFailedTranscodings|loadFailedTranscodings|pruneFailedTranscodings` → **0**.
- - `"transcode"` (quoted id) → **0** under `editor/app common`.
- - `wrongFormatAudio` → `channelSnapshot.ts` (4), `stageStatus.ts` (1), `page.tsx` (1),
- `videoRowsServer.ts` (3); `wrongFormatApplies` → `CleanupStage.tsx` (4), `page.tsx` (1).
- - `EXTERNAL_BAND_IDS = \["download", "transcription"\]` → exactly one hit
- (`buildBands.ts:163`); `buildBands.test.ts` unchanged.
- - `ids.length, 7` → `pauseGates.test.ts`; `length, 8` → 0 in `common/lib`.
- - `BUILD_KINDS` set → 8 entries; `WRONG IN` → 0; `siteId: string \| null` → 0 in
- `EditorAliasesClient.tsx`; `/actionable|/auto-queue|"/build"|"/charts"|"/aliases"` → 0 in
- `measure-nav.mjs`.
-3. e2e once after commit 5, detached (`cd editor && setsid nohup sh -c 'pnpm e2e -- <specs>;
- echo exit=$?' > $CLAUDE_JOB_DIR/tmp/e2e.log 2>&1 < /dev/null & disown`), exactly:
- `whisper.spec.ts bulk-actions.spec.ts operation-settings.spec.ts video-page.spec.ts
- channel-stage-selection.spec.ts channel-line.spec.ts channel-embedded-video.spec.ts
- cleanup-page.spec.ts cleanup-holds.spec.ts disk-space.spec.ts cleanup-actionable.spec.ts
- channel-work.spec.ts auto-queue.spec.ts widget.spec.ts jobs.spec.ts workers.spec.ts
- aliases.spec.ts build.spec.ts navigation.spec.ts perf-budget.spec.ts` (all names verified
- to exist). Port fallback `PORT=3111 EXPORT_PORT=3110 OLLAMA_STUB_PORT=11535`; never kill
- anything.
-4. **No editor boot against `transcripts/`; nothing written under it.** The census is `jq`
- only.
-5. Manual (optional, `PORT=3021 pnpm dev:test`): `/channels/test-transcribe` has no Transcode
- stage; `?stage=transcode` opens the overview; `?stage=cleanup` shows both audio-format
- sections (fixture has `audioFormat`); a channel with none shows neither;
- `/channels/test-transcribe/videos/vidA` shows Downloaded · Transcribed and the "Transcode
- audio.m4a → mp3" row; `/operations/transcode` is 404; `/workers` offers no `transcode`
- tag; `/cleanup` cards have no "Clear failed transcodings"; `node scripts/measure-nav.mjs
- --base http://localhost:3021` lists eleven routes, none flagged.
-
-## Commit 5 — `plans: the transcode operation is removed, and the docs say so`
-
-- **`editor/CHANGELOG.md` `[Unreleased]` first bullet** (house voice): **The transcode
- operation is gone — it never fired.** A channel page had a *Transcode* stage,
- `/operations/transcode` had a "no console here" panel, `/cleanup` offered "Clear failed
- transcodings", and the video list drew a third status dot — all for a re-encode step built
- against two failures that never happened in production: in 68 channels, no snapshot has
- ever listed a video as missing its target format, no `failed-transcodings` file has ever
- held an id, and only four channels even met the stage's gate. Transcription never needed it
- — a video whose audio is in another format transcribes from that file. What stayed is
- everything that was never the operation's: the download path still re-encodes what it
- extracts itself, the video page still offers **Transcode audio.\<ext\> → \<fmt\>** per
- file, and both audio-format sweeps on the Cleanup stage and `/cleanup` are unchanged
- (gated on the channel having an `audioFormat`, which is what they compare against). The
- snapshot bucket behind the sweep is `wrongFormatAudio` now — its operator-facing name —
- and old reports keep their stray key until their next refresh. A `?stage=transcode`
- bookmark opens the channel overview. **Nothing on disk changes.** Also: the Pool's
- running-jobs list names the eight kinds its buttons enqueue, and the site's Search aliases
- tab no longer carries a "no site selected" branch that could not run.
-- **`plans/editor-operations-ia.md:60`** → the Transcode row becomes "**REMOVED 2026-08-30 —
- never fired in production; the band question is closed**" with the census one-liner, what
- was deleted, what stayed, `EXTERNAL_BAND_IDS` is two permanently, plan + FACTS pointers
- (the agent's exact row text). In "Slice 5, as shipped": `:767` (finding 14, `BUILD_KINDS`)
- and `:776` (what stayed: `BUILD_KINDS`' mismatch, `EditorAliasesClient`'s null branch) each
- gain "— fixed 2026-08-30, first commit of the transcode removal".
-- **`plans/STATE.md`**: `:6` "Last updated" prepend (previous demoted to "Previously:");
- after `:326` item `14. ~~**The transcode operation**~~ — **REMOVED 2026-08-30**, `<sha1>` →
- `<sha4>`. Plan: [`editor-transcode-removed.md`]; census in FACTS "Verified 2026-08-30 —
- transcode: what it was, what stayed". The band question is closed by deletion;
- `EXTERNAL_BAND_IDS` is two for good.`; `:328-331` → "**Recommended next (editor IA).** The
- UI slices are done and the transcode band is no longer a candidate. What is left is
- **Phase 6** and **slice 9**, which is gated on the sweep running in production.";
- `:459-463` gains "**Removed 2026-08-30** — see item 14 above."
-- **`plans/FACTS.md`**: append `## Verified 2026-08-30 — transcode: what it was, what
- stayed`: the census table verbatim; the two building commits and which half of `bb380c6`
- stayed; the `resolveAudioFile` fallback; the two `transcodeAudio` callers and
- `persistencePlan.ts:92-94`; `transcode-audio` never registered; the bucket rename and why
- no regen; the "runner first" order surviving without its example; catalog 8 → 7 and where
- pinned; the worker tag being `/workers` not `/settings` (correcting `:2240`); the
- `duplicates-page` merge hazard. At `:2229` prepend "**SUPERSEDED 2026-08-30 — removed, see
- the section at the end of this file.**"
-- Memory: left to the reviewer.
-
-## Out of scope
-
-`channelFlow.ts:153`'s unused `config` input. Regenerating snapshots or deleting the two
-empty `failed-transcodings` files. Renaming the five e2e fixtures' `untranscoded: []`. Any
-change to `EXTERNAL_BAND_IDS`, `buildBands`, or the pipelines rail. The download path
-(`audioCheckedDownload`, `downloadOneManaged`, `ExtractionMode` docs). The per-file transcode
-rows and `transcodeAudioAction`. The `duplicates-page` worktree. `measure-nav.mjs` measuring
-dynamic routes. The `bulk-actions.spec.ts:133,169,210,243` prose comments.
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`): write the plan to
-`plans/editor-transcode-removed.md`, commit it alone, then spawn one `general-purpose` agent,
-`model: "opus"`, with: the plan path; the shell caveats (quote every glob and every
-`[slug]`/`[siteId]`/`[id]` path, `--include='*.ts'`, no bare `====` echo; POSIX loops inside
-`sh -c`; `git commit -F <file under $CLAUDE_JOB_DIR/tmp>`; stage by explicit path, never
-`git add -A`; `git rm` for the five deletions); never boot against `transcripts/`; e2e
-detached (memory `e2e-run-detached`); the two trailer lines; the report contract (shas + one
-line each; exact gate outputs incl. unit-test counts before/after each commit — expect
-121 → 119 at commit 2, common 65/19 → 64/17 at commit 3; every grep gate's actual file list
-against the expected one; e2e per spec with retries; every divergence and why; anything
-undone). Fable reviews on return (`git log --oneline f3b187a..`; the `page.tsx` hunks — the
-spread, the `:270` comment, `wrongFormatApplies`; `stageStatus.ts` — the `GROUP_STAGES`
-paragraph, the map, the return; `channelFlow.ts`'s four Records; `videoRowsServer.ts:39,113`;
-`bulkClearFailedMarkersAction`; the import lines; `CleanupStage` gating; the `VideoPanel`
-strip; `operations.ts` — the entry, `appliesTo`, the rewritten comments, the `ChannelConfig`
-import; `pauseGates.ts:55-60` + test; `mediaFiles.ts:145-152`; `channelSnapshot.ts:110` and
-the four renames; the three specs and `helpers.ts`; `measure-nav.mjs`; `BUILD_KINDS`;
-`EditorAliasesClient`; re-runs grep gates + `pnpm -C common test` + editor units, not e2e),
-sends fixes via SendMessage, and reports.
diff --git a/plans/export-header-first-search.md b/plans/export-header-first-search.md
@@ -1,416 +0,0 @@
-# Release 14 — the social icons within reach, and a clear screen until the first Search
-
-Written 2026-09-28 against `main` `6f03805b`. Self-contained for a fresh session. Rules:
-`plans/tools/implementer-rules.md` (one Opus implementer per slice in a worktree, one read-only
-Opus review, the parent merges; no cut, no deploy and no restart inside a slice). Record file:
-`plans/release-14.md` (NEW, created by the first slice to start, the shape of `release-12.md`).
-Facts below were gathered by two read-only passes on 2026-09-28 and carry `file:line` anchors;
-anything marked UNVERIFIED is a first step for the implementer, not a fact.
-
-**Why 14:** release 12 (the source mirror) is merged and release 13 (`release-13.md`) is a parallel
-session's plan in flight, with its own slice table, merge order and integration gate. These slices
-are not added to it. No `r13/*` branch touches any file this plan owns (checked: `git diff --stat
-main...<branch>` is empty for the search and header components on all five).
-
-## The operator's words
-
-- 2026-09-25: "What if on the export we didn't load all search items until the user hits search,
- preventing the possibility of an unexpected system overload on re-visit" — shipped in part as
- release 8 slice E (`00fb567b`): a query restored from localStorage is held, not run.
-- 2026-09-28: "the export feature … where the search doesn't fire / show results until the first
- time hitting search after load", then: "I was expecting a clear screen (easy to see the footer)
- when it's actually the default state of viewing an index of all videos like when you hit search
- with no items."
-- 2026-09-28: "I want the social icons (particularly gumroad) to be more accessible, I'm thinking
- we move changelog link to footer, theme and dark/light behind a single options modal button, and
- instead of sites dropdown just link to archilyzer home which lists official instances."
-- 2026-09-28: a link the operator adds is an entry in `settings.json` `socialLinks`, not code; no
- vendor file goes into the repository, not even as a test fixture.
-- 2026-09-28: the homepage's social links more visible; a change to the social-link schema is
- allowed where it has a reason (built as slice HP, below).
-- 2026-09-28, on the homepage (slice HP): the Changelog link moves to the footer; Base and Accent
- move behind a single options button with a gear icon that opens a modal; the gear sits in the
- social icons' rhythm, and the narrow header carries the icons and the gear in its bar; on
- Official Instances each site's name uses the bold-lead effect of the sites' own headings, with a
- slight tint or underline in the site's accent.
-- 2026-09-28, on the homepage chart: light mode has dark lines and dark mode has light lines.
-- 2026-09-28, on the homepage: on very small screens the header keeps its mark and drops the word;
- the social icons scroll only when they still cannot fit.
-- 2026-09-28: the options menu is dropped for now in favour of a three-way toggle (slice HP on the
- homepage; slice H2 in the export). A later slice drops the Sepia base in every app and removes
- the accent picker from the export and editor headers (slice T1, below).
-- 2026-09-28, on the charts: the chart follows standard practice for light and dark grounds; the
- foreground-coloured separator lines are withdrawn (a 2 px gap in the surface's colour).
-- 2026-09-28 (T1): Sepia is dropped in every app, the editor included; a reader who chose Sepia
- gets Light; readers no longer pick an accent — each site shows its own, and stored accent choices
- are ignored.
-- 2026-09-28 (H1/H2): every site's header and the hub's carry the social row with the cycling
- toggle as the last item of the same group, the homepage's; the Sites dropdown becomes a text
- link to the Archilyzer home's Official Instances (not on the hub); the header's Hub link goes;
- Changelog joins the footer after Use with AI; narrow widths behave as the homepage's; the
- slide-out menu keeps the nav; the editor's header keeps the toggle, with no accent picker.
-- 2026-09-28 (after the branch's review): on narrow screens a site's header keeps the site's NAME
- and shows only the link(s) marked for the header; the other social links are in the footer.
- `featured` now means "keep in the header on small screens" (below 520 px only those; from
- 520 px every link up to four, those kept first). Built on `r14/two-grounds-headers`.
-- 2026-09-29 (after the re-review): below the switch the header bar's two gaps go from 12 to 8 px;
- type, the mark–name gap and the reserved width's margin stay as they are. The switch is written
- in rem (32.5rem), so it moves with the reader's text size, and the wordmark's reserved width is a
- minimum. A marked link keeps its configured place in the wide row (as built).
-- Standing: **no copy** beside any social link: icons with accessible names only.
-
-## Decisions and assumptions
-
-Decided by the operator's words: the four header moves; the clear screen on load.
-
-ASSUMED by the planner (2026-09-28) — each is one line to reverse, and the operator has been told:
-
-| # | Question | Assumed |
-|---|---|---|
-| A1 | A link that carries a query (`qt=`, legacy `q=`) | Still runs on load and shows its results — "a shared link is the visitor asking" (release 8's rule, kept). |
-| A2 | Leaving the search page and coming back within one visit | The listing is still there: the gate is once per page life, not once per mount. |
-| A3 | Which pages get the clear screen | The single-site search page. The hub only if its home renders the same results component (S1 step 0). |
-| A4 | A per-site switch | None. Every export site behaves the same. |
-| A5 | The header's **Hub** link | Dropped with the Sites dropdown; the link to the Archilyzer home covers it. `hubUrl` still parses. |
-| A6 | The footer's social row | Stays, as well as the header's — nothing disappears for a reader who looks there. |
-| A7 | Phones | The icons are visible in the header at every width, not inside the slide-out menu. |
-| A8 | The options modal | None: ruled 2026-09-28, a cycling toggle instead (H2); the accent picker is removed in T1. |
-| A9 | The homepage app's own header | Carries the social row and the theme toggle since slice HP (built), as well as the footer's Elsewhere row; H3 adds only the anchor. |
-| A10 | Deferring the summaries fetch until the first Search | NOT in S1. Measured and written up as S2, a candidate, because `/ask` reads the same data. |
-
-## Dependency graph
-
-```
-HP (homepage social row, toggle, cards + schema, BUILT, merged)
- ──► T1 ──► H1 (with H3 folded in) ──► H2 BUILT on r14/two-grounds-headers
-S1 (clear screen) ── independent of H*; touches no header file
-S2 (defer summaries) ── after S1, only on the operator's word
-```
-
-As built (2026-09-28): T1, H1 and H2 are one branch, `r14/two-grounds-headers`, off `main`
-`c6b8fc70`, in that order, after the final review's Lows and the chart's gap; H3 is folded into
-H1 (the homepage's anchor ships with the link to it). The record is `release-14.md`, "Branch
-`r14/two-grounds-headers`".
-
-As planned: H1 then H2 stacked on one branch (both rewrite `Header.tsx` and `MobileMenu.tsx`),
-branched after HP merges, with H3 and S1 on their own branches, T1 after HP and before the
-production deploy. As built: the one branch above; S1 is next, on its own.
-
-## Verified facts the implementer must not re-derive
-
-**The header** (`export/app/components/Header.tsx`):
-- Sticky, `min-h-14` (56 px), one breakpoint at `md` (768 px) (`:68-72`;
- `plans/export-responsive-redesign.md:55-62`).
-- Wide: brand (`:73-80`), nav `hidden md:flex` from `navLinks` (`:50-56`, `:82-92`), then the right
- cluster `hidden md:flex` (`:94-114`): `SiblingSwitcher` (`:96`), Hub backlink (`:97-106`, shown
- when `isSite && resolvedHub !== site.siteUrl`, `:35-40`), Changelog (`:107-112`), `ThemeMenu`
- (`:113`); then, at EVERY width, `ThemeToggle` (`:117`) and the `MobileMenu` trigger (`:118`).
-- `MobileMenu.tsx` is a Radix `Sheet` from the right carrying nav + Offline + Changelog
- (`menuLinks`, `Header.tsx:61-65`), the Hub backlink (`MobileMenu.tsx:83-92`), the Sites groups,
- and Base/Accent as native radiogroups (`:124-147`) — it deliberately does not nest `ThemeMenu`'s
- dropdown ("a focus-trap fight", `:30-35`).
-- The Sites dropdown is **related sites, not official instances**: `SiblingSwitcher.tsx:21-62` over
- `resolveRelatedSites(site, listSites())` (`common/lib/site.ts:146,203`). The footer renders the
- same groups in `<nav aria-label="Related sites">` (`Footer.tsx:116-148`), so removing the
- dropdown loses nothing and orphans no config.
-- Theme: `ThemeMenu.tsx:28-86` — trigger `aria-label="Choose theme"` (`:34`), `menuitemradio`
- items, two groups: Base (System/Light/Sepia/Dark, `themeConfig.ts:49-54`) and Accent (seven named
- + the site's own, `siteSchema.ts:116`). `ThemeToggle.tsx:20-39` cycles Base only,
- `aria-label="Switch to {next}"`. Keys `ytdlp-tb:base`, `ytdlp-tb:accent`; DOM `data-base`,
- `.dark`, `data-accent` (`ThemeProvider.tsx:100-108`).
-- The no-flash script (`ThemeScript.tsx`, `themeConfig.ts:197-228`) and `ThemeProvider` are
- untouched by where the controls render: every control reads `useTheme()`.
-- A full Radix dialog wrapper exists and has **no importer**: `common/components/ui/dialog.tsx`.
- `radix-ui ^1.6.0` is already a dependency of `common`.
-- Changelog route: `export/app/changelog/page.tsx:15-20`. Linked from the header twice (wide
- cluster and `menuLinks`), from nowhere else.
-
-**The footer** (`export/app/components/Footer.tsx`): row 1 (`:32-75`) eyebrow links Downloads /
-Offline / Use with AI (`:66-74`) — where Changelog goes; row 2 (`:76-114`) credit + social `<ul>`
-(`:97-113`). Social links come from `resolveSocialLinks(site, getSettings())` (`:22`), inlined SVG
-strings sized by `sizeSocialSvg` (`:108`).
-
-**Accessibility, measured in code:** social icons are `w-5 h-5` (20 px) with no padding on the
-link (`Footer.tsx:107`) — under WCAG 2.5.8's 24 px minimum; the links have no focus ring of their
-own; header icon buttons are 32 px (`ThemeMenu.tsx:37`, `ThemeToggle.tsx:31`) and 36 px (the menu
-trigger, `ui/button.tsx:28`).
-
-**The homepage:** Official Instances is `homepage/app/page.tsx:112-122`, a `<section>` with no
-`id` (`:114`), rendered only when `sites.length > 0`. `PROJECT_URL` is `common/lib/project.ts:31`.
-
-**The results area:**
-- `export/app/(workspace)/SiteWorkspace.tsx:22-57` mounts the providers, the search bar and
- `WorkspaceView` once, above both `/` and `/ask`. `WorkspaceView.tsx:132` renders
- `<SearchResults/>`, latched once mounted (`:113-116`).
-- `common/components/SearchResults.tsx`: header text branches on `hasActiveQuery` (`:124-137`,
- "Matching videos (N)" / "All videos (N)"); view toggle (`:155-177`), Copy for AI (`:178-189`),
- selection toolbar (`:195-247`), chart view (`:249-273`), `browse-hint` (`:276-280`), zero states
- (`:281-292`), the virtualized list (`:293-305`) whenever `resultGroups.length > 0`.
-- `resultGroups` in browse mode lists every video passing the committed filters whenever
- `!hasActiveQuery` (`SearchSessionContext.tsx:890-902`) — nothing asks whether the visitor searched.
-- `ranThisPageLife` is a MODULE-level `let` (`SearchSessionContext.tsx:206`): set on a URL query at
- hydrate (`:1277`), in `commitSearch` unconditionally — an EMPTY commit included (`:1393`) — and
- in `applySnapshot` (`:1457`). Read once (`:1266`). It survives client-side navigation and resets
- on reload. It is not reactive.
-- `searchExecuted` is dead: the getter is discarded (`:463-471`), nothing reads it.
-- `commitSearch` (`:1390-1426`) is the one choke point for Enter and the Search button
- (`SearchBar.tsx:82-96,118-122`).
-- The footer is a sibling of `<main>` in a column (`export/app/layout.tsx:123-138`): the list's
- height is what pushes it off screen.
-- The listing is client-rendered only (`SearchResults.tsx:1` `"use client"`; 0 rows in
- `out/index.html`); the sitemap has four URLs and no per-video pages. The clear screen costs
- nothing in static HTML or crawl.
-- The editor imports none of these components.
-- Specs that load `/` with no query and expect rows at once: `export/e2e/browse-all.spec.ts:32-44`,
- `workspace-shell.spec.ts:37-39,57,67`, `charts.spec.ts:64-67,96-99,112-115,140-143`. There is no
- shared "go home and wait for the list" helper. Specs that load with `qt=` or press Search first
- are unaffected.
-
-**Specs on the header controls:** `theme-accent.spec.ts` (`:32` the trigger by name, `:45-72`
-`menuitemradio`), `theme.spec.ts` (`:64-73` the toggle by `/switch to/i`), `responsive.spec.ts:85-97`
-(the Sheet's `radio` "Sepia"), `brand.spec.ts:81` (`onBase`). No spec opens the Sites dropdown; no
-spec names the Changelog link.
-
-UNVERIFIED: whether `HubHome` renders `SearchResults` (`export/app/(workspace)/page.tsx:12-14`
-branches to it and bypasses `SiteWorkspace`); Back-button scroll restoration into the virtualized
-list; the summaries payload per site (FACTS and the 2026-09-25 session give different figures).
-
-## Slice HP — the homepage shows the social links where they are seen (branch `homepage/social-visible`, BUILT)
-
-Added 2026-09-28 on the operator's ruling above; the record is `release-14.md`, "Slice HP, as
-shipped". What it built, so H1 does not re-derive it:
-
-1. **`common/components/SocialLinks.tsx`** — one row for any header or footer. Props: `links`,
- `placement: "header" | "footer"`, `className` (on the `<ul>`); nothing site-specific inside.
- The `<ul>` carries `data-social-links="<placement>"`. Each link is a 36 px key (`size-9`) around
- the 20 px glyph, 44 px under a coarse pointer (`pointer-coarse:size-11`, a built-in Tailwind v4
- variant), `text-muted-foreground` → `hover:text-foreground`, a `focus-visible:ring-2
- focus-visible:ring-ring` ring, and `not-forced-colors:focus-visible:outline-none`, so in forced
- colours the browser's own outline stays (a box-shadow is not drawn there). `aria-label` and
- `title` are the link's label; there is no text. Every icon passes the save-time check again
- before it is inlined (`safeSocialSvg`); one that fails shows the link's label as text.
-2. **The header bound, `headerSocialLinks`** (`common/lib/socialLinks.ts`, pure): at most FOUR —
- the links marked `featured` when any is marked, else all of them; of those, the last four. The
- `"header"` placement applies it; the footer shows every link.
-3. **Ids are scoped per copy** (`scopeSvgIds`): an id resolves to the first element carrying it,
- and a gradient defined inside a `display: none` copy of an icon does not paint in the visible
- copy. Any header that renders the row twice (one copy per breakpoint) needs this; the
- component does it, so H1 gets it for free.
-4. **Schema:** the icon's SVG is checked by an allowlist, tag by tag, on save AND at render
- (`common/lib/socialSvg.ts`; `safeSocialSvg` in `lib/socialLinks.ts` is the render half, and the
- export footer already goes through it). A refused save names the reason class. A root with a
- numeric `width`/`height` (unitless or px) and no `viewBox` gets `viewBox="0 0 W H"`.
- `SocialLink.featured?: boolean` (stored only when true), with a "Show in header" checkbox in the
- editor's `SocialLinksField`. `sizeSocialSvg` moved to `lib/socialLinks.ts` (re-exported from
- `settingsSchema`).
-5. **The theme control is one toggle**: `common/components/ThemeToggle.tsx` with `variant="bare"`
- (dressed as a social key: 36 px, 44 px under a coarse pointer, no border, the same hover square
- and ring, a 20 px glyph), cycling the base, named "Switch to {next}"; its default rendering is
- unchanged. The homepage offers no accent control, so `ThemeScript` and `ThemeProvider` take
- `pinAccent` there (the stored accent is neither read nor removed). An Options dialog was built
- first and deleted on the operator's ruling; `common/components/ThemeRadios.tsx` stays (the
- export's `MobileMenu` renders it).
-6. **The homepage's header:** one group — the social row, then the toggle, boxes touching (glyph
- to glyph 16 px) — in the bar at every width. ≥ `md`: wordmark · nav · group, the nav 32 px
- before the group's first box. < `md`: wordmark · group, and the four nav links alone on the
- rule below (they fit 320 px). No link is hidden by width: when the bar (`@container/bar`) is
- narrower than the full wordmark, a 12 px gap and the group need, the wordmark's text is hidden
- and the mark stays — a rem threshold per link count and pointer (full wordmark from 348 px with
- three links and a mouse, 380 px with touch; with four, 384 and 424 px). The last resort is
- `common/components/SocialScroll.tsx`: the row scrolls in a box, its end first (rtl box, ltr
- row), the toggle outside it, focus brings a link into view. Changelog is in the footer only
- (`homepage/app/lib/nav.ts`: `HEADER_NAV`, `FOOTER_NAV`).
-7. **The Official Instances cards** set each site's title with the shared `Wordmark` when the
- summary carries its `wordmarkLead` (new, optional, still v5), the lead tinted in the site's own
- accent (`siteAccentColor`). The hub's cards are not touched.
-8. **The homepage's growth chart** parts its strata with 1 px lines in the ground's foreground
- (`.growth-sep`; `CanvasText` in forced colours), no longer the page background. Homepage-only:
- the shared charts have no such separator.
-
-## Slice H3 — the homepage's instances anchor (FOLDED INTO H1, built)
-
-Owns `homepage/app/page.tsx`, `homepage/e2e/marketing.spec.ts`, `common/lib/project.ts` (one
-constant), `homepage/CHANGELOG.md`.
-
-1. `id="instances"` on the Official Instances `<section>`, with `scroll-mt` for the sticky header.
-2. `INSTANCES_URL = ${PROJECT_URL}/#instances` beside `PROJECT_URL`.
-3. e2e: `/#instances` scrolls the heading into view. When the section is absent (no sites) the
- link lands on the top of the page; that is accepted and said in the record.
-4. Gates: tsc, homepage unit, homepage e2e, `archilyzer build homepage --no-source`.
-
-## Slice H1 — the header carries the social row (BUILT on `r14/two-grounds-headers`)
-
-As built, where it differs from the steps below: the inline nav and the Archilyzer link start at
-`lg`, not `md` (at 768 px they, a long title and four icons did not fit); the Archilyzer link is in
-the slide-out menu below `lg`; the wordmark's text drops by a pure-CSS wrap in a one-line clipped
-box, exact for any title, with no measured threshold, its width reserved from Archivo's own metrics
-so the decision is the same before and after the web font loads (review L2); from `lg` the brand
-shrinks first (L1); the footer's row wraps (L6); the footer's `-mx` inset is the shared row's. `header.spec.ts` covers 280–430 px with a short and a long title, 1–4 links, both pointers.
-
-Owns `export/app/components/{Header,MobileMenu,Footer,SiblingSwitcher}.tsx`,
-`export/e2e/{helpers.ts,site-branding.spec.ts,brand.spec.ts,responsive.spec.ts}`, a NEW
-`export/e2e/header.spec.ts`, `export/e2e-hub/official-instances.spec.ts`, `export/CHANGELOG.md`,
-`plans/export-responsive-redesign.md` (the header contract, `:258-260`).
-
-1. **Adopt HP's `SocialLinks`** (`common/components/SocialLinks.tsx`) in the export header
- (`placement="header"`) and footer (`placement="footer"`), replacing the footer's hand-written
- `<ul>`. The component is used as it is; a change it needs goes into HP's component, with its
- homepage spec re-run.
-2. **Tap area and focus** come with it: 36 px keys, 44 px under a coarse pointer, the ring in
- `--ring`, the browser's outline in forced colours. The export footer's icons change from
- `hover:text-brand` to the component's `hover:text-foreground`; say so in the changelog.
-3. **The header, wide:** brand · nav · `SocialLinks` · the Archilyzer link · the theme controls
- (H2). **Narrow:** adopt HP's approach — no link hidden by width; the header first makes room
- (for a site's header, whatever of the brand can give way while the mark stays), and HP's
- `SocialScroll` box is the last resort, the row's end shown first. Measure this header (a long
- `headerTitle`, the toggle, the menu trigger) and record the widths at which the brand collapses
- and at which anything scrolls. The bound is HP's: at most four links, the `featured` ones when
- any is marked, else the last four; the footer shows them all.
-4. **Sites dropdown → one link.** `SiblingSwitcher` is deleted. In its place a text link
- "Archilyzer" to `INSTANCES_URL`, opening in the same tab, with an accessible name that says
- where it goes ("Archilyzer — official instances"). Also in the slide-out menu, replacing the
- Sites groups there. On the hub build the link is omitted (the hub lists the instances itself).
-5. **Hub backlink removed** from the header and the slide-out menu (A5). `hubUrl` and
- `resolveHubUrl` stay; an old `site.json` with the key still loads.
-6. **Changelog** leaves both header places and joins the footer's row-1 links after Use with AI.
-7. **Tests.** New `header.spec.ts`: the header row is visible without scrolling at 360, 390, 768
- and 1280 px; each link's box is ≥ 24 px (and ≥ 44 px under a coarse pointer emulation,
- `hasTouch: true`); the focus ring shows; the Archilyzer link's `href`; no `Sites` button;
- Changelog is in the footer and not in the header; six configured links → four in the header,
- six in the footer; two marked `featured` → those two. The export e2e's social links come from
- its own fixture, never the operator's settings. `responsive.spec.ts`: the slide-out menu's
- contents as changed.
-8. **No copy.** No text beside any icon; the accessible names are the links' labels.
-9. Gates: tsc; common tests; `pnpm --filter export exec next build` (site, fixture site, hub);
- export e2e — the specs above plus `theme.spec.ts`, `theme-accent.spec.ts`,
- `related-sites.spec.ts`; hub e2e `official-instances.spec.ts`; screenshots of the header at
- 360 / 390 / 768 / 1280 px on Light, Sepia and Dark to `~/reports/release-14/shots/`.
-
-## Slice H2 — one theme toggle (BUILT on `r14/two-grounds-headers`)
-
-As built: T1 went first, so the slide-out menu lost its Base radios here with `ThemeRadios`
-(deleted), rather than keeping them until T1.
-
-Owns `export/app/components/{Header,MobileMenu}.tsx`, `export/e2e/{theme,theme-accent,responsive,
-brand}.spec.ts`, `export/CHANGELOG.md`. The editor keeps its own header controls until T1.
-
-1. **The export header's theme control is the cycling toggle** (`ThemeToggle`, `variant="bare"`,
- built by slice HP) in place of `ThemeMenu` + `ThemeToggle`: one key at the end of the header's
- group, visible at every width. No options dialog. The accent picker is removed from the export
- header (the export's `ThemeProvider`/`ThemeScript` take `pinAccent`, as the homepage's do).
-2. The slide-out menu keeps its Base radiogroup (`ThemeRadios`) until T1 drops Sepia and the accent
- picker everywhere.
-3. **Labels are contracts.** `theme.spec.ts` and `brand.spec.ts` drive the toggle by
- `/switch to/i`; `theme-accent.spec.ts` drives `Choose theme` and `menuitemradio` and changes
- with the accent picker's removal. Keep one helper, `chooseTheme(page, { base })`, in
- `export/e2e/helpers.ts` (the homepage's is `homepage/e2e/helpers.ts`: click the toggle until the
- base is reached), deriving the cycle from `THEME_BASES` / `nextBase`. Specs that set
- `localStorage` directly are untouched. The no-flash assertions (`data-theme-ready`) are
- untouched.
-4. Gates: as H1, plus the homepage e2e `toggle.spec.ts` and `theme.spec.ts`.
-
-## Slice T1 — two grounds (BUILT on `r14/two-grounds-headers`, before H1)
-
-As built: the retired value is spelled once, `RETIRED_BASE` in `themeConfig.ts`; `ThemeMenu` and
-the `pinAccent` option are deleted, and `ThemeRadios` kept the base alone until H2 deleted it.
-
-Owns `common/components/theme*` (`themeConfig.ts`, `ThemeProvider.tsx`, `ThemeScript.tsx`,
-`ThemeToggle.tsx`, `ThemeMenu.tsx`, `ThemeRadios.tsx`), `common/styles/tokens.css`, the three apps'
-`globals.css`, the three headers and the export's `MobileMenu`, and the specs that mention Sepia.
-
-1. **Drop the Sepia base in every app:** the tokens, `THEME_BASES`, `nextBase`, the no-flash
- script; the legacy `archive` → sepia migration now maps to light, and a stored `sepia` migrates
- to `light`.
-2. **Remove the accent picker** from the export and editor headers and the slide-out menu; a stored
- accent is ignored (as the homepage's `pinAccent` does).
-3. **Specs updated.** The parent's count of what mentions Sepia: 40 files, 154 lines, 16
- specs/tests. The homepage's `toggle.spec.ts` derives its cycle from `THEME_BASES`, so it needs
- no change beyond the base's removal.
-4. Gates: tsc; common tests; the three apps' builds; the three e2e suites.
-
-## Slice S1 — a clear screen until the first Search (branch `r14/first-search`)
-
-As built (2026-09-29, on the rulings of that day): S1 only, the summaries download not deferred
-(S2 stays a candidate). A link carrying only a filter (`tg=`, a share link, the legacy filter keys),
-like one carrying `qt=`/`q=`, runs on load and shows its results. It runs no query, so a stored
-one stays held (release 8), on that load and on later mounts in the visit: the gate and the hold
-are two page-life flags (review M1). Step 0: the hub renders
-`SearchResults` (`HubHome` → `TranscriptSearch`), so it has the clear screen and `e2e:hub` joined
-the gate; Back restores the listing (measured in `release-14.md`, "Slice S1, as shipped"). Beyond
-the four specs this section owns, the ones that read the listing at load were `responsive` (two
-tests), `tag-chips` (three) and `e2e-hub/federated-search` (eight).
-
-Owns `common/components/{SearchSessionContext,SearchResults,SearchBar}.tsx`,
-`export/app/(workspace)/WorkspaceView.tsx`, `export/e2e/{browse-all,workspace-shell,charts,
-restore-no-refire}.spec.ts`, a NEW `export/e2e/first-search.spec.ts`, `export/e2e/helpers.ts`
-(one helper), `export/CHANGELOG.md`.
-
-0. **First, settle the two unknowns** and write them in the record: does `HubHome` render
- `SearchResults`; what does the Back button restore into the list. If the hub shares the
- component, the behaviour applies there too and `e2e-hub` joins the gate; if not, the hub is
- left and said so.
-1. **One reactive flag.** `searchedThisPageLife` in the session context, initialised from the
- module-level `ranThisPageLife` and set wherever it is set (`:1277`, `:1393`, `:1457`). Delete
- the dead `searchExecuted` state. The module variable stays the source of truth across remounts
- (A2).
-2. **The gate is in the view, not the data.** `SearchResults` renders NOTHING until the flag is
- true: no header count, no view toggle, no Copy for AI, no selection toolbar, no chart, no list,
- no `browse-hint`. `resultGroups` is still computed (S2 is where the work is saved). The page's
- own intro (`export/app/(workspace)/page.tsx:7-37`: the transcript count and New since last
- visit) stays.
-3. **What the visitor sees:** the search bar, the intro, the footer. The bar's existing line
- "Press Enter or click Search to apply" is shown in this state too, so the screen says what to
- do in words that already exist. No new copy.
-4. **An empty Search** shows "All videos (N)" and the listing, exactly as today. A `qt=` URL runs
- and shows on load (A1). A restored query stays held (release 8) — and now shows a clear screen
- instead of the browse listing under it.
-5. **Filters before the first Search:** changing a filter does not reveal the listing; the hint
- line already covers it (`filtersDirty`).
-6. **Tests.** New `first-search.spec.ts`: on load no `results-summary`, no `[data-card-header]`,
- the footer in the viewport at 1280×800 and 390×844; Enter on an empty box shows "All videos";
- the Search button does too; `/` → `/ask` → `/` keeps the listing; a reload clears it; `qt=`
- shows results on load; a restored query shows the clear screen and the filled form. The three
- affected specs gain `showAll(page)` (one helper: press the Search button, wait for
- `results-summary`) where they relied on the listing at load; `browse-all.spec.ts`'s first test
- is rewritten to assert the clear screen and then the listing.
-7. Gates: tsc; common tests; `pnpm --filter export exec next build`; the FULL export e2e suite
- (the blast radius is a shared component — three specs are known, the suite finds the rest);
- hub e2e if step 0 says so; `e2e:2origin` from the worktree only.
-
-## Slice S2 — CANDIDATE: fetch the summaries on the first Search
-
-Not scheduled. It is the other half of the 2026-09-25 request ("didn't load all search items
-until the user hits search") and needs the operator's word, because it changes `/ask`.
-
-- `SingleSiteDataProvider` calls `useSummaries("")` on mount (`SearchDataContext.tsx:148-155`), and
- `useSummaries` fans out EVERY page eagerly (`summariesCache.ts:19-71`, 1,000 records a page).
-- The cheap manifest feeds the Filters channel list (`SearchDataContext.tsx:165-183`) and must stay
- eager; the fallback at `:176-183` derives channel names from the pages when the manifest has none.
-- `/ask` grounds on the same summaries (`useAskChat.ts:149-151`) under the same shell, so an
- `/ask`-first visitor needs them without ever pressing Search.
-- Step one of S2 is a measurement, per site, of the bytes and requests a plain visit costs today
- and would cost after — the figures on record disagree.
-
-## Rollout (parent)
-
-Nothing here deploys inside a slice. After the merges: one export release cut, a rebuild and
-deploy of every site and the hub (the header is in every build), and the homepage deployed FIRST
-so `#instances` exists before any site links to it. HP adds an editor cut and a :3001 rebuild and
-restart, for the "Show in header" checkbox and the normalizer's viewBox rule, which are in the
-editor's save path. The homepage deploy runs the source publish step of release 12 — its
-denylist must be complete (`release-12.md`, "Rollout", step 0). Live checks: the header row visible at 390 px on one site; each icon's `href`; the Archilyzer link lands
-on Official Instances; a plain visit shows the footer without scrolling; a `qt=` link still shows
-results. An HTML runbook at `~/reports/release-14/RUNBOOK.html`.
-
-## Risks
-
-- **Two taps for the ground** (H2.4). The fallback is named.
-- **A first-time visitor sees no videos.** The site's front page becomes a search box over a
- count. That is the operator's choice; the hint line is the only instruction.
-- **Icons in a 360 px header** compete with the brand's title: a long `headerTitle` wraps
- (`min-h-14` allows it). The screenshots at 360 px are the check; the bound of four keeps the row
- bounded.
-- **An operator's icons in the header** are more prominent than in the footer. Each stays as the
- operator pasted it (normalized, never redrawn), unlabelled and only a link.
-- **Specs outside the known three** may lean on the listing at load through a hydration wait; the
- full-suite run in S1's gate is how they are found.
diff --git a/plans/export-responsive-redesign.md b/plans/export-responsive-redesign.md
@@ -1,330 +0,0 @@
-# Export site — mobile-first responsive redesign
-
-## Context
-
-The `export/` app (the public static archive: jeralyzer.pages.dev etc., plus hub mode) was
-designed desktop-first at `max-w-6xl` and relies on `flex-wrap` everywhere. Measured against
-a built `export/out` served locally at iPhone-13 width (390px) on 2026-08-29:
-
-- **Header** wraps to three rows inside a fixed `h-14`, so rows 2–3 render *outside* the
- sticky header's background and page content scrolls through them (`Header.tsx:43`).
-- **Footer** row A has no `flex-wrap` + `whitespace-nowrap` → horizontal overflow at 360px.
-- **Search page**: profile row, query builder, and the fully expanded filter stack (channels,
- type, audience, availability ×6, dates, advanced) occupy ~2 screens *above* the results —
- on `/ask` too, before the user ever sees "Ask a question". The `/?q=election` full page is
- 43,000px tall (every hit of every video rendered inline); `/duplicates` is 68,000px.
-- **Transcript modal** reserves the player slot with `calc(min(92vw,960px)*9/16 + 3rem)` and
- `100vh`, leaving ~100px for the cue list at 360px; its control bar is 13 unlabeled 32px
- emoji buttons (`title` tooltips only — invisible on touch) wrapping to 2–4 rows.
-- **Ask pane** has zero breakpoint classes; provider settings, grounding palette, pinned
- panel, saved chats, context, report and the `max-h-[60vh]` nested message scroller stack in
- one column with the composer at the very bottom.
-- Result-card headers are single-row `truncate` (title → "Hasan…"), hit rows spend a `w-16`
- gutter, checkboxes are 16px, many buttons are `h-6`/`text-xs`.
-- Only viewport-aware JS in the app: `WorkspaceView.tsx:51` (`min-width:1024px` gating Split).
- Only breakpoint classes outside the workspace: five `sm:` utilities. No `dvh`, no safe-area.
-
-Goal: a redesign that keeps **every** feature and every e2e hook, is designed mobile-first and
-works at any width, puts the standard path (type → results → open transcript / ask) in front,
-and folds the power features (query tree, profiles, advanced throughput, sweeps, clips…) behind
-explicit, discoverable disclosure that scales up to always-visible on wide screens.
-
-Screenshots for reference: `/home/user/.claude/jobs/a61f2393/tmp/shots/` (phone_* / desktop_*).
-
-## Non-negotiable invariants
-
-1. **Mount architecture is unchanged.** `(workspace)/layout.tsx → SiteWorkspace` keeps
- `PlayerProvider > SingleSiteDataProvider > SearchSessionProvider > [bar, WorkspaceView]` with
- `TranscriptModal`/`PostModal` siblings. Both panes stay lazily-mounted-then-latched and are
- hidden with CSS, never unmounted (`WorkspaceView.tsx:76-121`). Streaming chat, the
- AbortController, and the pre-hydration nav-click guard depend on it. Hub mode
- (`TranscriptSearch.tsx`, `HubHome`, `AskHub`) keeps bypassing the shell; it inherits the
- redesigned bar/results automatically and must not assume a player or search session exists.
-2. **State contracts are unchanged.** `SearchSessionContext` (draft/committed filters, profiles,
- selection/grounding, view + chartShape, advanced opts, URL params `qt/view/cs/v/t/vm` + share
- v2 keys), `useAskChat`, and every `ytdlp-tb:*` localStorage key keep their shapes. This is a
- view-layer restructuring.
-3. **Every e2e hook survives with identical strings** (full list in §Hooks). E2E runs at
- 1440×1200 (`export/playwright.config.ts`), so the desktop layout must expose everything the
- specs reach today with at most the small helper edits listed per slice.
-4. Reduced-motion opt-outs stay on every animation; `hover:` never gates a *function* (use
- `@media (hover: hover)` for reveal-on-hover).
-
-## Design
-
-### Breakpoint tiers (Tailwind v4 defaults)
-| Tier | Width | Shape |
-|---|---|---|
-| base | <640 | one column; sticky compact search bar; sheets for filters/menu; full-screen player view; sticky composer & selection bar with safe-area padding |
-| sm | ≥640 | same column, wider chips/rows; filters sheet slides from the right; modal returns to the centred `min(92vw,960px)` card |
-| md | ≥768 | header nav inline (no hamburger) |
-| lg | ≥1024 | Split (search ‖ chat) offered, as today; chart options + grounding panels expanded by default |
-| xl | ≥1280 | filters become an inline, collapsible left sidebar next to results |
-
-Shared plumbing: `common/lib/useMediaQuery.ts` (`useSyncExternalStore`, server snapshot
-`false`, used for `wide` and the filters container); `generateViewport` gains
-`viewportFit:"cover"` + `interactiveWidget:"resizes-content"`; `100vh → 100dvh`; safe-area
-utilities (`pb-[env(safe-area-inset-bottom)]`); manifest drops `orientation:"portrait-primary"`
-(video wants landscape). Inputs keep `text-base md:text-sm` (iOS zoom guard). Primary-path tap
-targets ≥ 44px, secondary ≥ 36px; checkbox labels get padded rows.
-
-### 1. Shell — header, footer, menu
-- `Header.tsx`: `h-14 → min-h-14`, no wrap. Brand left. **< md**: right cluster = ThemeToggle +
- hamburger (`aria-label="Open menu"`) opening a `Sheet side="right"` (`ui/sheet.tsx`, currently
- unused anywhere) with: primary links (Search, **Ask AI** (new link, `/ask/`), Duplicates,
- Downloads, Use with AI, Offline when `site.pwa`, Changelog), a "Sites" section listing
- `resolveRelatedSites` groups, the Hub backlink (today `hidden sm:inline-flex` — it becomes
- reachable on phones), then Theme family + Mode radio lists. Header is a server component:
- add a small client `MobileMenu` that receives serialised link groups as props. **md+**: inline
- nav as today plus "Ask AI"; SiblingSwitcher/ThemeMenu/ThemeToggle unchanged (their roles are
- test hooks).
-- `Footer.tsx`: `flex-wrap` on row A and its inner group, stack below sm, drop
- `whitespace-nowrap`, safe-area bottom padding. All links/gating unchanged.
-
-### 2. Search bar (the standard path)
-`WorkspaceSearchBar.tsx` (910 lines) splits into `SearchBar` + `FiltersPanel` (+ the existing
-`QueryBuilder`). `SearchBar` is **sticky below the header on < lg** (top offset = header height):
-- **Row 1**: the compact leaf's input (`leaf-query-<id>`, `type=search`, 44px tall, flex-1) +
- Search submit (`data-testid="search-submit"`, `data-dirty`; icon-only below sm with
- `aria-label="Search"`, label from sm).
-- **Row 2**: a horizontally scrolling chip row (`overflow-x-auto`, no scrollbar, snap):
- `WorkspaceNav` [Search|Chat|Split] (moved here from `WorkspaceView`; Split still gated on
- `wide`), scope `<select>` (`leaf-scope-<id>`), Regex toggle (`leaf-regex-<id>`),
- **Layers** chip (`compact-add-layer` + add-group; shows leaf count when the tree is non-compact),
- **Filters** chip with an active-count badge ("3 of 5 channels · dates") that opens the
- FiltersPanel container, **Share** (`button` named "Share current search" → "Link copied!",
- icon-only on phone via `aria-label`), Reset layers (`reset-layers`). The dirty hint and the
- live-chat hint become a one-line status under the bar.
-- The full query tree (non-compact) renders inline under the bar at all sizes, as today; leaf
- cards put the input on its own row and the scope/regex/hits/NOT/count/wrap/× controls on a
- wrapping second row below sm. Alias suggestions unchanged.
-
-`FiltersPanel` (one component, one mount): profiles row (`profiles-row`, select, dirty dot, Save,
-Save as…, Revert, Rename, Delete — moved here, since a profile *is* a saved filter+query set) →
-Channels (All / Reset channels / Reset all / Reset everything, inline chips, collapsible group
-boxes) → Type → Audience → Availability (nested Missing states) → Date (From/To stacked below sm)
-→ **Advanced** nested `<details>` (Max hits per batch + No limit, Fetch concurrency, Flush
-interval, Search through all transcripts, Reset to defaults). Container chosen by
-`useMediaQuery("(min-width:1280px)")`: **xl+** inline left sidebar (~280px) in the workspace
-grid, collapsible to a rail button, persisted with the existing `filtersCollapsed`; **< xl**
-`Sheet` (`side="bottom"`, `max-h-[90dvh]` below sm; `side="right"` from sm) with a sticky
-"Apply/Search" footer button that commits and closes. At the 1440 e2e viewport the sidebar is
-inline and open by default, so filter specs keep passing; add `openFilters(page)` to
-`e2e/helpers.ts` for any spec that asserts on a collapsed state.
-
-### 3. Results
-- Summary line (`results-summary`, loading/progress) on its own row; toolbar row wraps:
- [Results|Chart] (`view-toggle`), Copy for AI, selection controls.
-- **Card header** (`data-card-header`): below sm two rows — (checkbox + title clamped to 2 lines)
- then (badges + `channel · date · N hits` + Ask); from sm the current single row. Titles never
- truncate to a few characters again.
-- **Per-card hit cap**: first 8 hits per leaf section + "Show all N hits" (real button; all sizes).
- This is what turns 43k-px pages into scannable ones. Virtualizer must re-measure on expand
- (`measureElement` / `estimateSize` in `SearchResults.tsx:290-399`).
-- Hit rows: `w-14` mono gutter below sm, `w-16` from sm; `TrackBadge` inline.
-- **Selection toolbar** (`selection-toolbar`): static when nothing is selected; when N>0 and
- < lg it becomes `sticky bottom-0` ("N selected · Ask AI · Clear", safe-area padded) so the
- ask handoff is one tap away. Same element, same testid.
-- Duplicate strip, badges, browse-hint, Load more: unchanged behaviour, wrapped layout.
-- **Chart**: `h-[240px] sm:h-[320px]`; `chart-options` `<details>` collapsed by default below lg
- (open at lg+, as the charts spec expects); YAxis width 40 on phone, X tick thinning; the
- Examples menu anchors within the viewport.
-
-### 4. Transcript modal + player (the biggest change)
-- **< sm: full-screen player view.** `fixed inset-0 h-[100dvh] flex flex-col`: player slot
- (full width, aspect-video, safe-area top) → title/meta row → **mode tab strip** = the same
- "Show transcript" / "Show live chat" / "Show AI chapters" buttons styled as tabs, gated exactly
- as today → `flex-1 min-h-0` cue list (virtualized as today, auto-scroll unchanged) → **bottom
- action strip** (`sticky bottom-0`, horizontally scrollable, safe-area): every current
- `ControlButton` kept as a real `<button>` with the identical `aria-label`/`title`, now a lucide
- icon **plus a short visible label**, grouped: [Clip in · Clip out · readout · yt-dlp]
- [Share · Download ▾ · Copy MD · Preservetube] [Mini · Hide · Close]. Digest panel, snap-back
- notice, download-format menu unchanged.
-- **sm+**: current centred card, but with the labelled strip, `dvh`-based max height, and the
- content column matching the player width.
-- Player geometry becomes CSS custom properties in `globals.css` (`--player-w: 100vw` base,
- `min(92vw,960px)` from sm; `--player-top`), consumed by **both** `PlayerProvider.tsx`
- (modal/mini/hidden positions) and `TranscriptModal.tsx` (reserved slot) so they can never drift.
-- Mini player: phone `w-44`, bottom-right above the safe area; hidden-controls pill full width on
- phone. Backdrop→mini, Escape→mini, "Reopen transcript" unchanged.
-- `PostModal`: `max-h-[90dvh]`, `p-4 sm:p-8`, close button ≥ 44px.
-
-### 5. Ask pane
-- Layout: intro header (route chrome) → provider `<details>` → **grounding strip** → messages →
- suggestions → composer. Below lg the message list uses the document scroll (no nested
- `max-h-[60vh]`) and the composer is `sticky bottom-0` with safe-area padding; lg+ keeps a
- nested scroller sized in `dvh` so the composer stays in view. "Jump to latest" works in both.
-- **Grounding strip**: one line ("Grounded in 15 results · whole search" / "3 selected videos")
- with a chevron expanding the existing GroundingPalette + PinnedResultsPanel (all testids and
- the `role="tab"` toggle inside). Expanded by default at lg+ (ask-workspace spec), collapsed
- below. Paused-sweep banner stays top-level.
-- **ProviderSettings**: basic = provider, model (`input[list="ask-models"]`), key
- (`placeholder^="sk-ant"`), Remember, Search mode; **Advanced** nested `<details>` = max answer
- tokens, sweep batch, RPM + reset, debug JSON. Spec edits: open Advanced before
- "Download debug JSON" (ask-chat.spec ~L280).
-- Saved chats row: same controls, wraps to two lines, buttons get `size="sm"` hit areas.
- Context / Report `<details>` unchanged (their `<summary>` text is a selector). Message action
- buttons (Copy answer, Retry/Regenerate, Edit) → `size="sm"`. Citations unchanged.
-
-### 6. Secondary pages & hub
-- `/duplicates`: filter `<details>` collapsed by default below lg with an active-filter summary;
- cluster list windowed with `useWindowVirtualizer`; member meta wraps; native checkboxes →
- `ui/checkbox` with padded labels (names unchanged: "YouTube", "near transcript", "filter
- duplicates"…).
-- `/offline`: buttons `size="sm"`, rows wrap, offline search input 44px. `/downloads`: download
- tabs `min-h-10`. `/use-with-ai`, `/changelog`: already fine; verify `pre` scroll.
-- Hub: `ArchiveShelf` remove button visible unless `(hover:hover)`; `AddArchive` input
- `min-w-0 w-full sm:min-w-64`; `HubOfflineManager` rows wrap; `HubStats` wraps.
-- `NewSinceLastVisit`: unchanged.
-
-### Suggestions folded in (call out if you disagree)
-- "Ask AI" in primary nav (today only reachable via the workspace control or Use with AI).
-- Per-card hit cap (§3) — a desktop behaviour change too; the 500-row cards are the main
- reason the page is unreadable on any device.
-- Filters as a sidebar only from `xl` (not `lg`) so Split + filters never compete at 1024.
-- Labels on the modal controls at every size (space exists at 960px; tooltips are not an
- accessibility story).
-- Landscape allowed in the manifest.
-
-## Hooks that must survive (verbatim)
-data-testid: search-form, search-submit(+data-dirty), reset-layers, reset-everything,
-filters-summary-channels, inline-channel-chip, av-available, av-missing, av-<state>, date-from,
-date-to, profiles-row, profile-select, profile-dirty-dot, profile-revert, query-builder,
-compact-add-layer, group-op/negate/count/unwrap/delete/add-leaf/add-group-<id>,
-leaf-query/scope/regex/hits/negate/count/delete/wrap-<id>, leaf-alias-suggestions-<id>,
-leaf-alias-<leaf>-<alias>, leaf-alias-apply/dismiss-<id>, results-section, results-summary,
-view-toggle, selection-toolbar, browse-hint, chart-options, chart-caption,
-chart-examples-button, chart-examples-menu, state-badge-<state>, workspace-nav, view-split,
-pane-search, pane-chat, new-since-last-visit, grounding-palette, grounding-mode,
-selection-chips, saved-chats-row, saved-chat-select, chat-dirty-dot, sweep-paused,
-rate-limit-notice, shelf-spine.
-data-attrs: data-card-header, data-card-open, data-result-slug, data-leaf-section,
-data-leaf-id, data-group-id, data-cache-hit, data-duplicate-strip/slug/aligned,
-data-post-modal, data-index, data-theme-mode.
-Accessible names: "Mark clip start at current time", "Mark clip end at current time",
-/Copy yt-dlp download command/, "Show live chat", "Show transcript", "Show AI chapters",
-"Copy share link at current time", "Collapse to mini-player", "Reopen transcript",
-"Close player", "Hide player (keep audio playing)", "Share current search" → "Link copied!",
-"Choose theme", /switch to/i, "Select all in <group>", "All"/"None", checkbox names
-(Videos, Livestreams, Posts, Available, Deleted, …), 'Select "<title>" for AI', per-card "Ask",
-"Ask" (composer), "Stop", "New chat", "Save as…", "Detach", "Ground in my search",
-"Apply as starting point", /Build report from all N results/, "Add to report",
-"Start new report", "Stop the sweep", "Pause the sweep", "Resume", "Download debug JSON",
-"Copy answer", "Retry"/"Regenerate", "Remove <title> from the selection", "Dismiss",
-"Archive URL", "Add", "Remove <site>", "connection status", "offline search",
-"offline search results", "build search index for <slug>", "download <slug> for offline",
-"remove offline copy of <slug>", "<slug> indexed", "filter duplicates", /^duplicate cluster/,
-"Related sites" (nav), "Archilyzer" (footer link, same tab), "Copy link to <anchor>".
-Implicit selectors: `input[placeholder^="sk-ant"]`, `input[list="ask-models"]`,
-`summary` text "Report" / "Context" (+ `details textarea`), `<li>` citation sources,
-`<a>` citations named `[1]` / `[1 @ 0:05]`, `role="tab"` grounding toggle,
-`aria-current="page"` on the Search/Chat links, `p[role="alert"]` (AddArchive),
-`getByLabel("Answer only from these results")`, "Format answers", "Report mode",
-placeholder /Ask about the transcripts/, title "Open the transcript at this moment",
-`html[style*="--brand"]`, heading "Your archives", "Offline" h1.
-Seeds used by specs: `ytdlp-tb:ai:rpm = {"*":100000}` (all tests), `ytdlp-tb:ai:sweepchunk`.
-
-## Slices (each leaves lint + unit + affected e2e green)
-
-Verified facts used below: `ui/sheet.tsx` supports `side="bottom"` (`:70-71`), overlay+content
-are `z-50` (`:39,:63`), content unmounts while closed (no duplicate testids), Radix Dialog sets
-`body.pointer-events:none` + RemoveScroll. `ui/tabs.tsx` exists but must NOT be used for the
-modal mode strip (specs query `getByRole("button",{name:"Show live chat"…})`). SearchSession
-exposes `filtersCollapsed` + `toggleFiltersCollapsed` (`SearchSessionContext.tsx:1832-1833`,
-persisted via `persistUiCollapse` `:1196-1210`). `viewportFit`/`interactiveWidget` are typed in
-`export/node_modules/next/dist/lib/metadata/types/extra-types.d.ts:52-53`. Tailwind 4.2.4 →
-`pointer-coarse:`, `max-md:`, `h-dvh`, `w-(--var)` all available; `@source "../../common/components"`
-in `globals.css:3` means `@utility`s defined there are usable from `common/`.
-`@tanstack/virtual-core` re-measures via a per-element ResizeObserver (hit cap needs no
-`estimateSize` change). Other `vh/vw` users: `TranscriptModal.tsx:238-242`,
-`PlayerProvider.tsx:925,928,1098`, `AskChat.tsx:293`.
-
-### Slice 1 — Foundation (S, 0 spec edits)
-- New `common/lib/useMediaQuery.ts`: `useSyncExternalStore(subscribe, () => matchMedia(q).matches, () => false)`, `subscribe` memoised on the query.
-- `export/app/(workspace)/WorkspaceView.tsx:36,50-57`: delete the `wide` state+effect → `const wide = useMediaQuery("(min-width: 1024px)")`. Keep the eslint-disable block at `:39-47` (it is for `splitOn`).
-- `export/app/layout.tsx:46-49`: `generateViewport` returns `{ themeColor, width:"device-width", initialScale:1, viewportFit:"cover", interactiveWidget:"resizes-content" }` (no `maximumScale`/`userScalable`).
-- `export/app/globals.css`: `:root { --player-w: 100vw; --player-top: env(safe-area-inset-top, 0px); } @media (min-width: 640px) { :root { --player-w: min(92vw, 960px); --player-top: 4rem; } }` (4rem = today's `top-16`); `@utility pb-safe { padding-bottom: env(safe-area-inset-bottom) }` and `pt-safe`.
-- `export/app/manifest.ts:27`: delete `orientation`.
-- Risk: server snapshot `false` → one narrow-variant render on desktop before the flip (no hydration warning). Always render layout *shells* unconditionally and gate only their content on `wide` so the main column never shifts. Playwright `setViewportSize` fires `matchMedia` change events (the 600px ask-workspace test keeps passing).
-
-### Slice 2 — Transcript modal + player (M, 0 spec edits)
-- `common/components/PlayerProvider.tsx:922-934`: modal → `fixed left-1/2 -translate-x-1/2 top-(--player-top) w-(--player-w) aspect-video z-[60] max-sm:rounded-none`; mini `:927-928` → `fixed right-4 bottom-[calc(1rem+env(safe-area-inset-bottom))] w-44 sm:w-96`; hidden `:932-933` unchanged. `HiddenControls` `:1098` → `max-sm:inset-x-3 max-sm:right-auto max-sm:max-w-none` + safe area. `ControlButton` `:1110-1141` gains optional `icon?: ReactNode` + `label?: string` (visible text); keeps `title` and `aria-label={title}` (`:1126-1127`) so every accessible name is unchanged; `char` stays as the fallback used by `HiddenControls :1103-1105`.
-- `common/components/TranscriptModal.tsx:236-244`: replace both inline calcs with `marginTop: calc(var(--player-top) + var(--player-w) * 9 / 16 + 0.75rem)` and `maxHeight: calc(100dvh - var(--player-top) - var(--player-w) * 9 / 16 - 1.5rem)`, width `w-(--player-w)`, drop `pt-4`; add `max-sm:h-full max-sm:rounded-none` so the phone gets the full-screen column. Reorder: title block `:377-391` → mode toggles `:279-292` as their own tab-styled row (same `ControlButton`s, same names) → cue container `:401-404` with `min-h-0 overscroll-contain touch-pan-y` + new `data-testid="cue-list"` → control bar `:245-375` as the bottom strip (`shrink-0 overflow-x-auto flex-nowrap sticky bottom-0 pb-safe`, icon + label, grouped). Keep active-row class `bg-blue-950/50` (`:610`, live-chat.spec selects `li.bg-blue-950\/50`) and `role="status"` on the notice (`:394`). Both "Collapse to mini-player" buttons (backdrop `:232`, control `:361`) stay.
-- Download-format menu `:317-333` is `absolute top-9` and would clip inside a scrolling strip → replace with `ui/dropdown-menu` (portal, content `z-[70]`), delete the outside-click effect `:77-96`.
-- `common/components/ui/sheet.tsx:39,:63`: bump overlay + content to `z-[70]` (modal `z-50` < player `z-[60]` < sheets; otherwise the mini player floats over a sheet and is unclickable under `pointer-events:none`). Sheet is unused today, so this is safe.
-- Body-scroll: `TranscriptModal :157-165` sets/restores `body.style.overflow`; RemoveScroll also touches body — they never overlap today (no sheet opens over the modal); leave a comment. Escape is handled by both PlayerProvider `:837-844` and Radix — acceptable.
-
-### Slice 3 — Header + Footer (M, 0 spec edits)
-- `export/app/components/Header.tsx:43`: `h-14 … flex-wrap` → `min-h-14 flex-nowrap`. Nav `:51-77` → `hidden md:flex` + add "Ask AI" → `/ask/`. Right cluster `:79-99`: SiblingSwitcher, Hub `<a>`, Changelog, ThemeMenu → `hidden md:…`; `ThemeToggle` stays visible at every width (theme.spec `/switch to/i`; theme-family.spec "Choose theme" is served by the inline ThemeMenu at 1440).
-- New client `export/app/components/MobileMenu.tsx`: props `{ links:{href,label}[]; sites: SwitcherGroup[] (type from SiblingSwitcher.tsx:18-19); hubUrl?: string }`. `<Sheet>` + `<SheetTrigger asChild><Button variant="ghost" size="icon-sm" aria-label="Open menu" className="md:hidden">`, `<SheetContent side="right">` with a `<SheetTitle>` (Radix warns without one); every `<Link>` wrapped in `<SheetClose asChild>` (Header lives in the root layout and never remounts on client nav). Theme lists via `useTheme()` (`ThemeProvider.tsx:35-38`) + `THEME_FAMILIES`/`THEME_MODES` from `themeConfig` as native radio groups — do not nest `ThemeMenu`'s DropdownMenu in the dialog. Offline link gated like `Footer.tsx:56` (`site.pwa`).
-- `export/app/components/Footer.tsx:29` → `flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between pb-safe`; `:82` drop `whitespace-nowrap`. Leave the anchor naming (`"Built with"` outside the `<a>`) and `nav aria-label="Related sites"` untouched.
-- **Superseded, release 14 (H1/H2, `r14/two-grounds-headers`):** the header's right cluster is now
- the social row and the theme toggle as one group at every width; the SiblingSwitcher, the Hub
- link, Changelog and ThemeMenu are gone from it (Changelog is in the footer); the inline nav and
- an Archilyzer link start at `lg`; MobileMenu holds only the nav and that link.
-
-### Slice 4 — Results (M, 1 spec edit)
-- `common/components/SearchResults.tsx` card header `:470-538`: `flex items-stretch` → `flex flex-col sm:flex-row`; title `:504` `truncate` → `line-clamp-2 sm:line-clamp-none sm:truncate`; meta `:521-526` → `basis-full sm:basis-auto`; Ask `:528-537` `border-l` → `max-sm:border-t`. Preserve `data-result-slug`/`data-card-header` (`:460-461`), `data-card-open` (`:487`), checkbox aria-label (`:480`).
-- Toolbar `:99-164`: split the `<h2>` into a summary row (`results-summary` + loading spans) and a controls row (`view-toggle`, Copy for AI). `selection-toolbar` `:166-193` gets `max-sm:sticky max-sm:bottom-0 max-sm:z-10 max-sm:bg-background/95 max-sm:pb-safe` only when `selectedCount > 0`; on phone add right padding (`pr-48`) so it does not sit under the `w-44` mini player.
-- **Hit cap**: at most 8 hits across the per-leaf buckets (`:448-456`, `:575-589`) + a "Show all N hits" button rendered **outside** the hit `<ul>` (after `:594`) — the virtualization spec counts `li button`. Expansion state `expandedSlugs: Set<string>` lives in `VirtualResultList` (cards unmount when scrolled out, `:368-396`), passed as an `expanded` prop to the memoised `ResultCard`. `measureElement` (`:373`) already re-measures via ResizeObserver; after collapsing a tall card call `scrollIntoView({block:"nearest"})` on its header.
-- Chart: `chart-options` `:197-201` `open` → `open={userOpen ?? wide}` with `onToggle` (pattern: `ProviderSettings.tsx:100-103`), `wide = useMediaQuery("(min-width:1024px)")`. `ChartView.tsx:71,90,143` `h-[280px]` → `h-[240px] sm:h-[320px]`; `YAxis width` `:126` 52 → 40 narrow; `minTickGap` `:114` 16 → 28 narrow.
-- Spec: `search-results-virtualization.spec.ts:125-149` asserts `[data-result-slug=DENSE] li button` count = 350 (`fixtures/many-results.ts:15`) → click `getByRole("button",{name:/Show all 350 hits/})` first (or assert 8 → click → 350). charts.spec `openChart :30-38` and `:74` need `chart-options` open at 1440 — satisfied by `open = wide`.
-
-### Slice 5 — Ask pane (M, 1 spec edit)
-- `export/app/ask/AskChat.tsx:293`: scroller → `lg:max-h-[calc(100dvh-16rem)] lg:overflow-y-auto` (no max-h below lg). `Composer.tsx:33-39` form → `max-lg:sticky max-lg:bottom-0 max-lg:z-10 max-lg:bg-background max-lg:pb-safe max-lg:-mx-4 max-lg:px-4`; textarea `:58` `text-sm` → `text-base md:text-sm`; on focus `scrollIntoView({block:"end"})` (iOS ignores `interactiveWidget`).
-- Auto-scroll `:53-72`: `nested = useMediaQuery("(min-width:1024px)")`; a `metrics()` helper reads `{scrollTop, scrollHeight, clientHeight}` from `scrollRef.current` when nested else from `document.scrollingElement`; `onScroll` binds to the element when nested, to `window` (passive) otherwise; `jumpToLatest` targets the same. Gotchas: (1) the chat pane is CSS-hidden on `/` (`WorkspaceView.tsx:115`) while sweeps append messages (`useAskChat.ts:1025`) — with document scrolling the effect at `:62-65` would yank the search page: guard with `scrollRef.current?.getClientRects().length > 0`; (2) it fires per streamed token — throttle `window.scrollTo` through rAF. "Jump to latest" pill `:347-355`: second placement inside the sticky composer wrapper (`absolute -top-10 left-1/2`) below lg, CSS-hidden per breakpoint.
-- Grounding: wrap `GroundingPalette` `:166-186` + `PinnedResultsPanel` `:188-213` in `<details open={userOpen ?? wide}>` with a one-line summary (mode + count). `ProviderSettings.tsx:201-301` (max tokens, sweep batch, RPM, Debug) → nested `<details><summary>Advanced</summary>`; `:109-199` stay top-level (`placeholder^="sk-ant"` `:147`, `list="ask-models"` `:127`, mode buttons `:177-192`).
-- Spec: `ask-chat.spec.ts:~280` add `await page.getByText("Advanced",{exact:true}).click()` before "Download debug JSON". `grounding-palette`/`grounding-mode`/`selection-chips` visible at 1440 because `open = wide`.
-
-### Slice 6 — Search bar split (L, 1 spec edit) — do this after 4 and 5
-Anatomy of `common/components/WorkspaceSearchBar.tsx`: ProfilesRow call `:135-147` (def `:657-783`); `<form data-testid="search-form">` `:148-202` with the `mounted` gate/placeholder `:156-165`; submit + `reset-layers` row `:166-201`; Filters `<details>` `:204-588` (summary `:206-233` incl. `filters-summary-channels` `:228`, "N of M channels" `:220-223` used by inline-channel-chips:176-188); channel row incl. `reset-everything` `:246-273` (gated on >1 channel `:235`); group cards `:314-447`; type/audience/availability/date `:453-585`; Advanced `<details>` `:590-652`; helpers `ChannelAllToggle :785`, `NumberField :810`, `LimitField :857`.
-- `common/components/SearchBar.tsx`: the `<form data-testid="search-form">` (Enter-to-submit is relied on by share-current-search:37-38 — the compact leaf input must stay inside the form; all chip-row buttons `type="button"`). Sticky wrapper `max-lg:sticky max-lg:top-14 max-lg:z-10 bg-background` around the compact rows only; the non-compact tree renders outside it. `mounted` placeholder `:164` → `h-[5.5rem]`. Render the `nav` slot **outside** the mounted gate so `workspace-nav` exists pre-hydration as plain anchors.
-- Chip row via slots on the compact leaf: `QueryLeafView.tsx:238-253` already renders row 1 (swatch + input) and row 2 (scope/regex/count/cached). Add `inputTrailing?: ReactNode` (Search submit into row 1) and `trailingControls?: ReactNode` (row 2), threaded through `QueryBuilder.tsx:68-118`; move QueryBuilder's `compact-add-layer`/add-group (`:83-116`) into the "Layers" chip (keep `data-testid="compact-add-layer"`). `SearchBar` uses `isCompactRoot(draftRoot)` (from `lib/searchQuery`): compact → submit in row 1; non-compact → the existing submit row below the tree. Exactly one `search-submit` in the DOM either way. Icon-only submit: `<SearchIcon/><span className="sr-only sm:not-sr-only">Search</span>` (name stays "Search"; keep `data-dirty`). Selects `text-xs` (`QueryLeafView.tsx:186`) → `text-base sm:text-xs`.
-- `common/components/FiltersPanel.tsx`: ProfilesRow + `:234-585` + Advanced `:590-652` nested `<details><summary>Advanced</summary>` + helpers. **Keep an outer `<details data-testid="filters-panel" open={…}>` wrapper** in both containers — channel-group-chips:120-123 and inline-channel-chips:124-127,185,190 locate group cards as `details details` / `details details[open]`. In the sidebar it doubles as the collapse element driven by `filtersCollapsed`/`toggleFiltersCollapsed` (today's preventDefault+toggle pattern `:205-214`).
-- `common/components/FiltersContainer.tsx` exporting `FiltersTrigger` (chip row: when `!wide` the "Filters" chip with active-count badge + `<Sheet>` containing `<FiltersPanel/>`; when `wide` a rail toggle) and `FiltersSidebar` (grid: `<aside className="hidden xl:block">` shell always rendered, `<FiltersPanel/>` only when `wide`). Both use `useMediaQuery("(min-width: 1280px)")` (synchronous `matches` → both agree within a render). Sheet side `useMediaQuery("(min-width: 640px)") ? "right" : "bottom"`, `className="max-h-[90dvh] overflow-y-auto pb-safe"`, plus an "Apply" button calling `commitSearch()` then closing (no `search-submit` testid). Active count from draft state (excluded channels, `draftNov/Nol/Nop/Naa/Nar`, `draftStates.size < 6`, dates).
-- **Share button**: five specs resolve it as `getByTestId("profiles-row").getByRole("button",{name:"Share current search"})` then `getByRole("button",{name:"Link copied!"})` unscoped; both buttons flip on the shared `shareCopied` (`:1487`). Keep the ProfilesRow button inside FiltersPanel and give the bar's icon button `xl:hidden` → exactly one visible at every width (`getByRole` ignores `display:none`; the sheet is unmounted when closed).
-- WorkspaceNav into the bar: `WorkspaceSearchBar` (common) cannot import the export app's `WorkspaceNav` → `nav?: ReactNode` slot. Lift `splitOn/wide/view/setSplit` from `WorkspaceView` into a `WorkspaceViewProvider` + `useWorkspaceView()` (same file), mounted in `SiteWorkspace.tsx:30-36` around bar + view; `WorkspaceNav` reads the context; `WorkspaceView` drops its `<WorkspaceNav>` at `:90-96`. Pane latching `:83-86` untouched.
-- Grid: `SiteWorkspace.tsx:30-36` → `<SearchBar nav={<WorkspaceNav/>}/>` then `<div className="xl:grid xl:grid-cols-[280px_1fr] xl:gap-6"><FiltersSidebar/><WorkspaceView/></div>`. `common/components/TranscriptSearch.tsx:19-28` (hub) adopts the same `[FiltersSidebar | SearchResults]` grid, no nav slot (e2e-hub waits only on `query-builder`).
-- Spec: profile-row.spec "Profile row renders above the QueryBuilder" (boundingBox compare) → assert `profiles-row` is inside `filters-panel` and visible. Add `openFilters(page)` to `export/e2e/helpers.ts` (no-op when `filters-panel` is visible, else click the "Filters" chip); not needed by current specs at 1440 (`filtersCollapsed` defaults false, `SearchSessionContext.tsx:407`).
-
-### Slice 7 — Secondary pages + PostModal (S, 0 spec edits)
-- `export/app/duplicates/DuplicatesClient.tsx`: `FilterPanel :333` `<details open>` → `open={userOpen ?? wide}` + active count in the summary `:334-342`; `Check :425-445` → `ui/checkbox` inside the `<label>` (pattern `WorkspaceSearchBar:457-463`); `MemberRow :497-509` → `flex-wrap`, meta `basis-full sm:basis-auto`; window the list `:283-291` with `useWindowVirtualizer` (copy `scrollMargin` pattern from `SearchResults.tsx:327-361`); card root `:459` `<li>` → `<article aria-label=…>` (VirtualRow `as="li"` would nest li-in-li; the spec uses `getByLabel(/^duplicate cluster/)`).
-- `export/app/components/OfflineManager.tsx:219-252` → `Button size="sm" variant="outline"`, aria-labels unchanged. `export/app/downloads/page.tsx:120-127` anchor → `min-h-10`.
-- `hub/ArchiveShelf.tsx:53` add `pointer-coarse:opacity-100`; `:35` `min-w-52` → `min-w-0 w-full sm:w-auto sm:min-w-52`. `hub/AddArchive.tsx:62` → `min-w-0 w-full sm:w-auto sm:min-w-64` (keep `aria-label="Archive URL"`). `hub/HubOfflineManager.tsx:114` → `flex-wrap`.
-- `common/components/PostModal.tsx:74` → `max-h-[90dvh] overflow-y-auto` (keep `data-post-modal :68`).
-
-### Slice 8 — `export/e2e/responsive.spec.ts` (S)
-`test.use({ viewport:{width:390,height:844}, isMobile:true, hasTouch:true })` (file-level override of the Desktop Chrome project). Use `installRoutes` from helpers (`/duplicates.json` is 404-mocked → empty state, fine for the overflow check). Overflow: `document.documentElement.scrollWidth - clientWidth <= 0` on `/`, `/ask/`, `/downloads/`, `/duplicates/`, `/use-with-ai/`. Menu: "Open menu" → `getByRole("dialog")` contains link "Ask AI". Filters: "Filters" chip → inside the dialog toggle "Livestreams" → Apply → `results-summary` changes. Modal: `/?v=${CHANNEL_SLUG}/${VIDEO_TRANSCRIPT_ONLY}` → `expectModalOpen` → `getByTestId("cue-list").boundingBox().height >= 300` and "Close player" `toBeInViewport()`. Composer: `getByPlaceholder(/Ask about the transcripts/)` `toBeInViewport()` after a mocked answer.
-
-Order rationale: 2 before 3 (sheet z-index depends on the player stack); 6 after 4/5 so the panes are phone-ready when the grid lands.
-
-## Verification
-- Static: `pnpm --filter export run lint`; `pnpm --filter export exec tsc --noEmit`;
- `pnpm --filter common exec tsc --noEmit` (common components changed).
-- Unit: `pnpm --filter export exec tsx --test "app/**/*.test.ts"` (94 pass today);
- `pnpm --filter common test`.
-- Visual: run `next dev` with the e2e fixture env
- (`SETTINGS_FILE=export/test-settings.json SITES_DIR=export/e2e/fixtures/sites SITE_ID=testsite
- pnpm --filter export dev --port 3777`) and screenshot `/`, `/?q=…`, `/ask/`, `/downloads/`,
- `/duplicates/`, `/use-with-ai/` at 360, 390, 640, 768, 1024, 1280, 1440 with a Playwright
- script (pattern: `/home/user/.claude/jobs/a61f2393/tmp/shot.mjs`, run from `export/`).
- Assert `document.documentElement.scrollWidth === innerWidth` on every page.
-- New `export/e2e/responsive.spec.ts` with
- `test.use({ viewport:{width:390,height:844}, isMobile:true, hasTouch:true })`: no horizontal
- overflow on each route; "Open menu" sheet lists nav + theme; Filters sheet opens, unchecking a
- channel + Apply changes `results-summary`; opening a result shows the player view with a cue
- list ≥ 300px tall and the "Close player" button visible without scrolling; `/ask/` shows the
- composer within the first viewport after a message.
-- Full e2e: `pnpm --filter export run e2e` — serial queue lock, ~25 min: run detached
- (`setsid nohup … > log &`) and poll the log; never from a foreground Bash call.
- Also `e2e:hub` and `e2e:2origin` (hub shelf/AddArchive touched).
-- Do not run `pnpm dev:editor` against the real corpus (AGENTS.md).
-
-## Handoff notes for the implementer
-- Read `export/node_modules/next/dist/docs/` before writing Next code (Next 16 differs from
- training data; `AGENTS.md`). Tailwind v4 (`@import "tailwindcss"`, `@theme inline`), shadcn
- via the `radix-ui` umbrella package, lucide icons.
-- The feature inventories that produced this plan are summarised in this file; re-derive
- details from the code, not from memory. Line numbers were measured on `ecf80a5` and will
- drift as slices land — re-locate by content.
-- Ship in the slice order above; commit per slice with the repo's commit style (see `git log`).
diff --git a/plans/full-fetch-forces-media.md b/plans/full-fetch-forces-media.md
@@ -1,196 +0,0 @@
-# The whole-recording fetch downloads anyway, and every metadata rewrite keeps the old version
-
-Written 2026-09-26 (evening) in the fetch_clip session; anchors verified on `main` `151934e9` by one
-Explore pass. Rules: `plans/tools/implementer-rules.md` (one Opus implementer in a worktree, one
-read-only Opus review, the parent merges). Release 10 slice **N**; record in `plans/release-10.md`
-before `## Rollout`, shape of "Slice M, as shipped".
-
-## The operator's ask (verbatim, 2026-09-26)
-
-"Change the editor to download anyway despite having metadata and/or subs, this specific call implies
-that doesn't matter. Save old versions of metadata, maybe as diffs, so we can detect changes."
-
-"This specific call" = the whole-recording fetch (`fetchFullSourceAction`, reached by the MCP's
-`fetch_clip` with `full: true` and umtool's `--full`). Slice M's live proof found it a silent no-op on
-`teamrcn/dbnS-cBgStY` (`handling: "youtube"`, transcript on disk): two yt-dlp passes, both
-`--skip-download`, 7 s, no file — and `metadata.info.json` rewritten.
-
-## Root cause (verified)
-
-`common/ytdlp/downloadOneManaged.ts`:
-- The primary attempt for `handling: "youtube"` is `youtubeHandlingArgs` (:159-169): subs only,
- **always** `--skip-download -t sleep`. `keepSourceVideoOverride` never reaches it.
-- The only branch that downloads real media for youtube handling is attempt 3, the no-subs fallback
- (:1225-1270), gated `!hasAnyTranscriptOnDisk(videoDir) && metadataReportsNoCaptions(videoDir)`
- (:1233-1235). With a transcript on disk it is skipped. When it does run it switches
- `channelConfig` to `handling: "transcribe"` (:1240-1242), uses `transcribeMediaArgs(url,
- fallbackConfig, plan, fmt, /*reuseInfoJson*/ true, selector)` (:1256-1264) with `--load-info-json`
- (:1269-1271), and on success in app mode calls `finalizeAppExtraction` (:1289), which is what
- calls `persistSourceVideo` (:277) when `plan.persist`.
-- `resolvePersistenceDecision` (`common/ytdlp/persistencePlan.ts:58-91`): `keepSourceVideoOverride:
- true` → `persist: true, extractionMode: "app"` unconditionally. The intent is right; it is unreachable.
-- Two callers pass that override: `archiveSourceVideo`
- (`editor/app/channels/[slug]/videos/[id]/videoActions.ts:254-320`, reached from
- `redownloadToArchiveAction` :241-247 = the **"Persist source video"** button in
- `components/cards/SourceVideoSection.tsx:73-86`, and from `fetchFullSourceAction` ~:1094) and the
- bulk pass `common/controller/persistKept.ts:119-135` ("Persist kept now"). Same bug in both.
-- The metadata prefetch (:643-751, `buildPrefetchArgs` :650-659) runs on EVERY attempt when the
- canonical id is known and rewrites `metadata.info.json` with no existence check
- (`backfillReacquire.ts:33-36` says so in words). Other writers: the audio-check primary
- (`transcribeHandlingArgsForAudioCheck` :315, always writes) and the legacy single-video job
- `downloadOneAudio` (`common/ytdlp/runYtdlp.ts:1365`). The window fetch (`fetchWindowManaged.ts:217`),
- `downloadSubsForUrl` (:1198) and the live-chat pass (:466) pass `--no-write-info-json`. The
- metadata scan never writes it (`metadataScanStore.ts:4-21`).
-- No history/diff of anything per video exists; the precedent is `availability.json`'s `history[]`
- (`common/lib/availability-server.ts:38-66`, `sidecar(AVAILABILITY_FILENAME, sidecarField(...))`).
-- A real info-json (`teamrcn/dbnS-cBgStY`, 52,231 bytes, 61 keys): `formats` = 43,496 bytes (83 %,
- signed URLs that differ on every fetch), `thumbnails` 4,923; `epoch`, `_version` and the counters
- (`view_count`, `like_count`, `comment_count`, `channel_follower_count`) drift every fetch.
-- `sidecar()` (`common/lib/sidecar-server.ts:69-96`) declares a bare filename only (no
- subdirectories; refuses `transcript.<x>.<y>`). A new DIRECTORY under `data/<id>/` would need the
- `clips/` treatment in `channelSnapshot.ts:843-870`, `storageLocations.ts:100-101,177`,
- `views/storage.ts:91` and `reconcileVideoDirs.ts:84-96` — so the history is ONE FILE.
-- Tests: `downloadOneManaged.test.ts` covers only the prefetch allow-list; e2e drives the real
- function through `editor/e2e/fixtures/bin/fake-ytdlp.mjs` (prefetch branch :783-789).
- `editor/e2e/saved-videos.spec.ts` ("Persist source video", fixture
- `one-transcribe-channel-with-audio`, slug `test-transcribe`, :106-169) and
- `editor/e2e/fetch-window.spec.ts` (window + full, :225-265 asserts the info-json args, :386 the
- cached full 200) — neither uses a `handling: "youtube"` fixture, so the bug has no coverage.
- Youtube-handling fixtures exist: `editor/e2e/fixtures/test-transcripts/one-youtube-channel*`,
- `youtube-with-playlist`.
-
-## Decisions (made; do not re-open)
-
-1. **One option, `forceMedia: true`, on `ManagedDownloadOpts`** (`downloadOneManaged.ts:98-151`).
- Meaning: "the caller wants the media; a transcript or captions on disk are not a reason to skip".
- Set by `archiveSourceVideo` (both callers) AND by `persistKept.ts:119-135` — "persist kept" means
- persist, and the operator sees a no-op there too. Not set by the download lane, re-acquire or
- import (their semantics are unchanged).
-2. **Mechanics**: for `handling: "youtube"` with `forceMedia`, attempt 3 runs whenever the primary
- succeeded (`lastSucceeded`), regardless of `hasTranscript`/`noCaptions`; it logs ONE line first:
- `forceMedia: downloading the source although a transcript is on disk` (or `… although captions
- exist`). The primary subs pass still runs as today (it is what every re-download does). The
- transcript on disk is NEVER touched: with `forceMedia` and `hasTranscript`, the fallback's
- transcript-producing steps (inline transcription on fallback, any subs → transcript normalize
- the fallback triggers) are skipped, and `finalizeAppExtraction` runs in a **persist-only** mode
- (move the container into the saved-video store; no `audio.<fmt>` extraction — slice M's proof
- left an `audio.mp3` beside an existing transcript, which is waste). With `forceMedia` and NO
- transcript, the fallback behaves exactly as today (download, extract, transcribe inline if
- configured, persist). Transcribe-handling channels: no change (they already download).
- `plan.persist` is true on every `forceMedia` caller today; do not assume it — read the plan.
-3. **Metadata history is one sidecar per video, `metadata.history.json`**, declared with
- `sidecar()` in a new `common/lib/metadataHistory-server.ts` (types + pure diff in
- `common/lib/metadataHistory.ts`, testable without fs). Shape:
- `{ entries: MetadataHistoryEntry[] }`, newest LAST, capped at 200 (drop oldest). An entry:
- ```
- { at: ISO, by: "prefetch" | "audio-check" | "download-one", requestedBy?: string,
- from: { sha256, bytes, at?: ISO (the old file's mtime) }, to: { sha256, bytes },
- changed: { [key]: { from, to } }, // content keys whose normalized value differs
- added: { [key]: value }, removed: { [key]: value },
- counters: { [key]: [from, to] }, // view_count etc., only those that moved
- volatile: string[] } // fingerprinted keys that differed (e.g. "formats")
- ```
- **Normalization**: VOLATILE keys are compared by fingerprint (`sha256` of their JSON) and never
- stored: `formats, requested_formats, requested_downloads, thumbnails, thumbnail, heatmap,
- automatic_captions, subtitles, epoch, _version, _format_sort_fields, url, http_headers,
- format, format_id, format_note, filesize, filesize_approx, tbr, abr, vbr, asr, acodec, vcodec,
- fps, width, height, resolution, aspect_ratio, dynamic_range, protocol, ext, audio_channels,
- container, downloader_options, quality, source_preference, has_drm, language_preference`.
- For `automatic_captions`/`subtitles` ALSO record the language-key lists as a content key
- (`subtitles_langs`, `automatic_captions_langs`) so a caption appearing IS detected. COUNTERS:
- `view_count, like_count, dislike_count, comment_count, channel_follower_count, average_rating,
- repost_count`. Everything else is CONTENT (title, fulltitle, description, duration,
- duration_string, upload_date, timestamp, release_timestamp, availability, live_status, is_live,
- was_live, age_limit, categories, tags, chapters, uploader*, channel*, playable_in_embed,
- media_type, webpage_url, …) — diffed by deep-equal on the raw value, stored whole (a
- description's from/to is exactly what the operator wants to read). Any single stored value
- above 16 KB is replaced by `{ sha256, bytes }`.
- **Append ALWAYS** on a rewrite (the operator wants to know it was rewritten even when only the
- formats moved — an all-volatile entry is ~250 bytes), bounded by the cap; the entry is written
- atomically through the sidecar. When the new file is byte-identical to the old (same sha), write
- nothing. When there was no old file, write nothing (a first write is not a rewrite).
-4. **Interception**: `withMetadataHistory(videoDir, { by, requestedBy }, run)` in the server module:
- snapshot the existing file (bytes + sha + mtime) before `run()`, then after `run()` (success OR
- failure — the prefetch rewrites on failure too) compare and append. Wrap the three writers:
- the prefetch spawn (`downloadOneManaged.ts:658-662`), the audio-check primary attempt, and
- `downloadOneAudio` (`runYtdlp.ts:1365`). `requestedBy` = `opts.persistOrigin?.requestedBy` when
- present. Nothing else changes: the file yt-dlp writes is still the file.
-5. **Surface** (small, read-only): the video page's source/metadata card gets one line when the
- history has entries — `Metadata rewritten N× · last <relative time> by <by>: <changed keys or
- "nothing meaningful (formats only)">` — and a `<details>` listing the entries newest first with
- the changed keys and, per key, from → to (strings truncated at 300 chars, full text in `title=`).
- Build it as a pure view in `common/views/` (`metadataHistoryView.ts`) fed by the loaded sidecar,
- in the style of the other views there; no new route, no client state.
-6. No new job kind, no new directory, no eviction: the file is bounded and lives with the video.
-
-## Implementation (one Opus slice, branch `editor/full-fetch-media`, worktree
-`/home/user/Projects/editor-full-fetch-media`, ports editor 3601 / test 3611 / export 3610)
-
-1. `common/lib/metadataHistory.ts` (pure): the key sets, `normalizeForDiff`, `diffMetadata(old,
- new) → { changed, added, removed, counters, volatile }`, `appendEntry(history, entry, cap=200)`,
- the 16 KB value guard. Tests: `metadataHistory.test.ts` — formats-only change → all-volatile
- entry with empty `changed`; a title change → `changed.title {from,to}`; a new caption language →
- `changed.subtitles_langs`; counters → `counters` only; cap at 200 drops the oldest; the 16 KB
- guard; byte-identical → `null` (no entry).
-2. `common/lib/metadataHistory-server.ts`: `sidecar("metadata.history.json", …)` (check
- `SIDECAR_FILENAMES`' enumeration test and `PREFETCH_OWN_FILES` in `discardPrefetchDir`: a dir
- holding this file is never prefetch-only, so it must NOT be in the allow-list — say so in a
- comment), `withMetadataHistory`, `loadMetadataHistory`. Test with temp dirs: rewrite → one entry;
- identical rewrite → none; no prior file → none; failure inside `run` still records the rewrite.
-3. `downloadOneManaged.ts`: `forceMedia` on the opts; the attempt-3 gate and log line; the
- persist-only finalize when a transcript exists; the three `withMetadataHistory` wraps
- (prefetch, audio-check primary) + `runYtdlp.ts` `downloadOneAudio`. Keep every existing arg
- ordering the e2e asserts (`fetch-window.spec.ts:225-265`).
-4. Callers: `videoActions.ts` `archiveSourceVideo` and `persistKept.ts` pass `forceMedia: true`.
- The "Persist source video" button's label/aria-label are contracts — unchanged.
-5. The view + the card line + `<details>` (5 above). `videoOperations.ts`/the video page loader
- reads the sidecar once (follow how `availability.json` reaches the page).
-6. e2e: (a) extend `saved-videos.spec.ts` or add `persist-youtube-handling.spec.ts`: a
- `handling: "youtube"` fixture video WITH a transcript on disk → "Persist source video" → the
- fake yt-dlp receives a media download (not `--skip-download`) on the fallback pass, the pointer
- lands, `saved-video.json` exists, the transcript's bytes are unchanged, NO `audio.<fmt>` is
- created; (b) `fetch-window.spec.ts`: the full path on the same fixture → 202 → done with a file;
- (c) metadata history: two downloads of one fixture video where the fake yt-dlp's info-json
- differs the second time (add a knob to `fake-ytdlp.mjs` — e.g. an env or a marker file the
- spec sets — that changes `title` and bumps `view_count`; keep the default output byte-stable)
- → `metadata.history.json` has one entry with `changed.title` and `counters.view_count`; the
- video page shows "Metadata rewritten 1×" and the from → to. Check `fake-ytdlp.mjs` for an
- existing variation knob before adding one.
-7. Docs: `CHANNEL.md`/`SETTINGS.md` are generated — nothing there. One paragraph in `AGENTS.md`'s
- "Clips and report-to-video" (after the fetch_clip paragraph): `full: true` / "Persist source
- video" download the source even when a transcript or captions exist; every rewrite of
- `metadata.info.json` appends to `metadata.history.json` (the old values of changed content
- keys; formats/thumbnails only by fingerprint). Also the README's saved-video mention if there
- is one (grep "Persist source video"). `plans/FACTS.md`: amend the slice M facts paragraph's
- "silent no-op" sentence to say fixed by slice N.
-8. Record: `### Slice N, as shipped — the whole-recording fetch downloads anyway; metadata history
- (2026-09-26)` in `plans/release-10.md` before `## Rollout`; `[Unreleased]` bullets in
- `editor/CHANGELOG.md` (two: the fetch, the history).
-
-## Gates (worktree root)
-
-tsc `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`; `pnpm --filter
-yt-dlp-transcript-common test` (1,954 baseline → new count); editor unit `pnpm exec tsx --test
-"app/**/*.test.ts"` in `editor/` (85); `pnpm run test:scripts` (173 + 1 skip); mcp unchanged (269);
-`pnpm --filter editor exec next build`; e2e from the worktree root (queued, detached, `export/public`
-links in place per the rules): `saved-videos.spec.ts fetch-window.spec.ts <the new spec>` plus every
-spec that greps `downloadOneManaged|Persist source video|persist-kept|redownload` (list them in the
-record). The numbers tool: none (say so).
-
-## Rollout (parent)
-
-The live :3001 editor must be RESTARTED to pick this up — that is the operator's runbook step 1
-(release 10 is merged, not rolled out; this slice joins it, FINAL moves again). After the restart:
-`fetch_clip` with `full: true` on `teamrcn/dbnS-cBgStY` (the slice M no-op) → 202 → done with a file
-under `transcripts/saved-videos/teamrcn/dbnS-cBgStY/`, the transcript's mtime unchanged, no
-`audio.mp3`; and `data/dbnS-cBgStY/metadata.history.json` gains one entry (its `changed` may be
-empty — that is a valid "rewritten, nothing meaningful moved" record). Then the same on a video whose
-title has changed upstream, if one is known, to see a `changed.title`.
-
-## Known limitations
-
-- The history starts at the first rewrite AFTER this ships; earlier rewrites are gone.
-- `metadata.history.json` is per video and capped at 200; a corpus-wide "what changed lately" list
- is a later slice (the data is there).
-- `forceMedia` on the bulk "Persist kept now" pass over a youtube-handling channel now downloads
- every kept video's source — that is what the button says, but it is new bytes.
diff --git a/plans/homepage-deploy-from-ui.md b/plans/homepage-deploy-from-ui.md
@@ -1,147 +0,0 @@
-# Deploy the homepage from the editor
-
-Written 2026-09-26 (evening) by the slice N implementer, on the operator's ask. Rules:
-`plans/tools/implementer-rules.md` (one Opus implementer in a worktree, one read-only Opus review,
-the parent merges). Small: one slice, editor + ops only; nothing in `homepage/` or `export/`
-changes.
-
-## The operator's ask (verbatim, 2026-09-26)
-
-"Is there a way to redeploy archilyzer.pages.dev from the UI? If not, work adding one into the plan
-and deploy it yourself in the meantime"
-
-**There is not.**
-- `/sites` → Hub (`editor/app/sites/page.tsx:183-201`) builds and deploys the HUB
- (`HubBuildButtons.tsx`, `sites/lib/hubActions.ts`: job kinds `build-hub`, `deploy-hub`,
- `build-deploy-hub`).
-- For the homepage, the same section only says, in prose, that the `homepage` package "deploys to
- its own project, `archilyzer`, with `archilyzer deploy homepage`". That is a CLI, with no job, no
- `/jobs` row and no `pnpm ops` verb.
-
-**Done in the meantime.**
-- 2026-09-26 17:18–17:19, from the primary checkout at `main` `555bc454`, with the release-10
- runbook's own `~/reports/release-10/scripts/r10-home.sh`. Its guards: FINAL `4afa08d8` is an
- ancestor of HEAD; `data-accent=` is present in `homepage/out/index.html`.
-- `archilyzer build homepage` took 47 s. `archilyzer deploy homepage` took 38 s: 135 files
- uploaded, 41 already there, production branch `main`, deployment
- `https://857e0092.archilyzer.pages.dev`.
-- `https://archilyzer.pages.dev/` answers 200 with `data-accent="signal"`, and `/icons/icon.svg`
- carries the Found-line mark (`#151b20 #3f4c56 #e7edf1`).
-- The primary checkout's `git status` stayed clean.
-- **This is the homepage half of the release-10 runbook's step 5, done early.** Its logs are in
- `~/reports/release-10/tmp/r10-home-{build,deploy}.log`.
-- **The homepage's `/changelog` renders `export/CHANGELOG.md` as it stands**, so L1's three hub
- bullets are public there under `[Unreleased]` until the operator's re-cut and a redeploy.
-
-## Verified anchors (primary checkout, `main` `555bc454`)
-
-- `common/publish/build.ts:938-1021`:
- - `composeHomepage` runs `pnpm run compose` in `homepage/`.
- - `buildHomepage` runs compose, then `pnpm exec next build`. `pnpm exec`, so `prebuild` (which
- runs `build:index`, a WRITER) does not run; the index is read as it stands.
- - `homepageDeployArgs` and `deployHomepage` take `previewBranch?`. They throw when
- `homepage/out/index.html` is missing, and otherwise deploy to the constant
- `HOMEPAGE_PAGES_PROJECT` with `--branch main` for production.
-- `common/bin/archilyzer.ts:117-125` (`build homepage`), `:160-172` (`deploy homepage [--preview]`).
-- The hub pattern to mirror:
- - `editor/app/sites/lib/hubActions.ts`: `runManagedFunction`; build on queue `build`; deploy and
- build-deploy on queue `deploy`; refusals before any job; build-deploy is one job and one log.
- - `editor/app/sites/components/HubBuildButtons.tsx`: one lane at a time, "Deploy after build"
- unticked.
- - `editor/app/api/ops/{build-hub,deploy-hub}/route.ts` + `_lib.ts`.
- - `scripts/archilyzer-ops.mjs:104-107` (the verb list) and `:302` (the help text), with their
- tests in `scripts/archilyzer-ops.test.mjs`.
- - `editor/e2e/ops-api.spec.ts:1094-` (deploy-hub refusals).
- - `editor/app/sites/page.tsx:30-45` (`BUILD_KINDS`: the Pool lists only its own kinds, and each
- section has its own console).
-
-## Decisions
-
-1. **Three job kinds, as for the hub:**
- - `build-homepage` on queue `build`. It writes `homepage/out`, not `export/out`, so it cannot
- race a site build for `export/`, but `next build` is heavy and the build queue serialises
- heavy builds.
- - `deploy-homepage` and `build-deploy-homepage` on queue `deploy`.
- - Bodies: `buildHomepage` and `deployHomepage` unchanged. The build-deploy runs `buildHomepage`,
- and deploys only on exit 0 (the runbook's rule: a failed build never reaches the deploy,
- because `homepage/out` still holds the previous build).
-2. **Refusals before any job:**
- - a bad preview name (`previewBranchProblem`);
- - for a deploy-only, no build (`homepage/out/index.html` missing).
- - The job re-checks both. No project check: the project is the constant `archilyzer`.
-3. **The surface: a "Homepage" section on `/sites`**, after Hub. Its prose moves there from the Hub
- paragraph.
- - Buttons "Build homepage" (with "Deploy after build", unticked) and "Deploy homepage", in a
- `JobLane` exactly like `HubBuildButtons`.
- - A preview-branch field, as the hub's ops verb has.
- - One line naming what a deploy ships: `homepage/out` built <mtime>, to `archilyzer`
- (production), and the live URL (`PROJECT_URL`).
- - A note that the homepage reads the index as it stands, so run Build index first when the
- numbers should move.
-4. **Ops:**
- - `pnpm ops build-homepage [--json '{"deploy":true}']` and `pnpm ops deploy-homepage
- [--preview <branch>]`;
- - routes `/api/ops/build-homepage` and `/api/ops/deploy-homepage`, mirroring the hub's
- (`previewUrl` from `previewAliasUrl(HOMEPAGE_PAGES_PROJECT, branch)`).
-5. **No brand check in the job.** The runbook's `data-accent=` grep is a release-10 rollout guard,
- not a property of every future build.
-
-## Implementation
-
-1. `editor/app/sites/lib/homepageDeployActions.ts`: `buildHomepageAction`, `deployHomepageAction`,
- `buildAndDeployHomepageAction` (decisions 1–2). A pure `builtHomepageProblem(outDir)` goes in
- `common/lib/builtExport.ts` beside `builtHubProblem`, with a unit test.
-2. `editor/app/sites/components/HomepageBuildButtons.tsx` and the `/sites` section (decision 3).
- The hub paragraph loses its homepage sentence.
-3. The two ops routes and the two verbs; `archilyzer-ops.test.mjs` for the verb list and the help
- text.
-4. e2e:
- - `ops-api.spec.ts` + deploy-homepage refuses a missing build and a bad preview name.
- - `sites` spec(s): the section renders, and the Build homepage lane starts a `build-homepage`
- job. Check how the hub buttons' spec avoids a real `next build` / wrangler before choosing:
- the fake-binary env the editor suite uses, or a refusal-only assertion.
- - Never run a real deploy from e2e (see the release 7 lessons: e2e can start a real deploy).
-5. Docs: the `/sites` prose; README/AGENTS only if they name `archilyzer deploy homepage` as the
- only way (grep).
-6. Record + `[Unreleased]` bullet.
-
-## Gates
-
-tsc; common; editor unit; `test:scripts`; mcp unchanged; `pnpm --filter editor exec next build`;
-e2e `ops-api.spec.ts` + the sites spec(s) touched + every spec that greps `deploy-hub|build-hub`.
-Numbers tool: none.
-
-## Rollout
-
-The live :3001 editor must be restarted to show the section, which fits the next editor restart.
-After it: Build homepage with Deploy after build unticked, then Deploy homepage, and the job's log
-ends with the Pages URL.
-
-## As shipped (2026-09-28, release 11 slice O4)
-
-Built as planned; record: [`release-11.md`](release-11.md), "Slice O4, as shipped". What the
-build corrected here:
-- **The ops preview is a body key, not a flag.** `pnpm ops deploy-homepage [--preview <branch>]`
- (decision 4) is `pnpm ops deploy-homepage --json '{"preview":"<branch>"}'`: the ops client has no
- per-verb flags, and `deploy-hub` takes its preview the same way.
-- **No job-kind registry entries.** The hub's three kinds have none in `common/jobs/jobKinds.ts`,
- and neither does any publish kind (`build-export`, `deploy-export`, `build-deploy`, `build-all`,
- `build-deploy-all`). A kind with no entry shows its raw name on `/jobs` and is not drainable, not
- replayable and needs no media, which is right for all three. Mirrored: the kinds are declared
- where the hub's are, in the action's `kind` and in `/sites`' `BUILD_KINDS` comment.
-- **`homepageOutDir(paths)` is exported from `common/publish/build.ts`.** The editor needs
- `homepage/out` for `builtHomepageProblem` and for "built <when>", and `homepageDir` was private.
- After review, `deployHomepage` takes its directory from `homepageOutDir` too, with no behaviour
- change. Otherwise `buildHomepage` and `deployHomepage` are unchanged, so the job's own refusal
- keeps its sentence ("… — run archilyzer build homepage first"). The refusal before the job says
- "… — build the homepage first".
-- **`JobLane` needed a fix to be testable at all.** Under `next dev`, Strict Mode's
- mount → cleanup → mount dropped every update of a lane's one launch, so it sat on "Starting…"
- while its job ran. Production mounts once and never showed it; no spec had clicked a lane
- button before.
-- **How the e2e avoids a real `next build` and wrangler.** There is no fake wrangler, and the hub's
- buttons have no spec. The Build homepage spec holds the `build` and `deploy` queues with
- `/api/test/stuck-job`, so its job only queues, and it cancels the job from the lane before it
- starts. The deploy-homepage refusals run with both queues held the same way (after review; each
- test held only one queue at first). The missing-build refusal is asked only
- when the checkout has no `homepage/out/index.html`, and asked as a preview.
diff --git a/plans/kofi-mark-on-sites.md b/plans/kofi-mark-on-sites.md
@@ -1,84 +0,0 @@
-# The Ko-fi mark in every site's social row (release 10 slice O)
-
-Written 2026-09-26 (evening). Operator, verbatim: "I downloaded ~/Downloads/kofi_brandasset.zip for
-the kofi logo official assets, use them to show kofi in the social section on all sites." This
-SUPERSEDES the 2026-09-25 ruling that a site build carries no Ko-fi link (the "bare link, no copy,
-hub only" rule in `export/app/components/Footer.tsx:98-110` and `export/e2e/site-branding.spec.ts:48-54`).
-"No copy" still holds: the mark is an icon with the accessible name "Ko-fi", nothing else.
-
-## Verified anchors (`main` a575685d)
-
-- `export/app/components/Footer.tsx`: social row `:111-127` — `<ul>` of `<a title aria-label target=_blank
- rel=noopener noreferrer class="inline-block w-5 h-5 text-muted-foreground hover:text-brand … [&_svg]:w-full
- [&_svg]:h-full" dangerouslySetInnerHTML={sizeSocialSvg(link.svg)}>`, rendered only when
- `socialLinks.length > 0`. Ko-fi text link `:101-110`, `instanceMode() === "hub"` only, `KOFI_URL` from
- `common/lib/project.ts:39` (`https://ko-fi.com/archilyzer`). The same Footer renders the hub build
- (`instanceMode()` from `export/app/lib/mode`).
-- Social SVGs are admin data (`settings.json`/`site.json` `socialLinks`, `normalizeSocialSvg` forces
- `fill="currentColor"`, `common/lib/settingsSchema.ts:1290-1330`). The Ko-fi mark is NOT admin data
- and does NOT go through that path: it is the project's own asset, rendered in its official colours.
-- Tracked static assets precedent: `export/public/{file,globe,next,vercel,window}.svg` (`git ls-files`).
- The rest of `export/public` is gitignored build output; a new tracked file beside those five is fine.
-- The assets, unpacked at `/home/user/.claude/jobs/c0baff27/tmp/kofi/kofi_brandasset/`: `kofi_symbol.svg`
- (3,234 bytes, `viewBox="0 0 241 194"`, fills `#FF5A16`, `#202020`, white, one `<mask id="mask0_1_219">`),
- `kofi_logo.svg` (wordmark, 11 KB), PNG badges. Use ONLY `kofi_symbol.svg`, byte-for-byte
- (official colours, no recolouring — a brand asset is used as shipped).
-- Specs: `export/e2e/site-branding.spec.ts:25` "footer renders the site's social links" (fixture
- `export/e2e/fixtures/sites/testsite/site.json:9` has `socialLinks`), `:48` "a site build carries no
- Ko-fi link" (asserts `getByRole("link", {name: "Ko-fi"})` count 0 and no `a[href=KOFI_URL]`).
- `homepage/e2e/marketing.spec.ts:129` "the footer carries a bare Ko-fi link" — homepage, untouched.
-
-## Decisions (made)
-
-1. **One asset, one place:** `export/public/kofi-symbol.svg` = the official `kofi_symbol.svg`, tracked,
- unmodified. (The mask id is harmless in an `<img>`; it would collide if inlined twice, which is why
- it is NOT inlined.)
-2. **Render**: the LAST `<li>` of the footer's social `<ul>`, on EVERY export build (site and hub):
- `<a href={KOFI_URL} title="Ko-fi" aria-label="Ko-fi" target="_blank" rel="noopener noreferrer"
- className="inline-block w-5 h-5 …"><img src="/kofi-symbol.svg" alt="" width={20} height={20}
- className="w-full h-full" /></a>`. The `<ul>` now renders whenever there is at least one item, i.e.
- always (Ko-fi is always present); the `socialLinks.length > 0` gate moves to the mapped items. The
- accessible name is exactly "Ko-fi"; no visible text.
-3. **The hub's text link `:101-110` is removed** — one Ko-fi per footer, the mark. Its comment block is
- replaced by one saying: the mark is on every build by the operator's 2026-09-26 ruling; it is the
- project's tip jar, rendered in Ko-fi's official colours from the vendored official asset; it never
- goes through `normalizeSocialSvg` (that path recolours admin icons to currentColor).
-4. **Homepage untouched** (its "Elsewhere" column keeps the bare text link; a follow-up may swap it for
- the mark — not this slice). Sites with `pwa`/offline: the image is a static file under `/`, cached
- like the icons; check `export/app/lib/offlineCache.ts` / the service-worker precache list and add
- the path if static assets are enumerated there.
-5. **Dark theme**: the official mark has a `#202020` outline and a white cup; on a dark footer the
- outline is invisible but the cup and the `#FF5A16` heart read. Accept as-is (official asset), take
- one light and one dark screenshot for the record (the e2e harness's screenshot helper, or a
- Playwright `page.screenshot` in a throwaway script — see `scripts/` for the shot precedent; use
- `localhost`, not `127.0.0.1`).
-
-## Implementation (one Opus slice, branch `export/kofi-mark`, its own worktree)
-
-1. `git add` the asset at `export/public/kofi-symbol.svg` (copy from the unpacked zip; verify `sha256sum`
- equals the zip's file). 2. Footer change per decisions 2–3. 3. `site-branding.spec.ts`: replace `:48-54`
- with "every build carries the Ko-fi mark in the social row": the link with accessible name "Ko-fi"
- exists once, `href` = `KOFI_URL`, opens in a new tab, contains an `img[src="/kofi-symbol.svg"]`, and
- the image resolves (200) — and it is the LAST item of the social list; run the same assertion on the
- hub build's footer in whichever hub spec renders the footer (grep `export/e2e` for the hub fixture),
- and assert there is exactly ONE Ko-fi link on the hub (the text link is gone). 4. Docs: SITE.md/SETTINGS.md
- are generated — nothing. One sentence in `export/README.md` (if it describes the footer) and in
- `AGENTS.md` only if it mentions the Ko-fi rule (grep "Ko-fi"; today it does not — then nothing).
- 5. Record: `### Slice O, as shipped — the Ko-fi mark on every site (2026-09-26)` in
- `plans/release-10.md` before `## Rollout`, shape of Slice M/N; one `[Unreleased]` bullet in
- `export/CHANGELOG.md` (the export's, not the editor's — check which changelog the sites' release
- notes read; `editor/CHANGELOG.md` if the export has none).
-
-## Gates (worktree root)
-
-tsc; `pnpm --filter export exec next build` (NOT `run build`); export e2e, detached and queued, from the
-worktree root: `node scripts/worktree.mjs run -- pnpm --filter export run e2e site-branding.spec.ts <the
-hub spec(s) touched>` and then the FULL export suite (204 at integration) because the footer is on every
-page; `export/public` links from the primary per the rules (and note `kofi-symbol.svg` is a TRACKED file,
-not a link — do not symlink over it). Numbers tool: none.
-
-## Rollout (parent)
-
-Every site + the hub rebuild and redeploy: runbook step 5 (`pnpm ops build-deploy`) + step 6 hub — this
-slice joins release 10's rollout, FINAL moves. Live check: `curl -sI https://<site>/kofi-symbol.svg` 200
-and the footer's Ko-fi link on each site.
diff --git a/plans/landed-2026-10.md b/plans/landed-2026-10.md
@@ -1,91 +0,0 @@
-# Landed without a plan — `main`, 2026-10-05 → 2026-10-09
-
-`main`'s first-parent history `39abec18..e921f82f`: 70 entries, 246 commits. Merged into `r18/integration` at `f2fd11a7`
-(through `edadc712`), `ff9c6b7d` (through `f6137a04`) and `4cffda3f` (the rest). The report-site slices have their own record,
-[`report-sites.md`](report-sites.md); everything else here had none. Each row is the merge and what it landed.
-FACTS has the verified details for the starred rows ("Verified 2026-10-09").
-
-## Report sites (recorded in `report-sites.md`)
-
-| merge | what |
-|---|---|
-| `6c140bc1` … `b94742c7` | R0–R8 + R4b: the citation model and report document, site keys, evidence media, compose, pages, consumers, converters, the editor's Reports tab, the cited-site e2e |
-| `89d65ae0` | `site.json` `search` switch replaces `publish`; search off = report-only; `export start` serves moment dirs |
-| `30447593` | per-report revision history (a bare git repo per report, history page + `history.json`, dumb-HTTP clone) |
-| `a1a98c2c` | per-report HTML, PDF, Markdown and evidence-pack exports; `reports-export` job; shared publish size limit |
-
-## Reports and citations
-
-| merge | what |
-|---|---|
-| `32c49f45` | a site's report ids use the report document's id rule |
-| `bf5050b7` | a report claim may carry a short title; a source may carry a note |
-| `7473e3bb` | a report quote is checked against every transcript of the record; its moment shows the one that matched |
-| `a01b9f63` | export: one report = the home page; the index without a duplicate title |
-| `4f6ee08a` | report series tag; no index of one; lean index cards |
-| `53014ad1` | report polish: claim flag, series line, byline + attribution, source rail, citation origin, three reading tiers |
-| `b26eaff0`, `f986152f` | report header: our heading, one date/revision line, the reviewed document as a citation card |
-| `4fa5c46b`, `694217b9` | evidence clips stop at the recording's end; prepare and compose share the clamped cited span |
-| `f6137a04` | a `#<id>` link in report markdown stays in the tab |
-| `125163ab` | a report can carry a video |
-| `e99f0e4f` | a cite label may hold an editorial `[insertion]` |
-| `7f688cf9` | export: `serve-out` binds `HOST` when set |
-
-## Sources and posts
-
-| merge | what |
-|---|---|
-| `9cb6bf99` | a metadata-scan members-only or private verdict keeps a video out of the auto-download queue |
-| `96812e72` | `archilyzer feeds backfill-metadata`: a podcast feed's titles, dates and descriptions onto feed-imported records through a history-recorded writer; job kind + ops route |
-| `21cc5741` | XenForo threads as a posts source: paced fetch, saved-page import, forum session Connect, post capture |
-| `ea3bc5cc` | forum mirror hosts |
-| `c85b7155` | archive.org items and files as a video/audio source: polite import, provenance, file player, archive.org + torrent links on citations |
-| `dc6a3c3c` | archive.org files over BitTorrent via aria2c, seeded; verified direct-download fallback; no yt-dlp for archive.org |
-| `5f88bfee`, `c9fcdc80` | archive.org file records: clean titles, dates from the file name or folder; `archive-org refresh` |
-| `b8466d24` | BitChute as a platform: detection, polite import and pacing, native player, relabel pass |
-| `33db0dd4` | Wayback captures named by what they copy; `wayback.json` provenance; `wayback refresh`; archived-copy links |
-| `edadc712` | a one-off Odysee or BitChute import waits a floor after the last one there |
-| `0adfcb23` | a renamed social channel's posts read as their new slug |
-| `dafdd904` | an older X walk can start at a date; Kiwi Farms player uploads are video media |
-| `283dce07` | forum capture downloads the media a post's page holds now |
-
-## Transcripts
-
-| merge | what |
-|---|---|
-| `200a3105` | one caption-track rule: en-orig first, empty tracks fall through; cue-block VTTs parse; a one-shot index re-read |
-| `e506f738` | every English track searchable; the reader and MCP choose a track; alternates only where words differ |
-| `4f1d647f` ★ | `pnpm ops transcribe` / `POST /api/ops/transcribe`: one local file through the editor's workers (`3524be34`, `6814ae6f`) |
-| `772ae618` ★ | `"words": true` returns the engine's word timings (`6d94995f`) |
-
-## Editor and ops
-
-| merge | what |
-|---|---|
-| `41029f40` ★ | refresh one video's metadata from the video page and over ops; refuses a video with no `data/<id>/` (`26dad6a0`, `9c1df123`) |
-| `9e1e8cc2` ★ | rename and delete a social channel from its page; channel create/rename/delete/sites over ops (`b16653af`) |
-| `0c9fbe9d` | Rumble clip windows retry with `-extension_picky 0` |
-| `de11b507` ★ | fetch-windows: a paced batch of clip windows, one job per platform; the /jobs row names who asked, for what, how many (`414a7bb2`, `4e404ff9`, `103d81af`) |
-| `f011109d`, `1a17d841` | a window's own URL picks its queue and its platform args |
-| `a2448b11` | one Rumble page load per window |
-| `903a4d0a` | Rumble windows 120 s apart, across runs |
-| `20ad060a` | page titles lose their lead paragraphs; /channels' header wraps |
-| `19b03898` | e2e: export-search's filter checkboxes located by exact name |
-
-## umtool and report-to-video
-
-| merge | what |
-|---|---|
-| `e2c6eb14` | report-to-video assembles a long cut in crossfaded batches, then joins them |
-| `ddaef3f0` | deck: posts ride the whole clip, `shotMaxHeight`, web platform, per-post variant; `snapLead`/`snapTail` |
-| `8cf1201f` | post cards: accent, logo, flag |
-| `de8eebab` | umtool takes: alternative renders of part of a cut, side by side, judged |
-| `fac257cf`, `3d09ee71`, `526b2b22` | teaser rows that change in place (per-line role and hold); a second tier pops with its line; a small tier above |
-| `f294d107` | thread rail, flips panel, panning screenshots, the date always shows |
-| `38c11e41` | the renderer runs without a display |
-| `dc35dfd7` | dim dots ahead; outcomes wait for the rail |
-| `e921f82f` ★ | umtool articles + notes: `/sites` (every site's articles, site pages, media, workspace files); the notes store (`notes.json` beside a report, never published, exported or committed to history), `/api/notes`, `umtool notes` CLI + agent digest; timed, take and edit notes; the timeline and structure editors; kinds declared on the registry (`d319982f` … `847b8188`, 20 commits) |
-
-## Plans commits
-
-`1af693a4`, `86e49763`, `53c8d776`, `771a55be` — the report-sites plan and its record.
diff --git a/plans/mcp-fetch-clip.md b/plans/mcp-fetch-clip.md
@@ -1,307 +0,0 @@
-# `fetch_clip` — the MCP asks the editor for clip media (no yt-dlp by hand)
-
-Written 2026-09-26 in plan mode; self-contained for a fresh session. Anchors verified on `main`
-`c9223978` by two Explore passes and one Plan pass. Rules: `plans/tools/implementer-rules.md` (one
-Opus implementer in a worktree, one read-only Opus review, the parent merges). Memory to read first:
-`no-yt-dlp-by-hand`, `release-9-in-flight`.
-
-## Context
-
-The operator's rule since 2026-09-20: every fetch goes through Archilyzer (editor lanes, umtool
-actions), never yt-dlp by hand — the editor path has the cookie policy, the per-platform sleeps,
-the 429 cooldown, and provenance. umtool already obeys it (`umtool/report-to-video/fetch-via-editor.mjs`
-→ `POST /api/media/fetch-window`). The MCP server (`mcp/`) does not: it has no media tool, and the
-docs it points agents at (`README.md` "Clips and video", `AGENTS.md` "Clips and report-to-video")
-still say "use `yt-dlp --download-sections`". An agent following `/ask` or `/sweep` that needs the
-clip behind a citation therefore either shells out to yt-dlp (unpaced, no cookies, bytes outside the
-corpus) or stops. This adds ONE tool, `fetch_clip`, that calls the editor's existing fetch-window
-job, and rewrites the guidance so the tool is the way and yt-dlp is only the no-editor fallback.
-
-## What exists (verified)
-
-- **Editor endpoint** `POST /api/media/fetch-window` (`editor/app/api/media/fetch-window/route.ts`),
- auth `Authorization: Bearer $WORKER_TOKEN` (`authorizeWorkerRequest`, `common/lib/workerToken.ts:23`;
- 503 "worker endpoint disabled" when the editor has no token, 401 on a bad one). Body
- `{channelSlug, videoId, webpageUrl?, from, to, pad?, requestedBy (required), manifest?, clipId?, reason?}`.
- Window ≤ `MAX_CLIP_WINDOW_SECONDS` = 900 (`common/lib/clipWindow.ts:53`). Responses: 200
- `{cached:true, file, from, to, bytes, provenance}` (a NARROWER request inside an existing window
- returns the wider file and ITS span), 202 `{cached:false, jobId, file, from, to}`, 409
- `{error, cooldownMs, platform}`, 400/404/503/507 `{error}`. Poll `GET /api/media/fetch-window/{jobId}`
- → `{status: queued|running|done|failed|cancelled, jobId, file?, from?, to?, bytes?, error?}` (`error`
- = last 2000 bytes of the job log). File: `channels/<slug>/data/<id>/clips/<from>-<to>.mp4`
- (`.toFixed(2)`, 720p H.264/AAC) + `<from>-<to>.json` provenance; never writes `metadata.info.json`;
- pruned only by `evict-clips` by age (no TTL). Job kind `fetch-window` (`common/jobs/jobKinds.ts:255`)
- is platform-queued, paced with `--sleep-requests 1`, records the platform backoff on a 429.
-- **Reference client** `umtool/report-to-video/fetch-via-editor.mjs`: env `ARCHILYZER_EDITOR_URL`
- (default `http://localhost:3001`) + `WORKER_TOKEN`; `POLL_MS` 1000; pad default 3 s;
- `from = max(0, start-pad).toFixed(2)`, `to = (end+pad).toFixed(2)`; `reason` ≤ 400 chars. The ops
- script `scripts/archilyzer-ops.mjs:311-318` uses the same env names. No shared HTTP client in
- `common/` — the tool gets its own small one.
-- **MCP shape** `mcp/src/server.ts`: `TOOLS: Tool[]` literal JSON-schema array (~:299, `SOURCE_ARG`
- spread ~:173); `createServer(...)` :924; the `tools/call` handler :949 resolves `source` FIRST
- (`registry.resolve(args.source)`), dispatches through one `switch`, and passes every result
- through `withCorpus()` (~:907, appends "(corpus: …)"). Handlers return `text()`/`errorText()`
- (`{content:[{type:"text",text}], isError?}`). No tool does authenticated HTTP or polling today.
- `findVideo(source, videoId, channelHint?)` (`mcp/src/search.ts:924`) returns the record incl.
- `webpageUrl`. Tests: `tsx --test src/*.test.ts`, in-memory client harness (`sourceRegistry.test.ts:112-127`
- `connect()` + `firstText()`); `protocol.test.ts:33-48` pins the EXACT tool list `EXPECTED_TOOLS`.
- `instructions.test.ts:24-65` requires every backticked snake_case token in plan text to be a real
- tool (or listed in `NOT_TOOLS` :47). `mcp/src/instructions.ts` builds the `ask_plan`/`sweep_plan`
- text and never mentions yt-dlp today. `.claude/commands/{ask,sweep}.md` need no change.
-- **Rumble ids (the one real trap).** A published record's `id` is yt-dlp's native id = the EMBED id
- (`common/lib/transcripts-server.ts:100-103`; live proof: `the-quartering-rumble/data/v1007ay/metadata.info.json`
- has `"id": "vxe1ae"`, the export manifest keys by `vxe1ae`). Citations carry the embed id. The
- editor's dir is the canonical id from the URL SLUG (`videoDirOf`, `videoActions.ts:887`;
- `extractVideoId`, `common/lib/videoId.ts:11`, Rumble branch :21-29). Passing the embed id would
- create a NEW `data/vxe1ae/` and fetch `rumble.com/vxe1ae` — wrong dir. Nothing in the editor maps
- embed → slug. But the record's `webpageUrl` (`transcripts-server.ts:118`, `meta.webpage_url`) IS
- the slug URL, and the MCP already reads it. YouTube: canonical === id.
-
-## Decisions (made; do not re-open)
-
-Tool name `fetch_clip`. Env `ARCHILYZER_EDITOR_URL` (default `http://localhost:3001`) + `WORKER_TOKEN`
-(the client family's names). ONE tool that waits up to `wait_seconds` (default 90, max 300) and, if
-the job is still running, returns `queued` + `jobId` and says to call again with `job` — no second
-tool. `requestedBy: "mcp"`; `reason` required; `report` optional → `manifest`. Window-only (`full`
-not exposed). `source` stays optional for symmetry (the corpus trailer is fine) and is what the
-Rumble mapping reads. No `webpage_url` override: a video not found in `source` is passed through
-as-is with a note (documented limitation). The MCP process writes nothing. No editor configured →
-`isError` naming both variables; the README keeps the raw yt-dlp command as the NO-EDITOR fallback
-only.
-
-## Implementation (one Opus slice, branch `mcp/fetch-clip`, worktree off `main`)
-
-### 1. `mcp/src/fetchClip.ts` (new, pure; no MCP imports)
-
-- `FetchClipDeps = { env, fetch, sleep, now }` — all injected so tests need no timers or network.
-- `parseSeconds(v)`: number, `ss`, `mm:ss`, `h:mm:ss` → seconds or null.
-- `planWindow({video, start, end, pad})` → `{from, to}` or `{error}`: id regex `/^[\w.-]+$/` and not
- `.`/`..` (mirror `route.ts:34-36`); `from = Number(Math.max(0, start-pad).toFixed(2))`,
- `to = Number((end+pad).toFixed(2))`; `from < to`; `to-from ≤ 900` AFTER padding.
-- `fetchClip(args, deps)` → typed `FetchClipOutcome` (`cached | fetched | queued | cooldown | refused
- | failed | unreachable | no_editor`): POST (unless `job` is set → poll only), then poll every 1 s via
- `deps.sleep` until terminal or `deps.now()` passes the deadline. Body: `{channelSlug, videoId,
- webpageUrl?, from, to, pad, requestedBy: "mcp", manifest: report, reason: reason.slice(0,400)}`.
-- `renderFetchClip(outcome, ctx)` → `{text, isError}` with the exact texts below.
-
-**Client-side errors (before any HTTP), `isError`:**
-`fetch_clip: channel is required (the channel slug)` · `fetch_clip: video is required (the archive's
-video id)` · `fetch_clip: video "<v>" must match /^[\w.-]+$/` · `fetch_clip: start "<x>" is not a
-time (use seconds, mm:ss or h:mm:ss)` (same for end) · `fetch_clip: start (<s>) must be less than
-end (<e>)` · `fetch_clip: the window <from>–<to> is <n>s; the editor fetches at most 900s per window
-— cite a narrower span` · `fetch_clip: reason is required — one line saying why these seconds are
-needed (it is stored beside the file)` · `pad` finite ≥ 0 · `wait_seconds` clamped to [0, 300] ·
-no `WORKER_TOKEN`: `fetch_clip: no editor configured. Set ARCHILYZER_EDITOR_URL (e.g.
-http://localhost:3001) and WORKER_TOKEN (the editor's own WORKER_TOKEN) when registering the MCP
-server. A public-only setup — no local Archilyzer editor — cannot fetch media through Archilyzer;
-see README "Clips and video" for the no-editor fallback.`
-
-**Result texts.** Footer for any file result, one line each: `file: <abs path>` · `window:
-<from>–<to> (<n>s)` · `bytes: <n>` · `This path is a read-only corpus artifact: play or copy it,
-never move, edit or delete it. The editor prunes clips by age (evict-clips); provenance sits beside
-it as <from>-<to>.json.`
-- 200 cached: `Already on disk — a WIDER cached window that contains <req from>–<req to>:
- <body.from>–<body.to>.` (or "the exact window" when equal within 0.02 s) + footer (+ `requested
- by <provenance.requestedBy>` when present).
-- 202 → done: `Fetched <from>–<to> of <channel>/<canonical> (job <id>, <n>s waited).` + footer from
- the poll's `file/from/to/bytes`.
-- wait expired, still queued/running (NOT `isError`): `Still <status> on the editor (job <jobId>,
- waited <n>s). Call fetch_clip again with job: "<jobId>" to keep waiting — never repeat the original
- request while it runs (that would queue a second fetch). Nothing is lost: the fetch continues on
- the editor, and once it has finished the same request finds it cached.` (Amended 2026-09-26 after
- the review: the editor does not dedupe a running whole-recording job — `archiveSourceVideo` →
- `runManagedFunction` has no running-job check — so a repeated `full: true` request while it runs
- queues a second download, and "the next ask finds it cached" was true only once the job had
- finished.)
-- 409: `The editor is in a <platform> rate-limit cooldown — <ceil(cooldownMs/1000)>s remaining. Wait,
- then call fetch_clip again. (<error>)`
-- 401 / 503: `The editor refused the token (HTTP <s>): <error>. WORKER_TOKEN must equal the value the
- editor runs with (editor/.env).` — 503 whose error says "disabled" adds `The editor has no
- WORKER_TOKEN set, so its fetch endpoint is off.`
-- other 4xx/5xx: `The editor refused (HTTP <s>): <error verbatim>`.
-- poll failed/cancelled: `Editor job <id> <status>.\n\nlog tail:\n<error>`.
-- poll HTTP error: `Polling editor job <id> failed (HTTP <s>): <error>`; on 404 add `the job is
- unknown to this editor (restarted? wrong ARCHILYZER_EDITOR_URL?)`.
-- network: `Could not reach the editor at <url>: <message>. Is it running?`
-- not found in `source` (prefix, not an error): `note: "<video>" was not found in corpus <handle>;
- the id was passed to the editor as-is (for a Rumble citation this may be the embed id — pass the
- corpus the citation came from as source).`
-
-### 2. `mcp/src/server.ts`
-
-- `TOOLS` entry after `get_video_metadata` (~:704): `channel` (string, the channel slug), `video`
- (string, the archive's video id as cited), `start`, `end` (`oneOf [number, string]`; seconds or
- mm:ss / h:mm:ss), `pad` (number, default 3), `reason` (string, one line, ≤ 400), `report`
- (string, optional), `wait_seconds` (number, default 90, max 300), `job` (string; resume — when set
- the other args are ignored), `...SOURCE_ARG`; `additionalProperties: false`; `required: []` with
- validation in code (so `job` alone is valid). Description says: the editor fetches through its
- paced, cookie-aware, provenanced job; the file is a read-only corpus artifact; ≤ 15 min per
- window; never run yt-dlp yourself.
-- `createServer(sourceOrRegistry, opts?: { fetchClipDeps?: Partial<FetchClipDeps> })`, default deps
- `{env: process.env, fetch: globalThis.fetch.bind(globalThis), sleep: setTimeout-promise, now: Date.now}`.
-- `case "fetch_clip": return handleFetchClip(source, resolved, args, deps)`: validate → (unless
- `job`) `findVideo(source, video, channel)` → `canonical = extractVideoId(record.webpageUrl) ?? video`
- (import from `yt-dlp-transcript-common/lib/videoId`, a leaf module) and `webpageUrl =
- record.webpageUrl` → `fetchClip` → `renderFetchClip` → `text()`/`errorText()`. `withCorpus` adds
- the trailer as for every tool.
-- `protocol.test.ts` `EXPECTED_TOOLS`: insert `"fetch_clip"` after `"get_video_metadata"` (the
- test pins the exact ordered list and fails otherwise).
-
-### 3. `mcp/src/instructions.ts`
-
-One step in BOTH builders, voice-matched, after the citation step (`buildAskInstructions` after
-~:331; `buildSweepInstructions` before **Finish**, after ~:237):
-`**Media for a cited moment — through the editor only.** When I ask for the clip behind a citation
-(or a report needs one), call \`fetch_clip\` with that citation's channel slug, video id, start/end
-in seconds (or mm:ss) and a one-line reason, and pass source: "<ctx.corpus>" so a Rumble id
-resolves to the right directory. NEVER run yt-dlp yourself, in any form. If the tool reports no
-editor is configured, say so and stop — the README's yt-dlp command is the operator's fallback,
-not yours. If it returns queued, call it again with the job it names.`
-Do not backtick `wait_seconds` in the prose (the token test) or add it to `NOT_TOOLS`.
-
-### 4. Docs (short edits)
-
-- `README.md` ~:61-75 and ~:319-333 (both `claude mcp add` blocks): add
- `--env ARCHILYZER_EDITOR_URL=http://localhost:3001 \` and `--env WORKER_TOKEN=… \` with one line
- "optional: lets `fetch_clip` ask a local editor for clip media". ~:338-356 "Clips and video":
- step 3 becomes "ask for just those clips with the `fetch_clip` MCP tool — the editor fetches the
- window through its paced, cookie-aware, provenanced job; the file lands in the corpus beside the
- video (`channels/<slug>/data/<id>/clips/`)"; keep `yt-dlp --download-sections` as "with no editor
- (a public-only setup) the fallback is running yt-dlp yourself"; drop the `out/clips-raw` claim
- for the editor path.
-- `mcp/README.md` ~:7-9: "The one exception is `fetch_clip`, which asks a local Archilyzer editor to
- fetch a clip window; the MCP itself still writes nothing." Tool table ~:14-25: one row (env vars,
- ≤ 15 min, waits then returns a job to resume, Rumble mapping via the record's `webpageUrl`, a
- video not in `source` passed through as-is = known limitation).
-- `AGENTS.md` ~:53-58: the two `--env` lines with the "optional" note; ~:75-79: clip media for a
- cited moment goes through the `fetch_clip` MCP tool (→ editor `POST /api/media/fetch-window`),
- never `yt-dlp --download-sections` by hand; that command is only the fallback for a machine with
- no editor.
-
-### 5. Tests
-
-- `mcp/src/fetchClip.test.ts` (scripted fake `fetch`, recording `sleep`, `now` advancing per sleep):
- 200 cached wider window; 202 → running → done (file/bytes); 202 → failed with log tail; 409
- (seconds + platform); 401 and 503 texts; timeout → `queued` with jobId without real timers; resume
- by `job` issues no POST (assert the fetch call list); `planWindow` every error text, padding
- rounding, the 900 cap after pad; `parseSeconds("1:02:03") === 3723`; POST body has
- `requestedBy: "mcp"`, `manifest`, truncated `reason`; no-env outcome.
-- Tool-level (new `fetchClip.tool.test.ts`, via `connect()`): `createServer(registry, {fetchClipDeps})`
- with a fake source record `{id: "vxe1ae", webpageUrl: "https://rumble.com/v1007ay-x.html?e9s=1"}` →
- the POST body has `videoId: "v1007ay"` and the `webpageUrl`; the text ends with `(corpus: …)`;
- no-env is `isError` naming both variables; a YouTube id maps to itself.
-- `protocol.test.ts` +1 name; `instructions.test.ts` +1: both builders contain `fetch_clip` and
- `NEVER run yt-dlp`, and the sweep's step comes before "Finish".
-- Optional: `mcp/bench/smoke.ts` gains an opt-in `--clip <channel>/<video>@<start>-<end>` (the default
- smoke stays write-free).
-
-### 6. Gates and rollout
-
-Gates (worktree root): tsc clean; `pnpm --filter yt-dlp-transcript-mcp test` (219 baseline → record
-the new count); `pnpm run test:scripts` (162 + 1 skip); `pnpm --filter yt-dlp-transcript-common test`
-unchanged (1,845). No e2e: no editor/export/hub spec lists MCP tool names. Record: `### Slice M,
-as shipped — fetch_clip` in `plans/release-10.md` (create with the release-9 shape) + CHANGELOG
-bullet; report to `$T/m-report.md`.
-
-Rollout (parent, after merge; no editor restart — Claude Code relaunches the MCP per session):
-1. Live proof from the primary with the merged code, against the real editor on :3001, through an
- in-memory client script (not by hand-running yt-dlp): `fetch_clip` on a tiny YouTube window from
- a channel already archived (e.g. one teamrcn video, `start` 10 → `end` 20, reason "release 10
- live proof") → expect 202 → done, a file under `data/<id>/clips/10.00-23.00.mp4` (pad 3), a
- provenance sidecar with `requestedBy: "mcp"`, no `metadata.info.json` written; then the same
- call again → cached. Then one Rumble citation from `the-quartering-rumble` (embed id from the
- published archive as `video`, `source: remote:https://jeralyzer.pages.dev`) → the POST carries the
- slug id and the clip lands in the slug-named dir.
-2. Re-register the MCP for this machine (the operator, or via `! …`):
- `claude mcp remove archilyzer && claude mcp add archilyzer --env ARCHILYZER_EDITOR_URL=http://localhost:3001 --env WORKER_TOKEN="$(grep '^WORKER_TOKEN=' editor/.env | cut -d= -f2-)" -- pnpm -C /home/user/Projects/yt-dlp-transcript-browser --filter yt-dlp-transcript-mcp exec tsx src/index.ts --local /home/user/Projects/yt-dlp-transcript-browser/export/public`
- (the current entry has `"env": {}`; `umtool/.env.local` already carries both values).
-3. `/ask` proof in a fresh session: ask for the clip behind one citation; the plan step names
- `fetch_clip`; the tool answers with a corpus path.
-4. STATE, FACTS ("`fetch_clip` is the only MCP tool that causes a write, and the editor does it"),
- memory (`no-yt-dlp-by-hand` gains the tool), runbook.
-
-## Verification
-
-- Unit: the test list above, all green; `EXPECTED_TOOLS` updated; the instructions token test green.
-- Live: the two proofs in rollout step 1 (YouTube: fetched then cached; Rumble: slug dir), checked
- on disk under `transcripts/channels/…/clips/` and in the editor's `/jobs` (kind `fetch-window`,
- `done`).
-- Docs: `grep -n 'download-sections' README.md AGENTS.md mcp/README.md` shows it only in the
- no-editor fallback sentences.
-
-## Known limitations (documented, not fixed here)
-
-- A video absent from the `source` corpus is passed through by its cited id; for Rumble that can be
- the embed id and the editor would fetch into the wrong dir — the tool says so in its note; pass
- the corpus the citation came from as `source`.
-- `full` (whole source) stays umtool/editor-only.
-- The MCP cannot start an editor; a public-only setup gets the no-editor error and the README's
- yt-dlp fallback.
-
-## Amendment (operator, 2026-09-26, before implementation) — `full: true` IS exposed
-
-The operator re-opened one decision: "the ability to download a full video may be useful, e.g. if
-asking to summarize one long video." So the "Window-only (`full` not exposed)" decision above is
-REPLACED by this section; everything else stands. The editor already does the work — verified:
-
-- `route.ts:143` reads `body.full === true` BEFORE validating `from`/`to` and calls
- `fetchFullSourceAction` (`editor/app/channels/[slug]/videos/[id]/videoActions.ts`), which uses
- the **saved-video store** (`transcripts/saved-videos/`, pointer under `data/<id>/`), not `clips/`.
- It does NOT take `webpageUrl`: the URL comes from `findVideoSourceUrl` (the video's
- `metadata.info.json` or the channel `playlist`), so a video the editor has never seen returns 404
- `Could not determine the video URL: …`. 200 cached → `{cached:true, file, from:0, to:0, bytes,
- provenance}` (provenance = the pointer's `origin`, a `SavedVideoOrigin` with `requestedBy`,
- `manifest`, `clipId`, `reason`, `requestedAt`). 202 → `{cached:false, jobId, file: null, from:0,
- to:0}` — the path is unknowable until yt-dlp picks the container. The job kind is
- `redownload-archive`; the poll route (`[jobId]/route.ts:50-52`) accepts that kind and on `done`
- reads `file`/`bytes` from the saved-video pointer (no `from`/`to` keys).
-- umtool's client sends `{full: true}` INSTEAD of `from`/`to`/`pad` (`fetch-via-editor.mjs:153-167`,
- "full REPLACES the span"). Do the same.
-
-**Tool surface.** Add `full` (boolean, default false) to the `fetch_clip` schema: "the whole
-recording instead of a window — for a video that must be re-cut freely or watched end to end; it
-lands in the editor's saved-video store, is much larger than a window, and needs a video the editor
-already knows (its metadata or playlist entry)." When `full` is true, `start`/`end`/`pad` are
-ignored (not required, not validated); `reason` is still required; `channel`/`video` as before; the
-Rumble id mapping still applies (the dir is the slug id). `planWindow` is not called. POST body:
-`{channelSlug, videoId, full: true, requestedBy: "mcp", manifest: report, reason}` — no
-`webpageUrl`, no `from`/`to`/`pad`.
-
-**Texts (full mode).**
-- 200 cached: `Already on disk — the whole recording of <channel>/<canonical>.` + footer.
-- 202 → done: `Fetched the whole recording of <channel>/<canonical> (job <id>, <n>s waited).` +
- footer. If the poll's `done` carries no `file` (pointer missing), say
- `Editor job <id> finished but named no file; check the video's page in the editor.` (`isError`).
-- Footer for full: `file: <abs path>` · `bytes: <n>` · `This path is a read-only corpus artifact:
- play or copy it, never move, edit or delete it. It lives in the editor's saved-video store, not
- in clips/; the editor's keep-videos rule decides how long it stays.` (no `window:` line).
-- 404 in full mode comes back through the generic `The editor refused (HTTP 404): <error verbatim>`
- path; ADD one sentence after it when `full` was set: `A whole-recording fetch needs a video the
- editor already knows (a metadata.info.json or a playlist entry); fetch a window instead, or add
- the video to the channel first.`
-- `queued` text is unchanged (resume by `job` works for both kinds: the poll route answers for
- `redownload-archive` too).
-- A `wait_seconds` default of 90 will usually expire on a full download; that is fine — the text
- already says the fetch continues and to call again with `job`.
-
-**Instructions step** (both builders): extend the sentence — "… and a one-line reason (or
-full: true when the ask genuinely needs the whole recording — a window is the default), and pass
-source: …". Do not backtick `full`.
-
-**Docs.** README "Clips and video" + `mcp/README.md` row: one clause each — "`full: true` fetches
-the whole recording into the saved-video store (needs a video the editor already knows)".
-
-**Tests** (add to §5): `fetchClip` full → POST body is exactly `{channelSlug, videoId, full: true,
-requestedBy, manifest, reason}` with no `from`/`to`/`pad`/`webpageUrl`; 200 cached full text; 202 →
-done with `file` + `bytes` and no `window:` line; done without `file` → the isError text; 404 in
-full mode carries the extra sentence; `full` with `start`/`end` also given → they are ignored
-(assert the body). Tool-level: `full: true` + a Rumble record still maps `videoId` to the slug id.
-
-**Rollout step 1 gains 1c**: after the window proofs, one `full: true` on a SHORT teamrcn video
-(under ~5 min; one download, at the editor's own pace — never a second one in parallel) → expect
-202 → `queued` at 90 s or `done`, then a resume by `job` → `file` under `transcripts/saved-videos/`,
-the pointer's `origin.requestedBy === "mcp"`; the same call again → cached.
-
-**Known limitations** gains: full mode cannot take a `webpageUrl`, so a video absent from the
-editor's channel (not in its playlist, no metadata) gets the editor's 404; the window path can
-still fetch it by URL.
diff --git a/plans/one-core-phase-1.md b/plans/one-core-phase-1.md
@@ -1,1612 +0,0 @@
-# One core — Phase 1: four lanes, one runner
-
-## Context
-
-`plans/one-core.md` (committed on `one-core/phase-0`, seven commits, unmerged, e2e 511/511)
-is the umbrella. This is the slice-level plan for **Phase 1 — Dispatch: one scheduler**:
-finish `plans/unified-operations-model.md` steps 5 and 6 and delete what they retire, so one
-dispatcher owns every lane of media-derived work.
-
-Three surveys on 2026-09-07 (dispatch backend, editor surfaces, live config and job history)
-changed the umbrella's Phase 1 wording in one way, agreed with the operator:
-
-- **The arbiter never ran.** Zero `operations-arbiter` records among 1,305 production jobs,
- no `.arbiter/` state, no boot resume, no fairness memory, no owner map, and it cannot
- dispatch download or transcription — the two lanes carrying 100% of live dispatch
- (`controller/operationLane.ts:22-30` resolves registry entries only). The auto-queue
- runner (`controller/autoRunner.ts`) is the proven loop: persisted picks, boot resume,
- worker slots, platform backoff, an e2e-pinned console.
-- **So the runner generalizes, and the arbiter and both sweeps are deleted.** `AutoQueueKind`
- widens from `{transcription, download}` to the four lanes `lib/pauseGates.ts:41` already
- names: `+ digest`, `+ backfill`. Each lane gets a policy tree, a runner and the same
- console. Download and transcription dispatch is untouched.
-- **Pause moves to `autoQueue[lane].held`**, behind the unchanged `isGateHeld` /
- `withGateHeld` API, with the four legacy fields read as a migration for one release.
-
-**The model in one sentence:** the *lane* is the dispatch noun (a queue key, a tree, a
-runner, a pause, a console), the *operation* is the work noun (a registry entry with a
-state per video), and a leaf in a lane's tree names channels and, where a lane carries
-more than one operation, an operation.
-
-## Facts that shape the slices
-
-- Live `settings.json`: two trees (`autoQueue.transcription`, `.download`), both roots
- `strict` with ten channel leaves + a catch-all; no leaf names an operation; both sweeps
- disarmed; `transcriptionsPaused: true`; `backfill.allowRedownload: true` with
- `reach: "corpus"` and empty `sweepChannels`. Arming the backfill lane as configured would
- re-fetch audio for ~66,540 videos (`STATE.md` runbook item iii, unresolved).
-- `.auto-queue/state.json` (2026-09-02): 29 download picks, 26 from the catch-all leaf;
- `currentWeights` empty on both lanes (strict mode never writes them).
-- Snapshot `backfill` map keys are identical on all 68 channels:
- `attribution-diarized, attribution-text, diarization, digest`; `ids.length == missing +
- stale` everywhere (pinned `channelSnapshot.test.ts:28`). Baseline sums: digest missing
- 55,956 / stale 267 / deferred 15 / blocked 1,722; diarization missing 424 / missingInput
- 75,591; attribution-text missing 77,888; attribution-diarized missing 1,881 / blocked 76,015.
- Download's list is `snapshot.undownloadedIds` (top level, playlist order; sum 9) plus
- `buckets.partialDownloads`; transcription's is `buckets.downloadedNoTranscript` (881) +
- `failedListed` (+ opt-in `downloadedAutoSubsOnly`). **There is no `buckets.undownloaded`
- or `buckets.untranscribed`** — the umbrella's step 5 named fields that do not exist.
-- `EXTERNAL_OPERATIONS` (`lib/operations.ts:1321-1377`) are descriptors only: no `state`,
- `run`, `inputs`, `outputs`. The four registry `Operation`s have all of them.
-- `backfillBatch.ts` does not import `laneGuards`; it re-implements the yield inline and
- keys the GPU idle-only rule on the *presence* of `laneFor` (`:796`, the FACTS.md trap).
- `digestBatch.ts` uses the declared guards (`laneGuards.digestGate`, keyed on `contendsFor`).
-- Runner console contract: `RunnerOperationView.tsx:20-35` `<section data-lane={kind}>`,
- ~1,200 e2e lines depend on it. No UI exists for `match.operation`
- (`LadderRung.tsx:390-497` offers channel / platform / all).
-- e2e cannot run in the primary checkout while the untracked `editor/content` symlink
- exists; run it from a worktree as Phase 0 did.
-
-## The slices
-
-Each is one reviewable diff that deletes something, committed with its measurements, on a
-branch off `one-core/phase-0` (or `main` once that merges). Live numbers are checked with
-offline `tsx` over the real corpus, never a second editor.
-
-### 1.1 — Four lanes in the model (no behaviour change)
-
-- `lib/autoQueueTypes.ts:138`: `AutoQueueKind = "transcription" | "download" | "digest" |
- "backfill"`, exported as `LANES`; `lib/pauseGates.ts:41` `PauseLane` becomes an alias of
- it. Grep the ~20 files spelling the two-member union (`jobs/autoQueuePolicy.ts:105-152`,
- `editor/app/api/auto-queue/control/route.ts:17`, `jobs/active/buildActiveJobs.ts:493`).
-- `AutoQueueSettings` gains `digest` and `backfill` policies. `defaultAutoQueue()` /
- `sanitizeAutoQueue()` (`jobs/autoQueuePolicy.ts:521,554`) default them `enabled: false`,
- root `strict` with one `{type:"all"}` leaf. `AutoQueueOrder` gains `"cheapest"` (digest's
- shortest-first, comparator supplied by the runner from `readDurationFast`, memoized like
- recency keys); the digest lane defaults to it so today's ordering survives.
-- `bucketsForKind` / `optInBucketsForKind` / `selectableBucketsForKind` (`:104-121`)
- return `[]` for the new lanes. New `operationsForLane(lane, settings)` in
- `lib/operations.ts`: enabled catalog operations whose `(op.laneFor?.(settings) ??
- op.lane).queueKey` is the lane's queue (`DIGEST_LOCAL_QUEUE | DIGEST_REMOTE_QUEUE` for
- digest, `BACKFILL_QUEUE` for backfill), in `orderByDependencies` order — a leaf naming no
- operation draws all of them, the way a bucket-less leaf draws the default union.
-- `retainLeaves(pending, root, "buckets" | "operations")` (`:225`) loses its mode: a
- leaf is retained when it draws anything from the lane's projection.
-- `jobs/autoQueueState.ts`: state keyed by all four lanes; missing lanes coerce to empty
- (extend `autoQueueState.test.ts`).
-- Editor: `LadderRung.tsx` `LeafControls` — an *operation* select, shown only for lanes
- with more than one operation (backfill); the bucket select hidden for lanes with none.
- `/api/auto-queue/status` `buildKind` (`operations/status.ts:76-108`) iterates `LANES`.
-- `startAutoRunnersIfEnabled` still starts only lanes that have an executor (the two).
-- Update `plans/one-core.md` Phase 1 to this design in the same commit.
-- Tests: sanitizer defaults, `operationsForLane` per lane and per `digest.remoteEnabled`,
- `pauseGates.test.ts` `pauseLaneFor` unchanged. **Numbers: none move.**
-
-### 1.2 — The runner runs operations (digest and backfill lanes live; sweeps untouched)
-
-- New `controller/operationBatch.ts` — the per-unit executor and the per-lane limit,
- extracted from `digestBatch.ts:152-606` and `backfillBatch.ts:255-868`:
- - `runOperationUnit({op, videoId, channel, settings, signal, force})`: re-derive from
- disk (`readVideoFiles` + `op.state()`), `candidateAction` with its `never` default
- (`backfillBatch.ts:192-238`, generalized; digest's inline `allFresh` becomes the
- `fresh` arm), `op.run()`, the per-video overrides (`reacquireMediaFor` + `cleanup()` in
- `finally` for backfill kinds, `laneSharesDuplicates` canonical share for digest),
- `applyResult` on the remote-unit path.
- - `laneLimit(lane, settings, live)`: digest = `digestPreflight` + `digestGate` +
- concurrency + `remoteTerm` (`digestBatch.ts:514-559`); backfill = share + `remoteTerm`
- + `unitTerm` (`backfillBatch.ts:727-845`) with the GPU yield through
- `laneGuards.laneYieldsToTranscription(laneForOperation(op))` — keyed on `contendsFor`.
- The `laneFor`-presence check at `:796` is deleted; the comment at
- `operations.ts:438-445` and the FACTS.md entry are rewritten to say so.
- - `countOperationWork(lane, channel)` replaces the `countMissingDigests` /
- `countBackfillWork` twins (snapshot first, walk fallback for un-snapshotted channels).
-- `controller/autoRunner.ts`: `run` (`:823`) branches on lane — transcription and download
- unchanged; digest and backfill call `runOperationUnit`. `limit` (`:594-616`) calls
- `laneLimit` for the new lanes. `next` (`:621`) draws `ch.operations` for them;
- `buildChannelWork` (`:210`) already projects `snap.backfill[op].ids` at `:249-261` — stop
- zeroing those leaves. Runner job progress uses the existing `digests` / `backfills`
- metrics. **The runner for lane X refuses to start while sweep X is armed, and says which**
- (`arbiterBlockedReason` logic, `arbiter.ts:194-203`, moved and renamed
- `laneBlockedReason`).
-- `runDigestChannelJob` / `runBackfillChannelJob` (the channel and video pages' manual Run)
- keep their job kinds and call `operationBatch` inside their own pool, so there is one
- executor. `digestBatch.ts` and `backfillBatch.ts` are deleted; `backfillBatch.test.ts`
- becomes `operationBatch.test.ts` (`candidateAction` exhaustiveness, `laneLimit` cases).
-- Editor: `/operations/[id]` (`page.tsx:161`) chooses the runner console off the operation's
- lane, not `op.runner` (which stays `undefined` for sync, per the IA doc); every operation
- page with a lane renders `RunnerOperationView` with `data-lane` = the lane id, beside the
- sweep section for the length of this slice. `useOperationsStatus` polls all four.
-- e2e: new `lane-runner.spec.ts` on the fixture corpus — the digest lane starts, dispatches
- one unit through the Ollama stub, appears as a job, holds on pause, stops, and comes back
- after `startAutoRunnersIfEnabled`; the backfill lane dispatches diarization then
- attribution-diarized in dependency order through `fake-diarize`; digest and diarization
- run concurrently on distinct queue keys (the `backfill.spec.ts:615` invariant, moved).
-- **Operator gate A, at the end of this slice:** enable `autoQueue.digest` in production
- with one channel leaf, let the runner drive a pass, restart the editor, confirm it
- resumes. Record units dispatched, the snapshot's `digest.missing` delta and, if a
- transcription is started beside it, the observed yield. This is the "has run in
- production once" precondition every retirement below stands on.
-
-### 1.3 — Sweeps and arbiter retire
-
-- Arming becomes tree authoring: `startDigestSweepAction(channels)` and
- `startBackfillSweepAction(kinds, channels)` (`editor/app/jobs/actions.ts:160-251`) become
- one `armLaneAction(lane, {operations, channels})` that writes `autoQueue[lane].root`
- (a strict group of channel leaves, each carrying `operation` when scoped) and sets
- `enabled: true`; disarm is `enabled: false`. `NextUp` is the plan (`computeLeafPending`);
- the "also runs on …" line (`SweepScope.tsx:122-155`, via `workerMatches`) moves into
- `LaneHeader`.
-- Settings migration on read in `getSettings`: `digest.sweepEnabled/sweepChannels/
- recencyOrder/recencyReach` and `backfill.sweepEnabled/sweepKinds/sweepChannels/order/
- reach/weight` populate `autoQueue.digest` / `autoQueue.backfill` when those blocks are
- absent (`sweepEnabled:false` → `enabled:false`; channels → leaves; order/reach → policy
- order/reach; `weight` is retired — the backfill lane yields on `contendsFor` like digest,
- and `maxWorkers` is its share). Then the ten fields, their sanitizers, the
- `LaneSettingsForm.tsx:80-86` weight field and `settingsActions.ts:215` are deleted. The
- migration must never *enable* a lane the sweep flag did not.
-- Delete, backend: `controller/digestSweep.ts`, `backfillSweep.ts`, `sweepPreview.ts`,
- `sweepRecency.ts`, `lib/sweepPlan.ts`, `arbiter.ts`, `arbiterWork.ts`; job kinds
- `digest-sweep`, `backfill-sweep`, `operations-arbiter` (`jobs/jobKinds.ts` +
- `jobKinds.test.ts`); `instrumentation.ts:109-126` resume hooks; `sweepPreview.test.ts`,
- `arbiter.test.ts` (its leaf-order case already lives in `autoQueuePolicy.test.ts:729-806`).
- `controller/digestPlan.buildDigestSweepPlan` stays (chunk-priced ETA for `bin/digest-plan`).
-- Delete, editor: `SweepLane.tsx`, `SweepScope.tsx`, `SweepPlan.tsx`,
- `OperationDetail.tsx:117-123,157-223`, `ArbiterBar.tsx`, `OperationsBoard.tsx:52`,
- `operations/lanes.ts` sweep half and `ArbiterStatus` (`:74-81,229-263,315-370`),
- `railStates.ts:48-92`, `operations/actions.ts:264-330` (`saveLaneOrderAction`, arbiter
- start/stop), `laneState.ts` `feedRunning` axis + `sweepLaneNote`, `MonitorWidget`
- `BackfillStrip` `sweeping`, `buildActiveJobs.ts:436-450` and
- `api/widget/sync/route.ts:297-304` sweep flags, `stageStatus.ts:126` job-kind map entry,
- `[id]/page.tsx:53-63,190-215` `JOB_KINDS_BY_LANE`; `/api/test/resume-backfill-sweep` →
- `/api/test/resume-lane?lane=`.
-- e2e: `backfill.spec.ts` seven sweep tests rewritten to the lane runner (arm = enable with
- scope, persisted as a tree; restart via `resume-lane`); `auto-queue.spec.ts` three
- arbiter tests deleted; `widget.spec.ts:776,787` and `laneState.test.ts` to runner state;
- `operation-settings.spec.ts:104,214` to the surviving `LaneSettingsForm` fields.
-- The retired routes rule: every deleted action's URL and aria-label either survives on
- the runner console or is asserted gone in the spec that pinned it.
-
-### 1.4 — Pause is lane state
-
-- `AutoQueuePolicy.held?: boolean`. `isGateHeld(settings, lane)` reads
- `settings.autoQueue[lane].held`, falling back to the legacy field
- (`transcriptionsPaused`, `downloadsPaused`, `digest.digestsPaused`, `!backfill.enabled`)
- when undefined; `withGateHeld` writes the new key only; `getSettings` copies legacy → new
- on read so the next write persists it. All 13 callers are unchanged. The transcription
- asymmetry stays: the node value is intent, `workerPool.isPaused()` is live state
- (`instrumentation.ts:71-76` re-applies from the new key).
-- After one release (or immediately once the live `settings.json` carries all four `held`
- keys): delete the four legacy fields, their sanitizers, `settings/actions.ts:222-223`'s
- spread, and rewrite `LaneSettingsForm.tsx:68-73` to write `held` through `withGateHeld`
- (still a deliberate second writer of the same key).
-- Fixtures and specs that read the legacy fields from disk: `auto-queue.spec.ts:1199-1206`,
- `dashboard.spec.ts:79`, `backfill.spec.ts:796,835`, `test-settings.default.json`.
- `pauseGates.test.ts`'s polarity test becomes "held is a hold, never a stop" at the runner:
- `limit()` returns 0 and `runPool` idle-waits.
-
-### 1.5 — One work list per lane in the snapshot
-
-- `generateChannelSnapshot` (`channelSnapshot.ts:524`) writes `backfill.download` and
- `backfill.transcription` entries: `ids` = the union `defaultBucketsForPolicy` draws
- (`undownloadedIds ∪ partialDownloads`; `downloadedNoTranscript ∪ failedListed`),
- `missing = ids.length`, `missingInput = noTranscript` for transcription, `eligible` as
- the others. `EXTERNAL_OPERATIONS` carry their declared `lane`, so `laneForOperation`
- resolves it (`laneForOperation.test.ts:80` flips from "still has no lane" to "resolves
- its declared lane"); `EXTERNAL_BAND_IDS`'s special case in `buildBands.ts` goes. The
- `ChannelSnapshot.backfill` type is aliased `operations`; the disk key is unchanged.
-- `autoRunner.buildChannelWork` reads `snap.backfill[op].ids` for every lane's default
- draw; `bucket` leaves keep working for sub-lists (retry buckets are a real UI).
-- Proof: a unit test on the fixture corpora that `next()` picks the same first N units
- under the bucket projection and the operation projection; an offline `tsx` script over
- the 68 live snapshots asserting the in-memory fold of the new entries equals the
- bucket union (no snapshot is regenerated — that writes into `transcripts/`).
-
-## Operator gates
-
-- **A — before 1.3 lands:** the digest lane runner has driven a production pass and
- resumed after a restart (end of 1.2).
-- **B — before the backfill lane is ever enabled in production:** decide
- `backfill.allowRedownload` and the channel scope. As configured today it re-fetches audio
- for ~66,540 `missingInput` videos, channel-major, with no inter-download sleep. The
- 1.3 migration keeps the lane disabled; the tree's channel leaves are the scope from then on.
-
-## What must not be lost
-
-`unified-operations-model.md` "What must not be lost" — reachable ≠ needs-media (never
-summed, ~91× apart); a zero limit is a hold, never a stop (`runPool` idle-waits, `null` from
-`next()` ends the job); re-derive eligibility from disk on every pull; one job per channel
-for the manual verbs, and the runner's in-process units for the lanes; the `never` default on
-`candidateAction`; distinct queue keys are the only concurrency mechanism (`backfill.spec.ts:615`
-moves, does not vanish); derived sidecars are not disk-gated. Plus: `laneFor` presence stops
-being load-bearing in 1.2 and the test that pinned it changes in the same commit; the runner
-console's `<section data-lane>` contract is the surface every lane now shares; the
-`transcriptionsPaused` intent-vs-pool asymmetry; `undownloadedIds` is playlist order and
-must stay unsorted.
-
-## Verification
-
-Per slice: `tsc --noEmit` in common, editor, export, mcp, homepage, umtool;
-`pnpm --filter yt-dlp-transcript-common test` (architecture test included — 1.3 removes
-`lib/sweepPlan.ts → controller` and `jobs/*→ controller` entries from the allow-list rather
-than adding any); full editor e2e from a worktree behind the queue lock, detached, watched
-with Monitor.
-
-Numbers do not move: an offline `tsx` script over the 68 live snapshots and `settings.json`
-dumps, before and after each slice, every `backfill[op]` count, `undownloadedIds.length`,
-the per-lane `computeLeafPending` totals, and each lane's `held`/`enabled`; the diff is
-empty or explained in the slice note. After 1.3, the same script asserts the migrated
-`autoQueue.digest` / `.backfill` blocks are `enabled: false` with the expected leaves.
-
-Run the thing: gate A's production pass (units, sidecars, restart resume); after 1.3 an
-arm-from-the-console on the fixture corpus produces the same tree the migration would; after
-1.4 a pause from the dashboard, the widget and the runner page all flip one `held` key and
-the runner idles without stopping; after 1.5 `/channels` bands for download and
-transcription draw from the operation entries with no rendered number changed.
-
-## 1.1, as shipped
-
-`7f294df` (this plan) → `f762944` (the numbers script) → this commit (the slice), on
-`one-core/phase-1` off `af2a360`. **Numbers: the before/after diff of
-`plans/tools/phase1-numbers.ts` over the live corpus is EMPTY.**
-
-Verification: `tsc --noEmit` clean in common, editor, export, mcp, homepage and umtool;
-`yt-dlp-transcript-common` 888 tests (876 before, +12 here), `yt-dlp-transcript-mcp` 205;
-`next build` clean; full editor e2e from a `p1-e2e` worktree of the slice commit —
-**511 passed, 0 failed, 24.4 min**, one worker behind the queue lock, matching Phase 0's
-511/511. The worktree needed the same seed Phase 0 recorded: `export/public` holds only
-the tracked static assets, so `build-index` + `compose-site` over a fixture corpus turns
-the export webServer's 500 into a 200.
-
-**The one design change: `retainLeaves` is deleted, not de-moded.** The plan said it
-"loses its mode: a leaf is retained when it draws anything from the lane's projection" —
-and that sentence, taken literally, describes the identity function. `pending[leaf]` IS
-what the leaf drew, so a post-hoc filter over it can only re-apply a rule the draw already
-applied. So the rule moved INTO the draw: `buildChannelWork` projects only
-`selectableBucketsForKind(lane)` and only `operationsNamedBy(root) ∩ operationsForLane(lane)`,
-and a leaf naming anything else finds no list. Verified equivalent at all three old call
-sites — the two runner ones (`operationsForLane` is `[]` for both, so an operation leaf
-projects nothing, exactly what the `"buckets"` mode zeroed) and the arbiter's, where
-`buildArbiterChannelWork` already projects `buckets: {}` and `planArbiterUnits` already
-skips every leaf with no `match.operation`.
-
-Shipped as planned: `LANES` + the four-member `AutoQueueKind` (`PauseLane` an alias);
-`digest`/`backfill` policies defaulting `enabled:false`, root `strict`, one `{type:"all"}`
-leaf, with an ABSENT lane block falling back to the whole default policy rather than to
-`sanitizePolicy({})` — a runner lane's absent root still means the empty tree it has
-always meant; `AutoQueueOrder` gains `"cheapest"` with the digest lane defaulting to it;
-`bucketsForKind`/`optInBucketsForKind`/`selectableBucketsForKind` return `[]` for the
-operation lanes; `operationsForLane(lane, settings)` in `lib/operations.ts`, off the queue
-key and off `laneFor` before `lane`; `autoQueueState` keyed by `LANES` with missing lanes
-coerced to empty on read AND on write; `/api/auto-queue/status` `buildKind` iterates
-`LANES`; `LeafControls` gains an operation select (drawn only above one operation) and
-hides the bucket select for a lane with none; `startAutoRunnersIfEnabled` still names the
-two lanes that have an executor.
-
-Two smaller divergences, both to keep "no UI text changes for the two existing lanes"
-true:
-
-- **`OrderReach` gained an `orders` prop** defaulting to the three date-keyed orders.
- `Object.keys(ORDER_LABEL)` would have put a fourth option on every existing order
- select, for an order whose comparator does not exist until 1.2. The digest lane passes
- its own list when the runner supplies the comparator.
-- **`/api/auto-queue/control` still refuses a lane that is not `transcription` or
- `download`.** Widening it would expose a Start button for a lane the runner cannot
- execute. It widens in 1.2 with `run()`.
-
-**Review fix-up, the commit after `621ffa6`.** Three things the slice shipped with: `makeRecencyComparator`
-did not cover `"cheapest"` and fell through to the `olderFirst = -1` arm, so the digest
-lane's default order silently meant OLDEST-FIRST (it returns null now); `buildChannelWork`
-read and parsed all 68 snapshots for the two lanes whose projection is empty today (early
-return, deleted in 1.2 when a lane's default draw is its operation union); and nothing
-pinned the slice's headline invariant — an operation leaf inside a runner lane's tree draws
-`[]` while the bucket leaves are untouched. common 890 tests, numbers diff still empty.
-
-**Open design point 1.2 must settle first: the real digest order is duration THEN recency.**
-`digestBatch.ts:242-252` composes both, and the live `digest.recencyOrder` is `"newest"` —
-but `AutoQueuePolicy.order` is one field holding one of them. So 1.2 has to NAME the
-composition (the obvious reading: `cheapest` = duration ascending, ties broken by the lane's
-`reach`/recency order) before 1.3 migrates `recencyOrder` into the tree, or the migration
-silently drops half of today's ordering.
-
-**For 1.2.** `buildChannelWork`'s `operations` argument is now `laneOperationIds(kind,
-root)` — an INTERSECTION, so the digest lane projects nothing while its tree is the
-default catch-all leaf. `next()` drawing the lane's default operation union is the change
-that makes the lane live, and it is also where the projection cost lands: one channel's
-`digest.ids` is up to 11,329 strings and the status payload now folds four lanes on a
-three-second poll, so widen the projection in `run()`'s loop rather than in
-`computeLeafPending` if the two need to differ. `AutoQueueStatusPayload` is
-`Record<AutoQueueKind, AutoQueueKindStatus> & { lanes }`, so `data.digest` /
-`data.backfill` are already on the wire.
-
-## 1.2, as shipped
-
-`83954f1` (one executor) → `596ddb6` (the runner runs operations) → `8c5a49d`
-(the console per lane) → `ddbdb30` (the e2e spec) → `1f531fb` (dead half-rules
-removed) → `24a2069` (three fixes to the long-lived half) → `9a16d65` (two
-runners, one state object — the bug the e2e spec found) → the commit after
-`3bdf5ee` (the review fix-up, which carries this paragraph and so cannot name
-its own sha), on `one-core/phase-1` off `3ced7dd`. **Numbers: the before/after diff of `plans/tools/phase1-numbers.ts`
-over the live corpus is EMPTY.** It stays empty because the live `settings.json`
-carries no `autoQueue.digest` or `.backfill` block, and the script's lane
-sections come from the KEYS PRESENT IN THE FILE — which is exactly why it was
-written that way. The two lanes are live in code and disabled on disk.
-
-**Deleted:** `controller/digestBatch.ts` (647 lines) and
-`controller/backfillBatch.ts` (937), replaced by `controller/operationBatch.ts`.
-`countMissingDigests` and `countBackfillWork` are one `countOperationWork(lane,
-paths, channel, opts)`. `backfillBatch.test.ts` is `operationBatch.test.ts`, and
-`lib/operations.test.ts -> controller/backfillBatch` is off
-`architecture.test.ts`'s allow-list — the test that needed it moved to the
-dispatch layer where it belongs. **No entry was added.**
-
-Verification: `tsc --noEmit` clean in common, editor, export, mcp, homepage and
-umtool; `yt-dlp-transcript-common` **896** tests (890 before, +6 `laneLimit`
-cases; the moved `candidateAction` test is a relocation, not an addition),
-`yt-dlp-transcript-mcp` **205**; `next build` clean; full editor e2e from a
-`p12-e2e` worktree of `9a16d65` — **515 passed, 0 failed, 23.0 min**, one worker
-behind the queue lock. 511 before, +4 from `lane-runner.spec.ts`.
-
-### What it measures
-
-**The status poll**, over the live corpus, `plans/tools/phase1-poll-timing.ts`
-(new; `ROUNDS=` and `NOMEMO=1`). It folds `computeLeafPending` for all four
-lanes exactly as `buildAutoQueueStatusPayload` does:
-
-| | warm round | what the two new lanes fold |
-|---|---|---|
-| before (1.1) | 86–102 ms | nothing — both projections were empty |
-| after, no memo | 386–413 ms | digest 56,223 · backfill 80,193 pending ids |
-| after, with memo | **256 ms** | same |
-
-So the lanes going live costs ~150 ms a poll and the `(mtime, size)` parse memo
-in `readChannelSnapshotShared` gives ~130–155 ms of that back. The first pass of
-a process is 4.8 s: that is the duration index filling for the `cheapest` order,
-55,956 head-reads at concurrency 64, and a duration never changes, so it is paid
-once per process and never again.
-
-### Decisions the plan asked for
-
-**The `cheapest` composition, preserved exactly.** `digestBatch.ts:242-261`
-sorted by DURATION and then sorted AGAIN, stably, by upload date. Array#sort is
-stable and the recency comparator returns 0 for two videos sharing a YYYYMMDD
-key, so the live meaning is **date primary, duration as the tiebreak within a
-day** — "newest day first, shortest video within a day" — which is the opposite
-of the order the two sort() calls are written in. That is now one comparator,
-`cheapestComparator`, and the date half's DIRECTION is a parameter, today
-`settings.digest.recencyOrder` (live value `newest`). Unknown durations sort
-LAST in either direction: the batch dropped them from candidacy entirely, and
-the runner cannot (its candidates are the snapshot's reachable ids), so it puts
-what it cannot price behind what it can rather than letting `null` sort first.
-**1.3 fixes the direction at newest-first** when `recencyOrder` retires into the
-tree; a digest lane wanting pure recency then sets `order: newest` and gets no
-duration term at all.
-
-`cheapest` on a lane other than digest is accepted by the sanitizer (one enum,
-one sanitizer) and **falls back to LISTED** — `recencyOrdering` returns a null
-comparator, which everywhere else in the runner means "do not sort". Not id
-order and not a date order nobody asked for: both would be a real reordering
-dressed up as a fallback. The console does not offer it there either
-(`LANE_ORDERS`).
-
-**The status poll memo** is above. It is deliberately NOT on `readChannelSnapshot`
-itself: that one is called by the snapshot GENERATOR and by half a dozen editor
-render paths, and handing out a shared parsed object is a claim about
-read-only-ness that code has never had to honour.
-
-### What review found afterwards, and `24a2069` fixed
-
-Three things that only bite a runner, which is the half of this slice with no
-precedent — every previous caller of this machinery was a job that ended.
-
-- **The metered spend cap was resettable by a clock.** `openOperationRun` starts
- a context with `costUsd: 0`, and the runner rebuilds its context on a
- sixty-second TTL, so a `$5` per-run cap would have become `$5 a minute` with
- the log still printing a cap it was no longer enforcing. The accumulator and
- the disk-floor latch survive the refresh now.
-- **A refresh could swap the context out from under an in-flight unit**, whose
- llm and unit-executor leases decrement counters on the object it was
- dispatched with — a permanently leaked slot from `laneLimit`'s point of view.
- The refresh waits for the lane to be idle.
-- **A dead engine was re-probed every three seconds**, because the TTL covered a
- successful open and not a failed one.
-
-Plus two smaller ones: the batch's resume line said "Transcription finished"
-whatever the hold had been, so lifting an operator pause reported something that
-never happened; and `countOperationWork` resolved each operation's freshness
-target inside the per-video loop rather than once per operation.
-
-### The bug the e2e spec found, and `9a16d65` fixed
-
-**Every runner held its own copy of `.auto-queue/state.json`, and
-`writeAutoQueueState` serializes the WHOLE file.** So each persist wrote back
-that copy's idea of the other three lanes: whichever runner dispatched most
-recently erased the others' pick log and fairness memory. It is a pre-existing
-defect that only this slice could expose — auto-transcribe persists minutes
-apart and auto-download rarely faster, so with one slow lane it is invisible.
-With two fast lanes it is immediate: the digest lane wrote a pick and the
-backfill runner overwrote it a few hundred milliseconds later, and
-`/api/auto-queue/status` reads the FILE, so the console showed a lane with zero
-picks and `no-pending` while its `ai-digest.json` files were appearing on disk.
-
-The runners share one object now, on the auto-runner singleton — whose lifetime
-is already right, since the e2e harness clears it between specs.
-`computeLeafPending` and the download lane's cooldown merge still read the file
-on purpose: the first wants a value it can clone without touching live
-fairness, the second exists precisely to pick up what a manual sync wrote from
-outside the runner.
-
-This is what the concurrency spec was for, and it is worth saying how it was
-nearly missed: the first version of that spec sampled for "both lanes in flight
-at one instant", which is the same property measured by a coin toss — it failed
-on a loaded machine and passed in isolation, which reads exactly like flake. The
-version that shipped compares the two timestamped pick logs AFTER the work, and
-it failed the same way in isolation, which is what turned "flaky test" into
-"empty pick log for a lane that is demonstrably working".
-
-### The review fix-up, the commit after `3bdf5ee`
-
-Three things review found after the e2e run, one of them a hole in the fix
-above. **`refreshLaneRun` copied two fields of the ledger, not the object.** Its
-idle check runs BEFORE the await that opens the new run, so `limit()` keeps
-reading the old run while the new one is being built and `next()` can dispatch
-one more unit against it — reachable on a `maxWorkers: 1` digest lane whenever
-a unit finishes with the TTL lapsed. That unit's `llmActive--` and its own
-`costUsd` then land on a run `laneLimit` no longer reads: a lease under-count
-that never recovers, and a unit's spend dropped from the cap. The whole `live`
-object is carried across now (`opened.live = laneRun.run.live`) — every field on
-it is per-run, and a runner's run is its lifetime — with a unit test that
-dispatches on the old run, settles after the swap, and asserts the limit reading
-the new run sees both the released lease and the spend.
-
-Also: `writeAutoQueueState`'s tmp path was `${file}.tmp-${pid}`, one per
-PROCESS, and `persist()` is fire-and-forget — so two lanes persisting within a
-few milliseconds could rename over each other's half-written file, leaving a
-`state.json` that reads as empty (tolerated) and loses a persisted platform
-cooldown across a restart (not). Pre-existing; two fast lanes made it reachable.
-It carries a per-write counter now. And `resetChannelSnapshotMemo` is wired into
-`/api/test/invalidate-cache` beside the other process-wide caches rather than
-left exported and uncalled: the memo is self-invalidating on (mtime, size) in
-production, but `resetData()` rewrites the same fixture paths and two specs
-writing an identical snapshot inside one filesystem tick would share a parse.
-
-### Divergences from the 1.2 bullets, and why
-
-- **One batch function, not two.** The plan kept `runDigestBatch` /
- `runBackfillBatch` and had them "drive operationBatch". They are one
- `runOperationBatch({lane, …})` with one `OperationBatchResult`, because the
- two result types were the drift: the card's summary printed `deferred` and
- `blocked`, the sweep's printed `skipped`, and neither printed the other's.
- `runDigestChannelJob` / `runBackfillChannelJob` keep their job kinds, their
- queue keys and their own summary lines, which is what the bullet was
- protecting.
-- **`runOperationUnit(run, unit, opts)` takes a prepared run context**, not
- `{op, videoId, channel, settings, signal, force}`. The engine, the
- duplicate-cluster plan and the fan-out envelope are per-RUN state — resolving
- them per video is precisely how a counter and a runner end up disagreeing
- about what is stale — so `openOperationRun` resolves them once and both
- callers (the batch, and the runner's loop) hold one.
-- **`laneLimit(settings, live)`**, with the lane on a tagged `live` union rather
- than as a separate first argument, so TypeScript narrows the shape instead of
- the function casting.
-- **The digest unit calls `digestVideo`, not `op.run()`.** `OperationRunOutcome`
- is five strings and digest's registry entry discards `engineCalls`, `costUsd`
- and `warningCount`. Routing it through `run()` would have silently disabled
- the SPEND CAP — `laneLimit` reads a per-run cost that would then never leave
- zero — and emptied the metered accounting line. It is one place, named in a
- comment, and the fix is to widen `OperationRunOutcome` to carry a cost, not to
- grow a second executor.
-- **`buildPendingByLeaf` gained `defaultOperations`.** The plan said a
- digest/backfill leaf naming no operation draws `operationsForLane(lane)`; the
- pure function had no way to express that, since `defaultBuckets` only reaches
- `ch.buckets`. It is the operation half of the same parameter and is `[]` for
- the two bucket lanes, so every tree written before operations existed is
- byte-identical.
-- **A pick is a VIDEO; the operation is chosen at dispatch.** `pending[leaf]` is
- a list of ids and a union-drawing leaf holds a video that may need diarization
- OR attribution, so `run()` asks the lane's operations in dependency order and
- runs the first with work. That forced the session's completed-set to be keyed
- by **(operation, video)**: retiring the whole video after one unit would break
- the dependency chain the lane exists to walk. A video leaves a leaf's list
- only once every operation THAT LEAF draws is done for it.
-- **The sweep panel's `data-lane` became `data-sweep-lane`.** The plan has the
- runner console render "beside the existing sweep section"; both carrying
- `data-lane` on one page fails every scoped lookup under Playwright's strict
- mode. `<section data-lane={kind}>` is the contract all four lanes share, so
- the attribute stayed with the runner and the panel being retired moved. Eight
- selectors across `auto-queue`, `backfill` and `attribution` specs follow it,
- and all eight are sweep-panel assertions that retire in 1.3.
-- **`/api/test/resume-lane?lane=` exists now**, not in 1.3. The plan called it
- "the existing resume test route"; there wasn't one for a runner —
- `/api/test/resume-backfill-sweep` resumes the SWEEP. This is the same shape,
- and 1.3 deletes that one rather than renaming it.
-- **Three new idle reasons**: `lane-blocked` (the lane's sweep is armed),
- `lane-held` (its own gate is shut — distinct from `downloads-paused`, which
- names one flag, and from `capped`, which is contention), `engine-unreachable`.
- The runner's engine preflight is an IDLE, not a throw: an unreachable ollama
- is a configuration problem an operator fixes without restarting anything, and
- it is re-probed on the run context's 60 s TTL.
-- **Two new job kinds**, `auto-digest` and `auto-backfill`, registered and
- pinned in `jobKinds.test.ts`. There is deliberately no `auto-digest-unit` to
- match `auto-download-unit`: a runner-dispatched digest runs IN-PROCESS and
- makes no job record, which is what lets a lane work per video where the manual
- verbs must work per channel.
-- **The concurrency spec measures overlapping pick-log INTERVALS**, not
- simultaneous in-flight counts. See the bug note above for why.
-- **`backfillLaneLimit` returns 0 for an empty operations list** where the old
- `Math.min(...kinds.map(...))` returned `Infinity`. Unreachable before (the
- batch returned early on no kinds) and unreachable now (the batch still does),
- but the limit is a shared function called by a runner too, and an unbounded
- limit for a lane with nothing to dispatch is not a defensible answer to have
- sitting there. Named because it is a silent behaviour fix, not a rewrite.
-- **`runOperationBatch`'s digest path uses `run.operations[0]`.** Correct while
- the digest lane carries exactly one operation, which its queue keys guarantee
- today; a second digest-queue operation would need the candidate list to carry
- its operation the way the backfill path's `flatMap` does.
-- **`backfill.spec.ts`'s concurrency test is kept as well as re-asserted.** The
- plan says the `backfill.spec.ts:615` invariant "moves, does not vanish". At
- the runner the mechanism is different — two loops on queueKey `""` dispatching
- in-process units, no queue key involved — so `lane-runner.spec.ts` proves the
- property there, and the original still covers the per-channel jobs, which
- still exist and still need distinct keys. 1.3 must keep at least one.
-- **One real behaviour change, and it is a convergence.** The digest lane's
- eligibility now goes through the registry's `state()` instead of an inline
- `allFresh`, so a video whose `transcript.cues.json` is superseded classifies
- `deferred` and is no longer dispatched-and-then-skipped by the engine, and
- `countOperationWork("digest")` counts the reachable set where
- `countMissingDigests` counted "not fresh". Corpus-wide `digest.deferred` is
- **15**, so a per-channel progress target moves by at most that. The registry
- entry's own header asked for exactly this: "If this entry and the lane's
- executor ever disagree about whether a video is digested, that is a bug."
-- **`plans/tools/phase1-poll-timing.ts`** is new, and `phase1-numbers.ts` was
- NOT extended: 1.2 moves no lane-visible number, for the reason at the top.
-
-### The `laneFor` trap is closed
-
-The GPU idle-only rule keyed off `k.laneFor &&` — the field EXISTING — as a
-proxy for "this one's resource depends on settings". It asks the DECLARATION
-now: `laneYieldsToTranscription(laneForOperation(op.id) ?? op.lane)`, on
-`contendsFor`. Identical on today's registry (no BACKFILL_QUEUE operation
-declares a static GPU lane), and an operation with a fixed GPU lane and no
-`laneFor` is now caught rather than missed. `operationBatch.test.ts` ("the GPU
-carve-out is keyed on contendsFor, not on laneFor existing") pins it, and the
-`Operation.laneFor` comment and the `plans/FACTS.md` entry both say the presence
-is no longer load-bearing.
-
-### Operator gate A — the production pass
-
-**Do this before 1.3 lands.** It is the "has run in production once" precondition
-every retirement in 1.3 stands on. ~20 minutes of attention, most of it waiting.
-
-Preconditions to check first, all read-only:
-
-1. `settings.json` (repo root) has **no `autoQueue.digest` key** and
- `digest.sweepEnabled: false`. If the sweep is armed the runner refuses to
- start and says so — that is the intended answer, not a bug.
-2. `digest.digestsPaused` is `false` and `digest.localAppId` is `ollama-direct`
- with `ollama serve` up. A dead engine idles the runner at
- `engine-unreachable` rather than failing 55,956 times.
-3. `transcription` is where the GPU contention lives: `digest.yieldToTranscription`
- is on, so the lane stands aside while whisper works. Leave it on.
-
-**The edit.** Add ONE block to `settings.json` — everything else untouched:
-
-```json
-"autoQueue": {
- "transcription": { …unchanged… },
- "download": { …unchanged… },
- "digest": {
- "enabled": true,
- "maxWorkers": 1,
- "order": "cheapest",
- "root": {
- "id": "digest-root",
- "mode": "strict",
- "children": [
- { "id": "digest-obviousrises", "match": { "type": "channel", "value": "ObviousRises-rumble" }, "weight": 1, "maxWorkers": null }
- ]
- }
- }
-}
-```
-
-`ObviousRises-rumble` is chosen because it held **6** reachable digests and 0
-blocked at the last snapshot — enough to watch several units, small enough to
-finish. Any channel works; note its `backfill.digest` counts before you start.
-**Do NOT add an `autoQueue.backfill` block:** `backfill.allowRedownload` is
-`true` with `reach: "corpus"` on this settings file, and that is gate B's
-decision, not gate A's.
-
-**Then, on `/operations/digest`:**
-
-1. Restart the editor (or POST `{"kind":"digest","action":"start"}` to
- `/api/auto-queue/control`). The **Auto-digest** section — the one with
- `data-lane="digest"` — should read *Runner running* with a job-log link.
-2. Watch the claim ladder's rule count fall and *Recent picks* fill. The pending
- figure beside it is this lane's own; it is not the sweep panel's.
-3. Let it run a pass. Record: **units dispatched** (Recent picks, or the job
- log's `Auto-digest: <channel>/<id>` lines), the channel's
- `backfill.digest.missing` **before and after** (read `snapshot.json`; the
- runner requests a regen after each unit), and any `Idle —` line and its
- reason.
-4. If a transcription starts beside it, record the **observed yield**: the
- runner's idle reason goes to `capped` and the job log carries the
- `Yielding the GPU to transcription …` line ONCE per contention window (it is
- edge-triggered on purpose). Note whether digest throughput actually stopped.
-5. **Restart the editor.** With `autoQueue.digest.enabled` still true, the boot
- hook must bring it back by itself — `startAutoRunnersIfEnabled` iterates
- LANES now. Confirm *Runner running* without touching a button, and that
- Recent picks continues rather than starting over.
-6. Hold and resume once from the page's **Hold the lane** button: the runner
- must stay *running* with `Idle — the lane is held`, not stop. That is the
- invariant the whole design rests on and it costs ten seconds to see.
-7. When you are done, set `"enabled": false` in the block (or leave it running —
- it is the intended end state).
-
-Record the numbers in this file under a `Gate A` heading. If step 5 or step 6
-fails, 1.3 does not land.
-
-### Traps for the 1.3 implementer
-
-- **`data-sweep-lane` goes with the panel.** Deleting `SweepOperationView`
- deletes the attribute; the eight specs pointing at it are all sweep tests and
- go with them. Do not "restore" `data-lane` to anything — the runner section
- owns it on all four lanes now.
-- **`laneBlockedReason` is the only thing left in `lib/pauseGates.ts` that reads
- a sweep flag.** It goes when the sweeps do, along with the `lane-blocked`
- idle reason and its two copies of the wording (`dispatch.ts`,
- `buildActiveJobs.ts`). `arbiter.ts`'s `arbiterBlockedReason` is now a
- two-line delegate to it and dies with the arbiter.
-- **`buildActiveJobs.buildLanes` still draws the digest and backfill rows as
- SWEEP lanes** (`sweepLane({kind: "digest-sweep" …})`) while the runner rows
- above them are named. 1.3's job is to make all four rows runner rows; the
- `getAutoRunnerStatus(lane)` they need already answers for four.
-- **`settings.digest.recencyOrder` is read in two places now**: the batch's own
- ordering and `recencyOrdering`'s `cheapest` composition in `autoRunner.ts`.
- The migration must carry BOTH halves of the digest order (duration and date)
- or it silently drops one — see the composition above.
-- **`.auto-queue/state.json` is written whole by whoever persists.** The
- runners share one in-memory object (`sharedAutoQueueState`) so that is safe;
- anything else that read-modify-writes it — `jobs/downloadBackoff.ts` does —
- can still lose picks recorded between its read and its write. If 1.3 adds
- another writer, give it the shared object rather than a fresh read.
-- **`OperationRun.settings` is a snapshot for IDENTITY only.** Guards re-read
- live settings at dispatch (`laneLimit` takes `getSettings()` from its caller).
- The runner rebuilds the whole context when the digest/backfill/diarization/
- attribution blocks change or on a 60 s TTL; the duplicate-cluster plan is
- carried across those rebuilds on purpose.
-- **`countOperationWork` opens a run with `useClusters: false`.** Counting must
- not read the corpus-wide duplicates report, and a mirror is `present` or
- `missing` on its own merits either way — which is what the snapshot counts.
-
-## 1.3, as shipped
-
-`253826b` (the migration, before anything is deleted) → `b172d5a` (the backend
-retirement) → `ca83051` (the editor half) → `65c0a49` (the e2e rewrites) →
-`ca28fb5` (the numbers script and the prose) → `43b2f9f` and `cdaccc4` (two
-fixes, below) → the commit after them, which carries this note and so cannot name
-its own sha. On `one-core/phase-1` off `0438a72`.
-
-**Gate A is run from `one-core/phase-1-gate-a` (which points at `0438a72`) and it
-gates the MERGE of this slice, not its authorship.** Everything below stands on
-"the digest lane's runner has driven a production pass and resumed after a
-restart"; the branch exists so the operator can do that against the code as it
-was when 1.2 finished, while 1.3 was written.
-
-Verification: `tsc --noEmit` clean in common, editor, export, mcp, homepage and
-umtool; `yt-dlp-transcript-common` **888** tests (897 before: **+8**
-`laneMigration`, **-17** — seven `sweepPreview`, seven `arbiter`, three
-`backfillLimit`/`sanitizeBackfill` weight cases), `yt-dlp-transcript-mcp` **205**;
-`next build` clean; full editor e2e from a `p13-e2e` worktree of the final commit
-— **511 passed, 1 failed, 31.2 min**, one worker behind the queue lock. 515 at
-1.2, minus the three arbiter tests, is **512**, which is the total run: the three
-rewritten `backfill.spec.ts` tests and the rewritten Reach test are one-for-one
-replacements, so no other count moved.
-
-**The one failure is not this slice's**, and it is worth saying how that was
-established rather than asserted: `video-page.spec.ts:216 "Delete directory
-wrong-id confirmation shows an error"` asserts a video DIRECTORY still exists
-after a refused delete. Nothing in 1.3 deletes a video directory, the file is
-untouched by the slice, and re-running that spec alone on the same commit passes
-**20/20**. It is an ordering or reset flake, reported and not fixed.
-
-### Deleted
-
-| File | Lines |
-|---|---|
-| `common/controller/backfillSweep.ts` | 519 |
-| `common/controller/arbiter.ts` | 418 |
-| `common/controller/digestSweep.ts` | 368 |
-| `common/controller/sweepPreview.test.ts` | 321 |
-| `common/controller/sweepPreview.ts` | 167 |
-| `common/lib/sweepPlan.ts` | 163 |
-| `common/controller/arbiter.test.ts` | 177 |
-| `common/controller/sweepRecency.ts` | 141 (git says `Bin` — the NUL byte) |
-| `common/controller/arbiterWork.ts` | 67 |
-| `editor/app/operations/components/SweepLane.tsx` | 422 |
-| `editor/app/operations/components/SweepPlan.tsx` | 264 |
-| `editor/app/operations/components/SweepScope.tsx` | 154 |
-| `editor/app/operations/components/ArbiterBar.tsx` | 113 |
-| `editor/app/api/test/resume-backfill-sweep/route.ts` | 35 |
-
-Plus, in place: the `backfill-sweep` and `operations-arbiter` job kinds, both
-`instrumentation.ts` resume hooks, `laneBlockedReason` (the last reader of a
-sweep flag) with the `lane-blocked` idle reason and its two copies of the
-wording, `saveLaneOrderAction`, `startArbiterAction` / `stopArbiterAction`, the
-four sweep server actions, `sweepLaneIdFor`, `SweepLaneStatus`, `ArbiterStatus`,
-`laneState.ts`'s `feedRunning` axis and `sweepLaneNote`, the `backfill-sweep`
-entry in `stageStatus`, and the `LaneSettingsForm` "Resource share" field.
-`operations/lanes.ts` goes 370 → 131. **Net across the slice: 1,448 insertions,
-4,939 deletions over 71 files.**
-
-`controller/digestPlan.buildDigestSweepPlan` STAYS — `bin/digest-plan` prices the
-backlog with it — and needed nothing kept beside it: it imports `planOrder`,
-which `digestPlan` already owned.
-
-**The architecture allow-list shrank by ONE**, not three. `lib/sweepPlan.ts ->
-controller/planOrder` died with the file. The plan expected `jobs/* -> controller`
-to go too, but those two entries are `jobs/snapshotScheduler.ts ->
-controller/channelSnapshot` and `jobs/workerPool.ts -> controller/remoteCapacity`
-— a snapshot builder and a capacity probe, unrelated to the sweeps and still real
-back-edges. The guard fails on a stale entry, which is how that was checked
-rather than assumed. **No entry was added.**
-
-### The migration
-
-`getSettings` runs `migrateSweepsToLanes(parsed)` before `sanitizeAutoQueue`, on
-the PARSED FILE rather than the merged object — "absent from the file" is the
-trigger, and a merged object has already had the defaults folded in and can no
-longer tell absent from default.
-
-| Retired field | Becomes |
-|---|---|
-| `digest.sweepEnabled` | `autoQueue.digest.enabled` |
-| `digest.sweepChannels` | `autoQueue.digest.root` — a strict group of channel leaves; empty ⇒ one `{type:"all"}` leaf |
-| `digest.recencyOrder` | **nothing** — see below |
-| `digest.recencyReach` | **nothing** — see below |
-| `backfill.sweepEnabled` | `autoQueue.backfill.enabled` |
-| `backfill.sweepChannels` | `autoQueue.backfill.root` channel leaves |
-| `backfill.sweepKinds` | `match.operation` on those leaves; empty ⇒ leaves naming none, which draw the lane's whole union |
-| `backfill.order` | `autoQueue.backfill.order` |
-| `backfill.reach` | **nothing** — see below |
-| `backfill.weight` | **nothing** — the yield is `contendsFor`, the share is `concurrency` + the lane's `maxWorkers` |
-
-**`digest.recencyOrder` is not migrated onto `order`, and this is the decision the
-1.2 note asked 1.3 to take.** The digest order is a COMPOSITION — shortest inside
-a day, newest day first — which the lane already spells `cheapest`;
-`recencyOrder` was only its date half. Migrating it would have replaced the
-composition with one of its two terms. The date half is fixed at newest-first (the
-live value) in `recencyOrdering`, and a digest lane wanting pure recency sets
-`order: "newest"` and gets no duration term at all.
-
-**Neither `reach` is migrated, and `AutoQueuePolicy` gains no `reach` field.** The
-plan's bullet says `recencyReach → reach`, and that sentence predates what 1.1
-actually shipped: `OrderReach.tsx` renders `reach={null}` for a runner lane and
-says why in a comment — a rule already orders every video it claims across every
-channel and bucket, so there is no second axis, and which RULE goes first is the
-tree. Adding a stored `reach` nothing reads would be config with no reader,
-contradicting a decision documented in three places. Behaviour-neutral either
-way: nothing reads it once the sweeps are gone.
-
-Written as a pure function, `common/lib/laneMigration.ts`, with
-`common/jobs/laneMigration.test.ts` (in `jobs/` because `architecture.test.ts`
-forbids `lib/` importing `jobs/`, and the migration has to be asserted THROUGH
-`sanitizeAutoQueue` — it deliberately emits raw nodes for the sanitizer to
-normalize rather than being a second implementation of it). Eight cases: the live
-shape, an armed digest sweep with three channels, an armed backfill sweep with two
-kinds and one channel, an operation scope with no channel scope, a file that
-already carries the blocks (untouched, and idempotent over its own output), an
-empty file, blank/duplicate scope entries, and the arm-equals-migration check.
-
-**The arm-equals-migration check is a unit test, and it holds by construction.**
-`armLaneAction` and `migrateSweepsToLanes` both call `laneRootFromScope`, so
-"arming the digest lane on channels X" and "migrating `sweepChannels: X`" are the
-same function; the test asserts it so that a second leaf builder added later fails
-there rather than in production. It is also visible in the numbers diff: the
-migrated leaf ids are `digest-all` and `backfill-all`, which only that builder
-produces. `backfill.spec.ts`'s rewritten scope test asserts the other half from
-the browser — a rule authored on the console persists as `match.operation` on the
-lane's root.
-
-### Numbers
-
-Before/after `plans/tools/phase1-numbers.ts` over the live corpus: **0 lines
-removed, 18 added.** Every pre-existing line is byte-identical and in place,
-which is why the file's own lanes are still printed first and the migrated ones
-appended.
-
-```
-> download leaves = [{"type":"channel","value":"quartering-live"}, … ,{"type":"all"}]
-> transcription leaves = [{"type":"channel","value":"quartering-live"}, … ,{"type":"all"}]
-> digest enabled = false
-> digest order = cheapest
-> digest maxWorkers = null
-> digest replaceAutoSubs = false
-> digest leaves = [{"type":"all"}]
-> backfill enabled = false
-> backfill order = newest
-> backfill maxWorkers = null
-> backfill replaceAutoSubs = false
-> backfill leaves = [{"type":"all"}]
-> digest leaf digest-all = 56223
-> digest TOTAL = 56223
-> digest nextUp = digest-all/lv474Pl-H_k
-> backfill leaf backfill-all = 80193
-> backfill TOTAL = 80193
-> backfill nextUp = backfill-all/qXow_UvcHkI
-```
-
-`enabled: false` on both, one catch-all leaf apiece — exactly what the live
-file's disarmed, unscoped sweeps meant. The two totals match 1.2's poll-timing
-measurement (56,223 / 80,193) to the video. The two `leaves` lines on the runner
-lanes are the one addition outside the migrated sections: leaf shapes are printed
-for every lane rather than only the new two, because a section only some lanes get
-is the kind of asymmetry that rots.
-
-One new guard in the script: diagnostics from `common/` are dropped. Pricing the
-digest lane makes the recency index log a `[recency] dating N of M undated
-candidates` line whose numbers move between runs on the same corpus, and one
-nondeterministic line in a file whose whole purpose is byte-for-byte comparison
-would make every later slice's evidence unreadable.
-
-### Divergences from the 1.3 bullets, and why
-
-- **`reach` is retired, not migrated.** Above.
-- **`digest.recencyOrder` is retired, not migrated.** Above — and this one the
- plan already asked for.
-- **The allow-list shrank by one, not three.** Above.
-- **`backfill.weight` retiring is a real behaviour change, and it is named.** One
- 0..1 scalar answered two questions: "does this run contend with transcription"
- and "how much of the machine may it have". Its default of 0 meant idle-only for
- the WHOLE lane, so a `contendsFor: "network"` attribution run parked itself
- behind a GPU transcription it was not competing with. `backfillLimit` takes
- `idleOnly` now, keyed on the operation's declared lane exactly as 1.2's
- carve-out already was. A diarization run is unaffected on a GPU backend; an
- attribution or a CPU diarization run no longer stands aside. The lane is
- disarmed on this corpus, so the live path this changes is the per-channel
- **manual** Run.
-- **`laneState.ts` keeps four states; `sweepLaneNote` is what actually died.** The
- plan says the `feedRunning` axis and the note both go. The axis did go — every
- lane is a runner lane, so "a corpus sweep is armed" is not a state anyone has —
- but `deriveLaneState` still has four values, because `holding` (gate shut,
- runner up) is the state with no other name and deleting it was never the point.
-- **`JOB_KINDS_BY_LANE` is rekeyed, not deleted.** It is the MANUAL per-channel
- jobs — `digest-channel-local`, `backfill-channel`, `diarize-channel` — and
- without them a hand-started digest is invisible on the digest page. The two
- sweep orchestrator kinds are gone from it and it is keyed by `AutoQueueKind`
- with `[]` for the two bucket lanes.
-- **`armLaneAction` takes an OPTIONAL scope.** Given one it writes the root;
- absent it keeps the stored tree. The dashboard and widget cards call it with
- `{}` — the whole corpus, which is what "Sweep every channel" meant — and the
- scope is authored on the lane's console. That keeps the invariant "the runner
- console is the only surface an arm can be SCOPED from" while not deleting the
- one-click corpus pass the two cards have always had.
-- **`disarmLaneAction` drains rather than stops.** The sweep's stop drained — the
- video in flight finishes — and that is worth more than symmetry with the
- console's Stop button, which is a different control with a different promise.
-- **The dashboard's arm control is renamed, not kept.** `start digest sweep` /
- `stop digest sweep` / `start backfill sweep` / `stop backfill sweep` become
- `arm|disarm digest|backfill lane`, and the labels become "Run every channel" /
- "Stop the lane". The retired-routes rule is honoured by asserting the old names
- gone in the specs that pinned them (`backfill.spec.ts`, `auto-queue.spec.ts`).
-- **The widget sync payload's `sweeping` becomes `armed`** (`autoQueue[lane].
- enabled`) rather than being deleted: the deck's control needs to know which of
- its two states to draw, and the question is the same one asked of the thing that
- now answers it. A pinned widget tab that predates this reads `undefined ??
- false` — not armed — until it is reloaded, exactly as the `held` rename did.
-- **`startAutoRunnerBlockedReason` survives with one reason.** It had two (a
- disabled policy, an armed sweep); it now answers "this lane's policy is
- switched off". Deleting it would have made the console's Start a silent no-op
- on a disabled lane, which is the failure the function was written for.
-- **`buildActiveJobs.buildLanes` takes no argument now.** It counted in-flight
- work on the sweep lanes by scanning the job rows for their queue keys; four
- runner rows read `getAutoRunnerStatus(lane).inFlight`, which is in-memory.
-
- **THIS CHANGES RENDERED TEXT ON A LIVE LANE, and the plan did not ask for it.**
- The four rows now fold `gateHeld` through `deriveLaneState`, so a held
- transcription or download row on the /jobs strip reads **Holding** where it
- read *Idle* — and the live `settings.json` has `transcriptionsPaused: true`, so
- this is what the operator will actually see. It is kept rather than reverted
- because the strip and the operations rail (which has derived it that way since
- slice 7) disagreed about the same lane until now, and one fold cannot answer
- twice. Said plainly here rather than filed as a no-op, because "no rendered
- number moved" is a claim this slice otherwise makes and this is the exception.
-- **The sweep panel's surviving prose moved rather than died.** The band, the
- "this operation is switched off" warning and the "shares one lane, one runner
- and one pause with …" sentence are a `LaneOperationContext` **div** above the
- console — a nested `<section>` would break every `locator("section", { has })`
- in the suite. The "also runs on …" line is in `LaneHeader`, per LANE: the slots
- belong to the machine, so two operations served by one endpoint are one row.
-- **`e2e/backfill.spec.ts` had three sweep tests, not seven.** The other four
- sweep-shaped assertions the bullet counted are `data-sweep-lane` selectors
- inside tests about other things (the diarization page's populations, the two
- pause tests, `attribution.spec.ts`'s per-operation bands); those were rehomed
- onto the runner section and the rail's row rather than rewritten.
-- **`operation-settings.spec.ts` needed no change.** Its two lane-form tests use
- "Run the backfill lane" and "Save lane settings", both of which survive; only
- the "Resource share" field went.
-
-### What the specs pin now, where they pinned a sweep
-
-- **`the lane arms from the dashboard and disarms without losing its rules`** —
- the sweep pair pinned "the flag is persisted without the scope" and "stopping
- leaves the scope behind". Both are unreachable now (the scope IS the tree, in
- the same write as the switch), so the test pins the other half of that bargain:
- disarming must NOT clear the tree.
-- **`a lane can be scoped to one operation from its console, and the scope is a
- tree`** — drives the ladder's `rule operation` select and asserts
- `match.operation` on the persisted root.
-- **`an armed lane comes back after a restart`** — `/api/test/resume-lane?lane=
- backfill`, which 1.2 added for exactly this.
-- **`the digest lane offers Shortest first, and has no Reach axis`** — replaces
- the Reach test. Reach asserted GONE, `cheapest` asserted present on the one lane
- that can price its work, and the order asserted to land on
- `autoQueue.digest.order` with `digest.recencyOrder`/`recencyReach` gone from the
- file.
-- **`section[data-sweep-lane]` is asserted to have COUNT 0** on both an operation
- page and the digest page — not merely unused.
-- **The three arbiter tests are deleted.** Its leaf-order case already lives in
- `autoQueuePolicy.test.ts`.
-- **`backfill.spec.ts`'s concurrency test survives**, as the plan requires: it
- covers the per-channel jobs, which still exist and still need distinct queue
- keys. `lane-runner.spec.ts` test 4 covers the property at the runner.
-
-### What review found before the e2e run
-
-**`LaneOperationContext` was drawn on every page with a runner** (`43b2f9f`).
-It is about THIS OPERATION — its band, its "switched off" warning, the sentence
-naming the operations it shares a queue with — and on
-`/operations/transcription` the lane's operation list is `[]` by construction, so
-`switchedOn` was false and the page claimed auto-transcribe was switched off in
-settings that do not exist. It is gated on `bucketsByKind[lane].length === 0`
-now: exactly the two lanes whose work list is an operation's ids rather than a
-snapshot bucket. Worth naming because it is the shape of mistake this slice
-invites — a block that was written for two lanes, moved onto a component that
-serves four.
-
-**The dashboard's arm button was discarding the lane's rules** (`cdaccc4`).
-`armLaneAction(lane, {})` is not the same call as `armLaneAction(lane)` — an
-empty scope object is still a scope, so the deck wrote a catch-all root over
-whatever tree an operator had authored on the console. Three channel rules, one
-click, gone, and disarming would not bring them back. The button it replaces did
-the opposite: `startDigestSweepAction()` with no argument INHERITED
-`sweepChannels` off disk. It passes no scope now, and the label follows the truth
-— "Run the lane", not "Run every channel", because on a narrowed lane every
-channel is not what it would do.
-
-**`git add -A editor` staged the operator's `editor/content` symlink** into the
-e2e commit, which put it in the worktree, which panicked Turbopack before the
-first spec — the exact failure `plans/FACTS.md` documents for the primary
-checkout, arriving by a route that entry did not cover. The two commits were
-rewritten to drop it and FACTS.md now says so. Add by path in this repo.
-
-### The fix-up, after review
-
-The commit carrying this section, and so unable to name its own sha — the same
-knot the 1.2 note hit. Four things, none of them behaviour on a live lane:
-
-- **The arbiter's buttons are asserted GONE.** `ArbiterBar` carried
- `aria-label="Start the arbiter"` / `"Stop the arbiter"` and its three tests
- were deleted with it, so `grep -rn -i arbiter editor/e2e/` was EMPTY — nothing
- would have noticed a live Start button over a dispatcher that never ran a unit
- coming back. Same hole on the DISARM halves: only `start … sweep` was pinned
- gone, so `stop digest sweep`, `stop backfill sweep` and *Stop sweeping* could
- have survived over actions that no longer exist. Both halves, both surfaces,
- now `toHaveCount(0)`.
-- **The full-scope collapse moved into `laneRootFromScope`.** `armLaneAction`
- collapsed a scope naming every operation to `[]` (so the leaf tracks the
- registry) and the migration did not, which is two answers to one question
- through one builder. It is one rule now, keyed on a new optional
- `available` — passed by the arm action, absent from `getSettings`, which cannot
- ask the registry without pulling the controller layer into every reader of
- settings.json. Absent is a no-op on every settings file that exists: the live
- `sweepKinds` is `[]`, and empty already meant the union. **Numbers diff
- unchanged.**
-- `LaneDeck`'s backfill card still explained itself in terms of "the corpus-wide
- backfill sweep" and "at the default weight the lane is ALREADY idle-only".
- Both retired; the yield is the operation's declared `contendsFor`, which is
- NARROWER than the old sentence claimed — a network-bound attribution run does
- not stand aside at all.
-- The trap below about which writers must gain `held` was wrong. Corrected.
-
-**Dead after this slice, and 1.4 deletes them:** `AutoQueueReach`,
-`sanitizeAutoQueueReach` and `AUTO_QUEUE_REACHES` in
-`jobs/autoQueuePolicy.ts`/`lib/autoQueueTypes.ts` have no reader left, and
-`OrderReach.tsx`'s whole `reach !== null` branch (the select, `REACH_LABEL` and
-two of its four sentences) is unreachable — every caller passes `null`.
-
-### Traps for the 1.4 implementer
-
-- **Every GATE read of the four legacy fields is inside `lib/pauseGates.ts`** —
- `transcriptionsPaused`, `downloadsPaused`, `digest.digestsPaused`,
- `!backfill.enabled`, in `isGateHeld` (`:85-92`) and `withGateHeld` (`:114+`).
- Nothing in `common/controller/`, `common/jobs/` or `editor/app/` asks the
- question any other way. The files that touch the FIELDS for another reason,
- and which 1.4's deletion step has to visit:
- `editor/app/settings/actions.ts:222-223` (spreads `transcriptionsPaused` and
- `downloadsPaused` through an unrelated save — this is the "settingsActions
- spread" the 1.4 bullet names), `editor/app/operations/settingsActions.ts:102`
- (same, for `digestsPaused`), `LaneSettingsForm` + `settingsActions` for
- `backfill.enabled` behind "Run the backfill lane", `editor/instrumentation.ts`
- re-applying `transcriptionsPaused` to the worker pool at boot (the intent-vs-pool
- asymmetry that must survive), and `editor/app/workers/buildWorkers.ts:54`, which
- already goes through `isGateHeld`. The e2e reads on disk are
- `auto-queue.spec.ts` (`downloadsPaused`), `dashboard.spec.ts`,
- `backfill.spec.ts` (`backfill.enabled`, three tests, via its `laneEnabled`
- helper) and `widget.spec.ts`.
-- **`held` should land on `AutoQueuePolicy`, beside `enabled` and `snoozeUntil`,
- and `sanitizePolicy` is the one place to default it.** **ONE writer has to gain
- the key: `saveAutoQueueAction`** (`editor/app/operations/actions.ts:~47`),
- which spells every policy field EXPLICITLY — its own comment says why, and that
- is exactly the hazard: a field it forgets is dropped on every save. Its
- neighbours are safe by construction — `armLaneAction` and `disarmLaneAction`
- (`editor/app/jobs/actions.ts:~203`) SPREAD `...policy` and override only
- `enabled` and `root`, so they carry `held` for free — and so does
- `snoozeAutoQueueAction`. An earlier draft of this note said all of them spell
- the fields out; it was wrong, and the difference is the whole trap.
-- **The numbers script already prints `held <lane>` for all four lanes** through
- `isGateHeld`, so 1.4's before/after diff over the live corpus is a direct test
- of the fallback: it must stay `true/false/false/false` while the file carries
- only the legacy fields.
-- **`withGateHeld` must keep spreading.** `pauseGates.test.ts`'s "holding the
- backfill lane leaves the rest of its block alone" now also asserts
- `held.autoQueue` deep-equals the input's — the tree is the thing a rebuilt
- literal would drop next.
-- **`backfill.enabled` is a lane gate AND a form checkbox.** 1.4's "delete the
- four legacy fields" step has to decide what "Run the backfill lane" writes;
- today it writes the same field the pause does, on purpose.
-
-## 1.4, as shipped
-
-`0040e39` (the model, the gate and the read-time copy) → `3ab52ba` (the editor's
-writers) → `fabde02` (the dead `reach` code) → `63242e4` (fixtures, specs and the
-three-surface e2e) → `960f51a` (the one spec the full run caught) → the commit
-carrying this note, which cannot name its own sha. On `one-core/phase-1` off
-`451c454`.
-
-**Numbers: the before/after diff of `plans/tools/phase1-numbers.ts` over the live
-corpus is EMPTY** — 2,629 lines each, byte-identical. That is not a formality here,
-it is the slice's own fallback test: the live `settings.json` carries
-`transcriptionsPaused: true`, `downloadsPaused: false`, `digest.digestsPaused:
-false`, `backfill.enabled: true` and **no `held` anywhere**, so the script's four
-`held <lane>` lines (`true/false/false/false`) are produced entirely by the legacy
-path through `isGateHeld`.
-
-Verification: `tsc --noEmit` clean in common, editor, export, mcp, homepage and
-umtool; `yt-dlp-transcript-common` **896** tests (890 before: **+6** — three in
-`pauseGates.test.ts` replacing two, so net +1; four `migrateHeldToLanes` cases in
-`jobs/laneMigration.test.ts`; one hold-not-stop case in `operationBatch.test.ts`),
-`yt-dlp-transcript-mcp` **205**; `next build` clean; full editor e2e from a
-`p14-e2e` worktree of `63242e4` — **513 passed, 1 failed, 25.3 min**, one worker
-behind the queue lock. **514 total: 512 at 1.3, plus this slice's two new tests.**
-1.3's `video-page.spec.ts:216` flake passed this time.
-
-**The one failure was mine, and the full run is what caught it.**
-`operation-settings.spec.ts:104` ("the lane's switch survives a save of the
-operation form beside it") ticks "Run the backfill lane", saves the diarization
-form beside it, and asserted the switch by reading `backfill.enabled` — the field
-the checkbox stopped writing three commits earlier. The property and the clicks
-are unchanged; only the key it reads back moved, and checked now means
-`held: false`. Fixed in `960f51a` and re-run from a worktree of that commit —
-`operation-settings.spec.ts`, `lane-runner.spec.ts` and `backfill.spec.ts`
-together, **31 passed, 0 failed**.
-
-**How it was missed, because the shape recurs:** the bullet's grep is
-`transcriptionsPaused|downloadsPaused|digestsPaused` over `editor/e2e`, and the
-FOURTH field is spelled `backfill.enabled` — a name too generic to grep for
-blindly, which is why the census that found it (`grep -rn "backfill\.enabled"`)
-was run over `common/` and `editor/app` with `e2e/` EXCLUDED, to keep the output
-readable. The lane's inverted field is the one that needs both greps.
-
-### Where a lane's gate is written, and by whom
-
-| surface | control | writes |
-|---|---|---|
-| dashboard deck (`LaneDeck`) | Pause / Hold, all four lanes | `autoQueue[lane].held`, via `pauseLaneAction`/`resumeLaneAction` → `withGateHeld` |
-| monitor widget rail | the same deck | the same |
-| runner console (`LaneHeader`) | Hold the lane | the same |
-| `/workers`, `/jobs` strip | Pause Transcriptions / Downloads | the same (transcription flips the POOL first) |
-| `LaneSettingsForm` | "Run the backfill lane" | `autoQueue.backfill.held`, via `saveBackfillLaneSettingsAction` → `withGateHeld` — a deliberate second writer of one key |
-| lane console policy form | Save policy | carries `held` through `saveAutoQueueAction`, beside `snoozeUntil` |
-| `armLaneAction` / `disarmLaneAction` / `snoozeAutoQueueAction` | arm, disarm, snooze | nothing — they spread the policy and carry `held` for free |
-| `/settings` form, digest settings form | — | nothing; they PRESERVE their retired field and the whole `autoQueue` |
-| `getSettings` | — | nothing on disk: it fills `held` in memory, and the next write persists it |
-| `editor/instrumentation.ts` | boot | nothing; it READS `isGateHeld(…, "transcription")` and applies it to the pool |
-
-Every reader is `isGateHeld`, unchanged: `laneGuards` (digest), `operationBatch`
-(backfill), `autoRunner` (download), `operations/status.ts`, `api/widget/sync`,
-`buildActiveJobs`, `buildWorkers`, `channels/groupActions`, `pipelineActions` and
-the numbers script.
-
-### What stays, and the condition for deleting it
-
-`transcriptionsPaused`, `downloadsPaused`, `digest.digestsPaused` and
-`backfill.enabled` **remain in `SiteSettings` and in their sanitizers**, as the
-migration's input and nothing else — no reader outside `legacyGateHeld` is left,
-and `backfill.enabled` now has no WRITER at all. They go in a later slice, and the
-condition is exact: **the live `settings.json` carries all four `held` keys**,
-which happens on its first write through the editor after this slice ships. Until
-then a file that has never been written is still read correctly, and that is the
-whole reason the sanitizer refuses to default the key.
-
-### Divergences from the 1.4 bullets, and why
-
-- **`legacyGateHeld` lives in `common/lib/laneMigration.ts`, not in
- `pauseGates.ts`.** The bullet has `isGateHeld` "falling back to the legacy
- field", which reads as "in that file"; it cannot be. `getSettings` has to run the
- copy on EVERY read of settings.json, and `pauseGates.ts` imports
- `lib/operations.ts` (for `pauseLaneFor`), which imports the controller layer. A
- pause fallback defined there would pull the entire operation registry into every
- reader of settings.json — `bin/` scripts, the MCP server, the export build — and
- make a runtime cycle out of `settings → pauseGates → operations → controller →
- settings`. So the four RETIRED fields are read beside the other retired fields,
- and `isGateHeld` delegates. There is still exactly one place that knows the
- inversion.
-- **The copy runs on the MERGED settings, not the parsed file.** `migrateSweepsToLanes`
- takes `parsed` because "absent from the file" is its trigger; this one's trigger
- is "the sanitized policy has no `held`", and two of the four fields it reads live
- in the `digest` and `backfill` blocks, which are sanitized further down
- `getSettings`. It is called after them.
-- **Only ONE writer of a legacy pause field actually existed, and it is the one
- that was rewritten.** The bullet names three. `saveBackfillLaneSettingsAction`
- genuinely flipped `backfill.enabled` from a checkbox and now goes through
- `withGateHeld`. The other two — `settings/actions.ts`'s spread and
- `saveDigestSettingsAction`'s `digestsPaused: dD.digestsPaused` — PRESERVE the
- current value inside an object that also preserves the whole `autoQueue`, so
- they cannot flip either half and cannot drift. Routing them through
- `withGateHeld` would have turned two unrelated settings forms into pause
- writers, which is a larger claim than the bug being avoided. Both carry a
- comment saying they are preserving migration input.
-- **"limit() returns 0 for a held lane (all four)" is not a true statement, and
- the test says what is.** Only the two OPERATION lanes hold through `limit()`:
- `laneLimit` returns `{limit: 0, hold: {reason: "paused"}}` for digest and
- backfill. The download lane's gate is asked in `next()` (idle reason
- `downloads-paused`) and transcription's is the worker pool's slot count — one
- gate, three shapes, which is the asymmetry `pauseGates.ts` has always
- documented. So the unit test pins the two lanes where the claim holds, through
- the NEW key and against a disagreeing legacy field in both directions, and
- `lane-runner.spec.ts` proves the other half from the browser: `running` stays
- true at `lane-held`, on all three surfaces.
-- **The e2e fallback proof uses the DIGEST lane, not transcription.** The bullet
- offers `/operations/transcription` "or the status API"; neither can show it. No
- UI surface may read transcription's stored value — every one of them reads the
- pool, `/api/auto-queue/status` included (`status.ts:113-117`) — so a fixture
- carrying `transcriptionsPaused: true` is correctly invisible to a page, and a
- spec asserting otherwise would be asserting the bug that rule exists to
- prevent. Digest's flag IS its gate, so the fallback is observable there.
- Transcription's fallback is covered by `pauseGates.test.ts` and, over the live
- corpus, by the numbers diff above.
-- **`OrderReach.tsx` is `LaneOrder.tsx`.** Deleting the `reach !== null` branch
- leaves a component named for an axis it no longer has, on a page whose whole
- argument is that a runner has no such axis. One import site.
-- **`LaneSettingsForm`'s sweep prose went with the checkbox.** It still told the
- operator that the lane's scope "lives in the sweep controls directly above" —
- controls slice 1.3 deleted. It names the rule list on the console now, and the
- checkbox says it is the same gate as the Hold button.
-- **No `/api/test/settings` route was added.** The e2e helper `readJson(
- "test-settings.json")` already reads the file the editor writes; a route would
- have been a second way to ask.
-
-### What the specs pin now
-
-- `auto-queue.spec.ts` — the runner-page pause writes `autoQueue.download.held`;
- a hold survives a rule reorder through `saveAutoQueueAction` (`held=true` is part
- of the same poll that asserts the order landed); and **an unmigrated file** — the
- retired `digest.digestsPaused`, no key — reads as held on `/api/auto-queue/status`
- and on the console, and carries `autoQueue.digest.held` after the first toggle.
-- `lane-runner.spec.ts` (6) — the console, the dashboard and the widget each hold
- the digest lane by writing the same key, with the other three lanes' keys
- compared before and after each hold AND each release, and the runner asserted
- `running` with `idleReason: "lane-held"` at every one.
-- `dashboard.spec.ts`, `backfill.spec.ts` (two tests), `widget.spec.ts` — the same
- reads, moved off `downloadsPaused` and `backfill.enabled`; the backfill helper's
- polarity stops being inverted.
-- `disk-space.spec.ts` — its three fixtures spell the manual pause as
- `autoQueue.download.held`, which is what an editor-written file now looks like.
-
-### Traps for the 1.5 implementer
-
-- **`sanitizePolicy` must never default `held`.** An absent key is what makes the
- legacy fallback fire; defaulting it to `false` reads every unwritten
- settings.json as "no lane held" and resumes a paused corpus. The deletion slice
- removes the FALLBACK and the four fields together — at which point defaulting it
- becomes correct and is a required part of that change, not an optional tidy.
-- **`held: undefined` never reaches the file**: `JSON.stringify` drops it, so a
- lane that has not been through `getSettings`' copy stays genuinely absent rather
- than gaining a null.
-- **`plans/tools/phase1-numbers.ts` still prints `backfill.enabled`,
- `transcriptionsPaused` and `downloadsPaused` off the settings TYPE, and
- `digest.sweepEnabled`/`backfill.sweepEnabled` off the RAW FILE.** The deletion
- slice moves the first three to the raw file or drops them; either way it is a
- numbers-diff-visible change and has to be explained in that slice's note.
-- **`backfill.enabled` has no writer left.** It is frozen at whatever the file
- says, which on the live corpus is `true`. Nothing reads it but the migration —
- do not "fix" a surface to write it again.
-- **`laneGuards.test.ts` and `operationBatch.test.ts` cast partial objects to
- `SiteSettings`.** `isGateHeld` reads `settings.autoQueue?.[lane]?.held` with
- optional chaining for exactly that reason, while `legacyGateHeld` keeps the
- original non-optional access to the digest and backfill blocks — an absent block
- throws there, as it always did, rather than silently answering "not held" (which
- for the inverted backfill field would be the WRONG default).
-- **Grep `editor/e2e` for `backfill.enabled`, not just for the three `*Paused`
- names.** That asymmetry cost this slice its only red — see above. The deletion
- slice touches the same four fields and will hit the same trap.
-- **1.5 touches `generateChannelSnapshot`, not this.** No snapshot, bucket or
- operation count moved in 1.4; the numbers script's snapshot section is unchanged
- and remains the baseline.
-
-## 1.5, as shipped
-
-`4cb226e` (the entries) → `3912e4f` (the runner draws a lane) → `9daf8c6` (the
-live-corpus check) → `2133d94` (the e2e) → `a7922a3` (the projection stops
-copying) → `d8754d2` (the band the e2e caught) → the commit carrying this note,
-which cannot name its own sha. On `one-core/phase-1` off `1a4524b`.
-
-**Numbers: the before/after diff of `plans/tools/phase1-numbers.ts` over the live
-corpus is EMPTY** — 2,629 lines each, byte-identical. That is the slice's own
-migration test, twice over. No snapshot is regenerated, so the script's generic
-`Object.keys(snapshot.backfill)` walk finds the same four operations on all 68
-channels; and every `computeLeafPending` total is unchanged because the runner's
-new default draw — the lane's work list — is the same array the bucket union
-folded to, by construction.
-
-Verification: `tsc --noEmit` clean in common, editor, export, mcp, homepage,
-umtool and `plans/tools`; `yt-dlp-transcript-common` **908** tests (896 before:
-**+12** — eight in `autoQueuePolicy.test.ts`, three in `channelSnapshot.test.ts`,
-one in `operations.test.ts`), `yt-dlp-transcript-mcp` **205**, root
-`pnpm test:scripts` 71 passed / 1 skipped; `next build` clean; full editor e2e
-from a `p15-e2e` worktree of `2133d94` — **514 passed, 1 failed, 25.1 min**, one
-worker behind the queue lock. 515 total: 514 at 1.4 plus this slice's one new
-test. 1.3's `video-page.spec.ts:216` flake passed.
-
-**The one failure was this slice's own band assertion, and it was right** — see
-below. `d8754d2` fixes it, and the eight specs that could see the fold
-(`backfill`, `channels`, `channels-counts`, `channel-line`, `lane-runner`,
-`auto-queue`, `attribution`, `digest`) were re-run from a worktree of that
-commit: **87 passed, 0 failed, 4.6 min**. The only other code after the full run
-is `a7922a3`, which changes an allocation and nothing else.
-
-### What it writes, and why the two entries are hand-folded
-
-`generateChannelSnapshot` now writes `backfill.download` and
-`backfill.transcription`. They are the only entries in that map with no
-`Operation.state()` behind them — download and transcription are
-`EXTERNAL_OPERATIONS`, registered for the dependency graph and dispatched by
-their own runners — so `foldBucketLaneEntry` states the four numbers rather than
-counting classifications, and is EXTRACTED beside `foldBackfillEntry` for exactly
-the reason that one was: inside the generator it could only be reached with lmdb,
-an archive reader and a corpus on disk.
-
-| field | download | transcription |
-|---|---|---|
-| `ids` | `partialDownloads` ∪ `undownloadedIds` | `downloadedNoTranscript` ∪ `failedListed` |
-| `missing` | `ids.length` | `ids.length` |
-| `stale` / `partial` / `blocked` / `deferred` | 0 | 0 |
-| `missingInput` | 0 — the input is the listing | `buckets.noTranscript.length` |
-| `eligible` | `totals.downloaded + missing` | `totals.transcribed + missing + missingInput` |
-
-`stale` and `partial` staying 0 is what keeps `channelSnapshot.test.ts`'s
-invariant (`ids.length === reachableOperationWork(entry)`) true for these entries
-too, and `eligible` is defined so `presentOperationWork()` gives back
-`totals.downloaded` / `totals.transcribed` exactly — pinned by a unit test and,
-over all 68 live channels, by the check script. Videos excluded from download and
-untranscribable ones are in neither half: they are this operation's
-not-applicable, the same exclusion `foldBackfillEntry` applies.
-
-### The proof, both halves
-
-**(a) The projection equivalence, as a unit test.** Four cases in
-`autoQueuePolicy.test.ts` — both bucket lanes × `replaceAutoSubs` on and off —
-build the same tree over the same corpus under the bucket projection and the
-operation projection and assert the pending map deep-equals AND that draining
-both yields the same `<leaf>/<video>` sequence. A fifth asserts a snapshot with
-no entry falls back to an identical list.
-
-The corpus is SYNTHETIC rather than one of the e2e fixtures, and that is a
-divergence worth naming: there are no snapshot fixtures on disk (`snapshot.json`
-is generated at run time by every spec that needs one), and a synthetic one can
-carry the three traps a fixture does not — a video in two default buckets
-(`t1` in both `downloadedNoTranscript` and `failedListed`, so dedup order
-decides), an `undownloadedIds` that is NOT sorted, and a `match.bucket` retry
-leaf sitting above a catch-all so the claim space is exercised.
-
-**(b) `plans/tools/phase1-worklist-check.ts`, over the 68 live snapshots.**
-Read-only, regenerating nothing. It re-derives the union BY HAND from the literal
-bucket names in the literal priority order — the independent half, so the check
-is not the fold testing itself — and compares it to `bucketLaneWorkIds`, to
-`foldBucketLaneEntry(...).ids`, and to `reachableOperationWork`. It also asserts
-that **no live snapshot carries an entry yet** (the loudest possible failure if
-something wrote into `transcripts/`) and that `bucketsForKind` still matches the
-list the script spells out.
-
-```
-channels = 68
-missingSnapshots = 0
-snapshotsAlreadyCarryingAnEntry = 0
-download work list = 9 download present = 79041
-transcription work list = 882 transcription present = 78153
-OK
-```
-
-### Divergences from the 1.5 bullets, and why
-
-- **The download entry's order is `partialDownloads` ∪ `undownloadedIds`, not the
- other way round.** The bullet's parenthetical — and the "Facts that shape the
- slices" line above it — spell `undownloadedIds ∪ partialDownloads`, but
- `DOWNLOAD_BUCKETS` is `["partialDownloads", "undownloadedIds"]` (the
- half-fetched file before the one not started), and the bullet's own normative
- clause is "the union `defaultBucketsForPolicy` draws". Writing the parenthetical
- order would have made the entry disagree with the fallback the runner takes for
- every un-regenerated snapshot, which is a change to WHICH VIDEO the download
- lane picks first. `undownloadedIds` still keeps playlist order inside the union
- and is never sorted. **Live impact zero — `partialDownloads` sums to 0 across
- all 68 channels** — which is precisely why nothing but a test would have caught
- it, and there is one.
-- **The transcription ENTRY is 882, not the 2,754 the brief expected — and the
- transcription LANE still draws 2,754 today.** Both numbers are right and they
- are different measures. The entry is the policy-free work list:
- `downloadedNoTranscript` ∪ `failedListed` = 881 + 25, and **24 of those 25 are
- already in the first list**, so the deduped answer is 882. The live
- `autoQueue.transcription.replaceAutoSubs` is **`true`**, so
- `defaultDrawsForPolicy` appends `downloadedAutoSubsOnly` (1,872) at the TAIL of
- the draw and the lane's actual pending set is 2,754 — which is exactly what the
- numbers script has always printed and still prints. Folding the opt-in bucket
- into a snapshot entry would make `replaceAutoSubs` a property of the ARCHIVE
- rather than of the policy, which is why it enters where it always has.
-- **The lane's work list is projected into `ChannelWork.buckets`, under the
- operation's id — not into `.operations`.** This is the change that makes "no
- number moves" true rather than merely intended. `buildPendingByLeaf` claims a
- video as `${operation}\0${id}`, so an operation draw and a bucket draw live in
- DIFFERENT claim spaces: a video an explicit `failedListed` leaf had claimed
- would have been claimed a second time by a catch-all leaf drawing the operation,
- and appeared twice in one tick. On a bucket lane the operation and the bucket
- union are the same work and there is no second operation to keep apart from, so
- it shares the bucket claim space. `laneOperationIds` therefore still returns
- `[]` for the two bucket lanes, and `dropCompleted`, `leafOperationIds`,
- `markCompleted` and `runOperationPick` are untouched.
-- **`defaultBucketsForPolicy` is unchanged; a new `defaultDrawsForPolicy` sits
- beside it.** The two answer different questions and 1.4's `policyDrawsBucket`
- asks the first one ("would the runner draw this BUCKET for this channel", about
- the population). The second is what the runner projects. Merging them would have
- made `policyDrawsBucket` answer `false` for `downloadedNoTranscript` on a lane
- that plainly draws it.
-- **`/channels` bands still keep their own fold, and the special case that went is
- the ID LIST.** The bullet asks the bands to draw from the operation entries with
- no rendered number changed; those two halves cannot both hold, and the
- arithmetic is why. The band's transcription `reachable` is
- `downloadedNoTranscript` ALONE — the retry bucket is not in it — so reading
- `entry.ids` would take a rendered corpus figure from **881 to 882** per channel
- fold and, on the `failedListed` channels, visibly; its `blocked` is
- `noTranscript − untranscribable − downloadedNoTranscript`, which the entry calls
- `missingInput`; and its `eligible`/`present` are the playlist and
- `totals.downloaded`/`totals.transcribed`, coverage measures the entry STATES
- rather than counts. Two honest answers to two different questions. What did stop
- being a special case: `EXTERNAL_BAND_IDS` is `EXTERNAL_OPERATIONS.map(o => o.id)`
- rather than a hand-written pair — the same declaration `pauseLaneFor` and the new
- `bucketLaneOperationId` read — and `addExternalBands`' header now names the two
- numbers that keep it, so the next reader does not have to re-derive the refusal.
- `backfillLaneOperationEntriesOf` already filtered on `BACKFILL_QUEUE`, so the
- four surfaces that sum the lane never saw the new entries at all.
-- **`laneForOperation` resolves EXTERNAL_OPERATIONS, not the whole catalog.** Sync
- keeps its null: it is a per-channel cadence, not a per-video pipeline, which is
- the same answer `pauseLaneFor` gives it. The old comment's fear — "a caller would
- reserve the backfill queue for work no backfill operation can do" — is now two
- assertions in the flipped test: neither declared lane is `BACKFILL_QUEUE`. The
- one caller that reserves a key from this answer,
- `operationJobs.runOperationChannelJob`, is only ever handed a registry id.
-- **`bucketIdsFrom` returns the STORED array, not a copy** (`a7922a3`). The first
- version returned `readonly string[]` and `buildChannelWork` spread it — 68
- channels x four buckets per scheduling tick and per three-second status poll,
- up to 11,000 strings each, which is the allocation the snapshot parse memo
- exists to avoid. Nothing mutates the list, and handing out the stored array is
- what the code did before this slice.
-- **`bucketLaneOperationId` lives in `lib/operations.ts` and the fold in
- `jobs/autoQueuePolicy.ts`, deliberately apart.** The obvious shape — one
- function in `autoQueuePolicy.ts` — would have made `jobs/autoQueuePolicy.ts`
- import `lib/operations.ts`, and `lib/settings.ts` imports `autoQueuePolicy` for
- its sanitizers: that is the runtime cycle `settings → operations → controller →
- settings` the 1.4 note documents avoiding for `legacyGateHeld`, arriving by a
- different door. So the fold takes the work-list NAME as a parameter and the
- controllers supply it. **No entry was added to `architecture.test.ts`.**
-
-### What the band assertion caught, and `d8754d2` fixed
-
-**Writing the two entries doubled two rendered numbers on `/channels`, and the
-e2e test written to prove they had not moved is what found it.** A three-video
-channel's row read *Download — 0 can run now · 6 done of 6*.
-
-`buildOperationBands` seeds the two external bands, folds `addExternalBands` per
-snapshot, and then folds `addRegistryEntry` for every id in `operationIds` —
-and `/channels` passes `[...EXTERNAL_BAND_IDS, ...allOperations]`, because it
-wants a column for every band. Until this slice that was harmless:
-`snapshot.backfill.download` did not exist, so `addRegistryEntry` returned early.
-The moment it existed, every one of the band's five numbers was counted twice.
-
-**This is exactly the trap `backfillLaneOperationEntriesOf` was written for, at
-the one surface that does not go through it.** Its header says so: the four
-surfaces that summed `Object.values(snapshot.backfill)` broke the day the map
-stopped being one lane, and they were fixed by filtering on the DECLARATION.
-`buildOperationBands` never summed the map — it indexes it by id — so it looked
-immune, and the id list it is handed is what made it not. The registry fold now
-skips the ids `addExternalBands` owns, with a unit test that fails without the
-filter.
-
-Worth saying plainly because the slice's own claim was "no rendered number
-moves": that claim was FALSE for two commits, and the only reason it is true now
-is that the assertion was written as an invariance check in the browser rather
-than as a re-reading of numbers copied out of an older build.
-
-### Carried into the deletion slice
-
-- **When `sanitizePolicy` gains a default for `held`, backfill's must be `true`.**
- `sanitizeBackfill` defaults `enabled: false`, and `legacyGateHeld` reads
- `backfill.enabled` INVERTED — so a fresh install with no `backfill` block reads
- as HELD today. Defaulting `held: false` alongside deleting the fallback would
- quietly un-hold the backfill lane on every settings file that has never been
- written. The other three default `false`.
-- **`editor/app/jobs/active/buildActiveJobs.ts` (~`:407`) reads `isGateHeld` for
- the transcription lane**, which is a UI surface reading STORED intent where
- `pauseGates.ts` says every UI surface must read the worker pool. Pre-existing —
- it predates 1.4 and 1.4 did not move it — and named here rather than fixed,
- because the fix is a decision about what the /jobs strip means when the pool and
- the file disagree, not a rename.
-- **`sanitizeMatch` accepts any bucket string**, so a hand-edited leaf carrying
- `match.bucket: "transcription"` (or `"download"`) now draws that lane's WHOLE
- work list instead of finding nothing. Unreachable from the UI — the bucket
- select offers only `selectableBucketsForKind`, which does not include the
- operation ids — and harmless where it is reachable, since the list is what a
- bucket-less leaf on that lane draws anyway. Named because "a leaf naming
- anything else finds no list" stopped being literally true for two strings.
-- **A regenerated snapshot carries each bucket-lane id twice** — once spread
- across its buckets, once merged into `backfill.<lane>.ids`. Trivial on this
- corpus (9 and 882 ids) and deliberate: the whole point is one array per lane.
- It is not trivial for a FRESHLY ADDED channel, whose `undownloadedIds` is the
- entire playlist, so a 30,000-video channel's first snapshot grows by 30,000
- duplicated ids. If that ever bites, the fix is for the runner to fold rather
- than for the entry to shrink — the entry is what makes the four lanes uniform.
-- The 1.4 traps above all still stand, including the two greps
- (`backfill.enabled` needs its own).
-
-## Phase 1, as shipped
-
-`7f294df` → `81a663f` plus this docs commit, **35 commits on `one-core/phase-1`**
-off `af2a360` (Phase 0's head) — 36 with this one. Five slices:
-
-| slice | range | what it did |
-|---|---|---|
-| 1.1 | `7f294df` → `3ced7dd` | four lanes in the model; `retainLeaves` deleted, not de-moded |
-| 1.2 | `83954f1` → `0438a72` | one `operationBatch.ts`; the runner runs operations on all four lanes |
-| 1.3 | `253826b` → `451c454` | the two sweeps and the arbiter retire; ten settings fields migrate then go |
-| 1.4 | `0040e39` → `1a4524b` | pause is `autoQueue[lane].held`, with the four legacy fields as a read-time fallback |
-| 1.5 | `4cb226e` → `81a663f` | one work list per lane in the snapshot |
-
-**109 files, 9,956 insertions, 7,341 deletions** (102 files / 7,510 / 7,199
-outside `plans/`), measured `af2a360..81a663f` — the tip, not `2133d94`, so the
-two follow-ups this section describes (`a7922a3` and the band-doubling fix
-`d8754d2`) are counted. This docs commit adds one more file's worth of prose to
-the first figure and nothing to the second. **Eighteen files deleted, 5,273 lines**: `backfillBatch.ts`
-937, `digestBatch.ts` 647, `backfillSweep.ts` 517, `SweepLane.tsx` 422,
-`arbiter.ts` 416, `digestSweep.ts` 368, `sweepPreview.test.ts` 321,
-`SweepPlan.tsx` 264, `backfillBatch.test.ts` 231 (renamed to
-`operationBatch.test.ts`), `arbiter.test.ts` 177, `sweepPreview.ts` 167,
-`sweepPlan.ts` 163, `SweepScope.tsx` 154, `sweepRecency.ts` 141,
-`OrderReach.tsx` 133, `ArbiterBar.tsx` 113, `arbiterWork.ts` 67,
-`resume-backfill-sweep/route.ts` 35. Plus, in place: three job kinds, two boot
-resume hooks, ten settings fields with their sanitizers and forms, four sweep
-server actions, the arbiter's two actions, and `operations/lanes.ts` at 368 → 131.
-
-**Tests: common 876 → 908 (+32), mcp 205 → 205, e2e 511 → 515.**
-`architecture.test.ts`'s allow-list **shrank by one** (`lib/sweepPlan.ts ->
-controller/planOrder`, which died with the file) and **no entry was added by any
-slice** — the guard fails on a stale entry too, which is how that was checked
-rather than asserted.
-
-**Numbers: the before/after diff of `plans/tools/phase1-numbers.ts` over the live
-corpus is EMPTY for 1.1, 1.2, 1.4 and 1.5, and for 1.3 is 18 ADDED lines and zero
-removed** — the migrated `autoQueue.digest` / `.backfill` blocks, both
-`enabled: false` with one catch-all leaf, which is exactly what the file's
-disarmed, unscoped sweeps meant. Every pre-existing line is byte-identical in all
-five. **No live number moved across the phase.** The one rendered-text change
-anybody will see is named in 1.3's note and was kept on purpose: the /jobs strip's
-four lane rows now fold `gateHeld`, so a held transcription row reads *Holding*
-where it read *Idle*.
-
-### What stays, and what gates what
-
-- **Four legacy pause fields** — `transcriptionsPaused`, `downloadsPaused`,
- `digest.digestsPaused`, `backfill.enabled` — remain in `SiteSettings` and in
- their sanitizers as `legacyGateHeld`'s input and nothing else. `backfill.enabled`
- has no writer left at all. The deletion condition is exact: **the live
- `settings.json` carries all four `held` keys**, which happens on its first write
- through the editor after 1.4. The two carried notes above belong to that slice.
-- **`sanitizePolicy` must still never default `held`**, and the backfill default
- when it finally does is `true`. See above.
-- **Gate A** — the digest lane's runner driving a production pass and resuming
- after a restart — is run from **`one-core/phase-1-gate-a`** (`0438a72`, the code
- as 1.2 left it) and gates the MERGE of 1.3 onward, not their authorship. The
- runbook is in the 1.2 section.
-- **Gate B** — before the backfill lane is ever enabled in production, decide
- `backfill.allowRedownload` and the channel scope. As configured today it would
- re-fetch audio for ~66,540 `missingInput` videos. The 1.3 migration left the lane
- `enabled: false`; the tree's channel leaves are the scope from now on.
- **Decided and applied 2026-09-23 — reachable media only; see "Gate B — PASSED
- 2026-09-23" below.**
-- **`video-page.spec.ts:216`** ("Delete directory wrong-id confirmation shows an
- error") is a known ordering flake, reported in 1.3 and 1.4 and not fixed: it
- passes 20/20 when re-run alone on the same commit, and nothing in this phase
- deletes a video directory.
-- **e2e cannot run in the primary checkout** while the untracked `editor/content`
- symlink exists. Every slice ran from a `git worktree`, seeded with a composed
- fixture site so the export webServer answers 200. `git add -A` in this repo
- stages that symlink into the commit and carries the panic into the worktree —
- add by path.
-
-## Gate A — PASSED 2026-09-13
-
-Run by the operator on the production editor (the primary checkout serving the
-`one-core/phase-1` tip `e74f005`, restarted with `-H 0.0.0.0`), with
-`autoQueue.digest.enabled: true` and the lane's strict tree narrowed to one leaf,
-`{ "type": "channel", "value": "ObviousRises-rumble" }`; `held: false`; no
-`autoQueue.backfill` block added. The operator reports **every assertion of the
-gate held**: the Auto-digest section read *Runner running*, the pass dispatched
-units and the channel's `backfill.digest.missing` fell, the mid-pass restart
-brought the runner back unaided with Recent picks continuing, and Hold/resume left
-it *running* with `Idle — the lane is held`. The per-step numbers (units
-dispatched, missing before/after, any observed yield) were not written down at the
-time; add them here if they were kept.
-
-Consequence: the 1.3 retirements stand, and the 2026-09 integration
-(`integrate/2026-09-storage-priority`, Phase 2 included) fast-forwards to `main`.
-Gate B (the backfill lane on production) is still owed before that lane is armed.
-*(Done 2026-09-23 — next section.)*
-
-## Gate B — PASSED 2026-09-23
-
-**Decision (operator, 2026-09-23): reachable media only.** `backfill.allowRedownload: false`,
-the lane held, scope every channel. Folded into the one-core Phase 3 release
-(`one-core-phase-3.md`, "Release 2026-09-23") as a prelude: a settings change made through the
-existing surface, plus this record — **no code**.
-
-**Surface.** The backfill lane form on `/operations/diarization` (`LaneSettingsForm` →
-`saveBackfillLaneSettingsAction`, `editor/app/operations/settingsActions.ts:207`), driven by
-Playwright against the live editor on `:3001`, then at `main` `54cf1b31`. No hand edit of
-`settings.json`, and no ops route — none carries `allowRedownload`.
-
-Before (`settings.json`, read-only):
-
-```
-backfill: {"enabled": true, "concurrency": 1, "allowRedownload": true} (enabled = retired legacy key)
-autoQueue.backfill: {"enabled": false, "maxWorkers": null, "replaceAutoSubs": false, "order": "newest", "snoozeUntil": null, "held": false}
-/operations/diarization: Speaker diarization Off · 679 reachable · 74,046 no media · 1.86% of 76,138
- Auto-backfill: Runner stopped · 0 in flight
-```
-
-After:
-
-```
-backfill: {"concurrency": 1, "allowRedownload": false} (legacy `enabled` dropped by the writeSettings round trip — expected)
-autoQueue.backfill: {"enabled": false, "maxWorkers": null, "replaceAutoSubs": false, "order": "newest", "snoozeUntil": null, "held": true}
-/operations/diarization: Speaker diarization Off · 679 reachable · 74,046 no media · 1.86% of 76,138
- Auto-backfill: Runner stopped · button now reads "Resume the lane" (Holding) · 0 in flight
-```
-
-**Pass:** `held: true`, `allowRedownload: false`, `enabled: false` — all hold. Nothing
-dispatched.
-
-**Not done, on purpose.** The lane stays disabled. Arming it (enable → Resume) is a later,
-separate act, and when it happens the expected work is the reachable **~679**, not the
-~66,540 `missingInput` figure above. Two stale numbers to know about, neither changed here:
-the form's hint text still says 836 (a measured figure that has aged —
-`LaneSettingsForm.tsx:101`), and `plans/tools/phase1-numbers.ts` does not filter
-`handling: "youtube"`, so its `missingInput` is the whole bucket.
-
-**Scope, verified 2026-09-23 after the change:** `autoQueue.backfill.root` is `strict` with 72 channel leaves and no leaf held at `maxWorkers: 0` — the lane still scopes every channel; nothing narrowed.
diff --git a/plans/one-core-phase-3.md b/plans/one-core-phase-3.md
@@ -500,7 +500,7 @@ Slice 4a is `settings.json` alone — `site.json`, channel `config.json` and the
slice 4b. Slice 3 and slice 4b are the next release. zod is adopted (one dependency, in
`common/`), which spends the veto `one-core.md` left open. Gate B from Phase 1 rode along as a
prelude — a settings change through the existing surface plus a record, no code
-([`one-core-phase-1.md`](one-core-phase-1.md#gate-b--passed-2026-09-23)).
+([`one-core-phase-1.md`](archive/acquisition-and-pipeline.md)).
**Gates on merged `main` `ae2fa5a9`:** `tsc --noEmit` clean across the workspace; common
**1663** (1625 + 13 from slice 2 + 25 from slice 4a); editor unit **67** (59 + 4 + 4);
@@ -696,7 +696,7 @@ md5 sweep after the third refusal, against the post-form-save sweep, moved one f
`channels/the-quartering-rumble/config.json` (`ac111558…` → `fed252e8…`, written 19:36:06),
which gained `fullSweepIntervalMinutes: 0` and was re-emitted in schema key order
(`lastSyncedAt` unchanged). That is not this rollout: it is the operator's step 1 of
-[`rumble-sweep-pacing.md`](rumble-sweep-pacing.md), applied through the editor; the file is
+[`rumble-sweep-pacing.md`](archive/acquisition-and-pipeline.md), applied through the editor; the file is
`jq -S` equal to its release-3 frozen copy once that key is removed. Syncs stamp through
`patchChannelConfig`, so the expected effect of a sync is a `lastSyncedAt` (and, on a full
sweep, `lastFullSweepAt`) change on the synced channel's file only; that remains unmeasured
@@ -736,7 +736,7 @@ close a sub-pixel seam against the checkbox cell. Scrolled down and right, every
slug band painted over the header, because it comes later in the DOM. The z bump was never
needed. `left-8` (32 px) pins the Slug cell 4 px inside the `w-9` (36 px) checkbox cell. Two
sibling cells at one z-index paint in DOM order, so the Slug cell already covers the overlap at
-z-10. The rack plan's order (`plans/editor-channels-rack.md:198-204`) was right. `278d4463`
+z-10. The rack plan's order (`plans/archive/editor-ia.md` entry `editor-channels-rack.md`, lines 198-204 of the archived text) was right. `278d4463`
shipped it as 30/20/10, and `20ee34db` put the slug cell on the header's level. A second tie
went unstated: the popover and the thead were both z-30, and the popover won on DOM order only.
Both ties are gone. After the fix, grep finds no `z-<n>` literal in
@@ -1062,8 +1062,8 @@ dated 2026-09-24, 19:50–20:14 local):
0. **Prelude, on `main`, plans only.** `4130aca1` is the rollout record: release 3
(`9ab10d77`) is live on :3001 (the "Rollout 2026-09-24 — `9ab10d77`" section above).
`bbad0977` records the owed one-sync md5 sweep. Three plan files were filed while the
- slices ran: `77f63356` ([`site-exports-off.md`](site-exports-off.md)), and `42caf3cc` + `cc89abfa`
- ([`rumble-sweep-pacing.md`](rumble-sweep-pacing.md)). **The one-sync sweep is still owed.**
+ slices ran: `77f63356` ([`site-exports-off.md`](archive/sites-and-publishing.md)), and `42caf3cc` + `cc89abfa`
+ ([`rumble-sweep-pacing.md`](archive/acquisition-and-pipeline.md)). **The one-sync sweep is still owed.**
`pnpm ops sync {"slug":"FearAnd"} --wait` was refused three times (18:43, 19:13, 19:41),
because auto-download kept re-arming a YouTube 429 cooldown. No other channel was
substituted. The sweep would show that a sync stamps `lastSyncedAt` through
@@ -1175,11 +1175,11 @@ slices are in [`one-core.md`](one-core.md#phase-4--cli-entry-points-config-docs-
with the starting points as inventoried on `e172749b`. Two plans filed during release 4 go
first, as their own releases, and each needs a code slice and a rollout:
-- **Visitor exports off on the published sites**, [`site-exports-off.md`](site-exports-off.md).
+- **Visitor exports off on the published sites**, [`site-exports-off.md`](archive/sites-and-publishing.md).
This is a per-site option, off on the operator's instances and on by default for the OSS
release. It needs a rebuild and a deploy of the five published sites. Its anchors were
taken on `4130aca1`; re-verify them before cutting the slice.
-- **Rumble**, [`rumble-sweep-pacing.md`](rumble-sweep-pacing.md). Step 0 is a per-platform
+- **Rumble**, [`rumble-sweep-pacing.md`](archive/acquisition-and-pipeline.md). Step 0 is a per-platform
yt-dlp args table carrying `--impersonate chrome`, because Rumble's embed endpoint answers
403 to every download (upstream #17496). Step 2 paces a full sweep of a large channel. Step 1
(`fullSweepIntervalMinutes: 0` on `the-quartering-rumble`) was applied by the operator on
diff --git a/plans/one-core.md b/plans/one-core.md
@@ -186,7 +186,7 @@ Makes the later deletions safe and cheap.
**SHIPPED 2026-09-08** on branch `one-core/phase-1` (`7f294df` → `81a663f` plus a docs
commit, 36 commits, unmerged, off Phase 0's `af2a360`), all five slices. The record — every slice's sha range,
every divergence, both operator gates and the totals — is
-[`one-core-phase-1.md`](one-core-phase-1.md); the anchors are
+[`one-core-phase-1.md`](archive/acquisition-and-pipeline.md); the anchors are
[`FACTS.md`](FACTS.md#one-core-phase-1-verified-2026-09-08). **No live number moved**, and
both gates (A: the digest lane's production pass, from `one-core/phase-1-gate-a`; B: the
backfill lane's re-download scope) are the operator's and still outstanding.
@@ -204,7 +204,7 @@ the two lanes carrying 100% of live dispatch. The auto-queue runner is the prove
the RUNNER generalizes to four lanes and the arbiter goes with the sweeps.
The slice-level plan, with the line numbers and the measurements, is
-[`one-core-phase-1.md`](one-core-phase-1.md).
+[`one-core-phase-1.md`](archive/acquisition-and-pipeline.md).
1. **1.1 — Four lanes in the model.** `AutoQueueKind` widens to `transcription |
download | digest | backfill` and is exported as `LANES`; `PauseLane` becomes an alias;
diff --git a/plans/overnight-2026-10-10.md b/plans/overnight-2026-10-10.md
@@ -1,190 +0,0 @@
-# Overnight 2026-10-09 → 10 — the next batch, run from the primary checkout
-
-Operator rulings (2026-10-09, late evening; do not re-open):
-- **Scope:** e2e speed S1–S3 ([e2e-speed.md](e2e-speed.md)); B2 report-to-video robustness; release 19 A6–A9;
- release 21 D2, then release 20 (the data model).
-- **The orchestrator runs in the primary checkout** (`~/Projects/yt-dlp-transcript-browser`, branch `main`) and
- advances releases itself: after full green gates it fast-forwards `main` and runs the standard rollout. Agents
- still work in their own worktrees.
-- **Live pilot allowed:** the TISM pilot (release 21's "Rollout (pilot)" steps 1–3) runs on the live editor once D2
- is live. **The transcription lane stays held** — `transcribe-one` for the 3 new records is queued, not run.
-- **Handoff:** a generated `MORNING.html` runbook.
-
-## Step 0 — take over (the orchestrator, first thing)
-
-1. `git merge --ff-only r19/integration` on `main` (brings release 19's rollout record and this plan; plans
- only — no rebuild).
-2. Read: this file, `plans/e2e-speed.md`, `plans/release-19.md` (A6–A9 rows; "Landing, as it went"),
- `plans/release-20.md`, `plans/release-21.md` (D2; "Rollout (pilot)"), `plans/STATE.md`, `plans/FACTS.md` (as
- needed), and memory `release-19-in-flight`, `orchestrator-in-primary`, `memory-gate-heavy-steps`,
- `e2e-run-detached`, `subagents-monitor-not-poll`, `no-claude-session-links`.
-3. Scratch: `$CLAUDE_JOB_DIR/tmp`. Reusable scripts from the r19 landing are in
- `~/.claude/jobs/c0baff27/tmp/` (copy, don't edit in place): `detach.sh`, `e2e-progress.sh`,
- `r19-light.sh`, `r19-build.sh`, `r19-e2e.sh`, `r19-privacy-counts.sh`, `link-fixture-public.sh`,
- `source-audit/{fresh-check,scratch-counts,verify-live}.sh`, `r19-homepage.sh`, `live-ops.sh`.
- Rollout scripts: `~/reports/release-19/scripts/r19-{build,restart,smoke,umtool}.sh` — copy to
- `~/reports/release-20/scripts/` and re-guard `MERGE=` / `LIVE=` for tonight.
-4. Peers: Super Jeralyzer is finishing jeralyzer-private (the co-host timeline, **private only**); when it confirms
- `/reports/cohosts/`, send every peer the all-clear for the quiet window (Super Hasanalyzer, Super Jeralyzer,
- Super Jasolyzer, candace owens corpus analysis, mixology, recipe content engine). The overnight work then shares
- the machine through the heavy slot and the e2e queue — no further quiet window is asked for.
-
-## Integration branch
-
-`r20/integration`, from `main` after step 0. Each agent branches from it in its own worktree (`pnpm wt add
-<branch> --from r20/integration`, then `link-fixture-public.sh <worktree>` — a worktree's e2e uses the committed
-fixture compose `plans/tools/compose-fixture-one-youtube-channel/public`, not the primary's `export/public`). The
-orchestrator merges each finished track `--no-ff` on a clean tree, re-runs the touched suites, and records.
-
-## Tracks (at most two Opus agents at once)
-
-| lane | order | track | branch | files it owns | gate |
-|---|---|---|---|---|---|
-| 1 | first | **E — e2e speed S1–S3** | `r20/e2e-speed` | `editor/playwright.config.ts`, `editor/package.json` scripts, `editor/e2e/helpers.ts` + `globalSetup.ts`, `scripts/queue-lock.mjs` (only if S1 needs it), a new `scripts/e2e-timings.mjs`, the four timer knobs (`common/lib/envVars.ts` + the product code each reads) | the full editor suite **through the new default** (start + stamp) and once in dev; the stamp proven stale-safe (edit a file → rebuild); timings file written; unit for the stamp |
-| 1 | after E | **A — release 19 A6–A9** | `r20/a6-a9` | `editor/app/api/ops/**`, `scripts/archilyzer-ops.mjs`, `mcp/src/**`, `common/controller/` import/listing code, COMMANDS.md (regenerated) | route unit tests + `scripts/archilyzer-ops.test.mjs` + mcp tests; one `ops-api` route-test sweep; polite scraping in every listing (one stream, real gaps, back off on 429); `docs cli --check` |
-| 2 | first | **B — B2 report-to-video** | `r20/b2` | `umtool/report-to-video/**` (operator granted write access 2026-10-09) | apply `$T_OLD/b2-partial/` under `$T_OLD/b2-constraints.md` (`$T_OLD=~/.claude/jobs/c0baff27/tmp`): prune only `chrome/*-frames` + `work-*` after the final mux; `--chrome-only` never rewrites an existing hard-linked segment; `--only` kept; teaser > 34 chars a warning; QR / relative-src errors; the thread/flip validators; plus `fetch-via-editor.mjs`'s 10-min timeout (wait without one, printing queue position — A5's ruling); `test:scripts` ≥ 443 report-to-video tests green. **Does not merge** until the candace owens corpus analysis session reviews it (ruled); the orchestrator sends it the branch + a summary and records the review |
-| 2 | after B | **D — release 21 D2, then release 20** | `r20/d2-r20` | D2: `fetchWindowAction` and the saved-video reader (cut a window from a saved container before the network; provenance `saved-video`); R20: `recordedDate`, Twitch id normalization, verify the en-track 0-cues bug and the stats-cache key (report, fix only what the plan rules) | D2: route/action unit tests + one `ops-api` case; R20: per `release-20.md` |
-
-Track agents: `general-purpose`, model `opus`, briefed with this table row, the plan file of their slice, and the
-rules below. They run unit tests and **at most single e2e spec files in the foreground** (Bash timeout 600000;
-waiting on the queue is normal — re-run on timeout). The orchestrator runs every full suite (detached, Monitor).
-
-## The live pilot (after D2 is merged, gated and live)
-
-On the live editor, through `pnpm ops` (it reads its own token now):
-1. `attach-media` dryRun for `the-incredible-salt-mine` (source per release-21.md) — expect ~166 held and matched,
- 3 with media but not held, 10 `[LOST]`; record the exact counts.
-2. The same without `dryRun`, plus `createRecords` for the 3. `transcribe-one` ×3 queued — they wait on the held lane.
-3. MCP `fetch_clip` on a TISM cue → `cached: true`, provenance `saved-video`, no network in the job log.
-Stop and record if any count is off by more than a few; do not "fix" by hand.
-
-## Gates before any fast-forward
-
-On the `r20/integration` tip: `pnpm typecheck`; `pnpm test`; `archilyzer docs env|files|cli --check`, `settings
-example --check`; four builds (each `pnpm heavy`, 5 GB scope; export over the committed fixture compose; umtool
-capped with the corpus linked); e2e, one at a time: the full editor suite (start mode — after E lands, the new
-default), export default + report + hub, umtool full, homepage. A red is re-run alone before it counts; a red that
-stays red blocks the fast-forward. Counts-only privacy greps over `main..r20/integration` (name, email local part,
-guarded suffix, home paths, session links/trailers, deployment hashes, corpus data) — every count 0 in files and in
-messages written tonight.
-
-## Fast-forward and rollout (the orchestrator)
-
-`git merge --ff-only r20/integration` on `main`, then: editor build + restart + smoke (copied r19 scripts,
-re-guarded); umtool build + restart when umtool changed; `source publish --check`, then the homepage to production
-(the live mirror re-cloned after 5 min and counted); public sites only if the release changes what they serve
-(release 20's `recordedDate` may — read the diff of `export/`); live checks per deployed site. The editor restart
-closes running jobs as interrupted — tell their sessions.
-
-## Rules (hard)
-
-- **No `Claude-Session` trailer or session link, anywhere.** Commits end with `Co-Authored-By: Claude Opus 5.5 (1M
- context) <noreply@anthropic.com>` alone.
-- Memory floor ≥ 6 GB available before any build, e2e or render; every `next build` capped (5 GB, no swap) and
- through `pnpm heavy`; never two at once. e2e detached (`setsid nohup`) with a Monitor; subagents never Monitor,
- sleep-loop or poll.
-- Never hand-edit `transcripts/**` (writes go through `pnpm ops` / the editor); never boot a second editor against
- the real corpus; never print the operator's `~/.config/archilyzer/source-*.txt` (count lines only).
-- No yt-dlp or ASR by hand; polite scraping; no expired Twitch VOD re-downloads.
-- Private stays private: Candace data local-only; the co-host timeline on jeralyzer-private only; no X channel on a
- public site.
-- Records state rulings, never reasons; each track adds "as it went" to its plan file; the orchestrator adds the
- landing and the rollout.
-
-## Morning
-
-`~/reports/overnight-2026-10-10/MORNING.html` (generated, like `make-morning.py`): what landed and where (`main`
-sha), each gate with its numbers, the rollout's live checks, the pilot's counts, B2's review state, what is
-waiting on the operator (Phase 2 items still open: scrub rule 10 + a homepage republish; publish policies; the
-docker builder; pruning the `r18-*` worktrees and merged branches; the D4b network inputs), and the e2e timings
-before/after S1.
-
-## Queued for planning (not tonight)
-
-- **Reports that cite across sites** (operator request, 2026-10-09): a report may cite any channel in the corpus,
- or one another site owns, without that channel joining the citing site's searchable pool — e.g. **cited-only
- channels** (the cited moments and clips publish; no browse, search or transcripts) or **cross-site moment links**
- into the owning site. Tonight's workaround: jeralyzer-private's pool gained `rev-says-desu` and `hasanabi`
- (operator ruling); the polemics sites pad their pools with critics' channels the same way. Start from what
- exists: compose's `not-in-site` refusal (ComposeReportsError) and the export's cited-only compose (the report
- e2e suite's fixture). A release-23 candidate — planned in the morning, not built tonight.
-
-## As it went
-
-The orchestrator ran from the primary checkout (session "overnight report integration"), 2026-10-09 23:28 → 10-10
-morning. Scratch: the job's `tmp/` (`r20-*` gate scripts and logs, `brief-{E,B,A,D}.md`, `{e,b,a,d,w}-report.md`).
-
-**Step 0.** `main` fast-forwarded to `r19/integration` `585be292` (plans only). Super Jeralyzer confirmed
-jeralyzer-private's `/reports/cohosts/` live at 23:27; the all-clear went to every listed peer (Super Hasanalyzer,
-Super Jeralyzer, mixology, universal logo branding; Archilyzer main had ended). The candace owens corpus analysis,
-Super Jasolyzer and recipe content engine sessions were not running.
-
-**Operator ruling mid-night (00:00):** the transcription lane was released briefly for the mortal kombat samples
-session's word timings ("lift briefly for MK"). One batched `ops transcribe` job (`01M4J1FPT30P54HV75SCHSWPFP`,
-17,743 words, 239 sources) ran on the GPU worker; the lane was held again at 01:09. That session committed
-`dfae0544` (umtool/song only) to `main` at 01:56; it was merged into `r20/integration` before the fast-forward.
-
-**Tracks** (one Opus implementer each, at most two at once; briefs in the job's `tmp/`):
-
-| track | branch | tip | merged | notes |
-|---|---|---|---|---|
-| E — e2e speed S1–S3 | `r20/e2e-speed` | `d8e06835` | `5b690d2e` | record in `e2e-speed.md`; one out-of-list line: `distDir` from `E2E_NEXT_DIST_DIR` in `editor/next.config.ts` (unset → `.next`) |
-| B — B2 report-to-video | `r20/b2` | `db96bf7e` | **not merged** | waits for the candace owens corpus analysis session's review (ruled); that session was not running; the reviewer summary is in `b-report.md` |
-| D — release 21 D2 | `r20/d2-r20` | `78dec490` | `05fb44de` | merged early for the pilot |
-| D — release 20 D3, D1 | `r20/d2-r20` | `2232a90f` | `2f92fd1f` | **release 20 D2 (Twitch ids) held for an operator ruling** — it moves 217 public URLs; kept on `r20/twitch-ids` `433815d4`, reverted on the track |
-| A — release 19 A6–A9 | `r20/a6-a9` | `2abda291` | `3950ad69` | out-of-list files: the actions its routes call (`pipelineActions.ts`, `normalizeActions.ts`, `publishCore.ts`, `normalizeTranscript.ts`), `jobKinds.ts`, `common/bin/publish.ts` |
-| whisper fix | `r20/whisper-fix` | `46a9321f` | `0b1b8a28` | `whisper.spec:184` red alone 3/3 under start mode: "Clear failure list" unmounted its own log on the refresh that emptied the list; fixed with the `DiagnosticsStage` `ran` flag |
-
-**Gates.** Round 1 on `2f92fd1f`, round 2 on `0b1b8a28` (the fast-forwarded tip):
-
-| gate | round 1 | round 2 |
-|---|---|---|
-| typecheck | clean | clean |
-| `pnpm test` | common 3,657, editor 228, export 118, homepage 23, mcp 293, scripts 725 + 3 skipped | common 3,672, editor 237, export 118, homepage 23, mcp 303, scripts 730 + 2 skipped |
-| docs env/files/cli, settings example | 0 | 0 |
-| builds (heavy, 5 GB) | editor 42 s, export 23 s, homepage 13 s, umtool 26 s | 43 s, 23 s, 13 s, 26 s |
-| editor e2e, start (default) | 682 passed, 2 failed, 12 skipped, 21.3 min | 683 passed, 1 failed, 12 skipped, 19.9 min |
-| export default / report / hub | 276 / 46 / 39 passed | 276 / 46 / 39 passed |
-| umtool full | 274 passed, 14 failed, 6.4 min | 274 passed, 14 failed, 4.9 min |
-| homepage | 106 passed | 106 passed |
-
-Reds re-run alone: `storage-locations.spec:660` passed (load); `whisper.spec:184` — the product bug above;
-`sites-crud.spec:448` passed 17/17 (load). umtool's 14 are the same in both rounds: triage ×9 and faces ×4
-(environment, as release 19 recorded) and `find.spec:170`, which fails identically on the base `585be292` (the song
-data's ASR was regenerated tonight). Privacy counts over `main..r20/integration` (name, email local part, guarded
-suffix, home paths, session links and trailers, the scrubbed deployment hash, corpus data paths) 0/0 in both rounds;
-one identity.
-
-## Rollout
-
-`main` fast-forwarded to `0b1b8a28` (2026-10-10 03:58).
-
-- **Editor** — build `OcKGZ7ufxOBKRo8FQoUGs` → `TFP7ylMbfQgHatC_Rz5Yp` (42 s, heavy slot, 5 GB scope); restart 04:00:
- `/` 200, `UV_THREADPOOL_SIZE=16`, no ZodError, queued 0 → 0; one running `import-archive-org` closed as interrupted
- (its session told before and after). Smoke `SMOKE_FAIL=0`. The lane hold survived the restart.
-- **Source mirror + homepage** — `source publish --check` on `0b1b8a28`: audit clean (32,440 objects, 2,824 commits,
- 6,106 files, 14 denied literals), gitleaks clean; scratch counts 0 except the 11 known old mentions of one deployment
- hash (scrub rule 10 owed). Homepage deployed to production, live check ok. A fresh clone of the live mirror: head
- `974fa4e5`, 2,824 commits; name, email local part, guarded suffix, session links and trailers 0; one identity.
- `source.archilyzer.pages.dev` answers 404 on every path.
-- **umtool** — not rebuilt (only its Playwright config changed). **Sites** — not rebuilt: the export changed only
- Playwright configs, and `recordedDate` is omitted for a channel without a rule (none has one).
-
-## The live pilot (release 21, `the-incredible-salt-mine`)
-
-1. `attach-media` dryRun: attach 166 (33.55 GB), not held 3, `[LOST]` 10, no media 2, unmatched 0, ambiguous 0; held
- with no media in the archive 6.
-2. `attach-media` with `createRecords`: 169 attached (166 + the 3 created: `6ijPdSuZdws`, `VcFA_LOnQoc`,
- `xLgf_MGQzXk`), 0 failed, 04:07 → 04:19. **`transcribe-one` ×3 not queued:** with no audio in `data/<id>/`,
- `whisperVideoAction` starts a `download-one-audio` network job, and `file` must name a file in the video's own
- directory; the container is in the store. Owed: audio extracted from the saved container before any download.
-3. MCP `fetch_clip` `gDqevKMsZNI` 600.09–602.21 → `clips/597.09-605.21.mp4` (720p, 8.13 s), sidecar
- `source: "saved-video"`; no fetch-window job (no network).
-
-**The dev-mode editor suite (Track E's remaining gate, after the rollout):** the first run's test server stopped
-answering at test 417 of 696 (`ops-cut-release.spec`; no OOM, no port reassignment, nothing in its output) and the
-rest failed on connection refused — 400 passed, 284 failed, 12 skipped, 37.1 min. The 56 spec files that failed,
-re-run in dev: 339 passed, 1 failed, 21.4 min. The one, `import-video.spec:78` (a BitChute import), hits the 30-s test
-timeout in dev twice and passes in start mode in both rounds. The suite in dev is ~51 min (Wave 0's: 71).
-
-**Morning:** `~/reports/overnight-2026-10-10/MORNING.html` (`make-morning.py`).
diff --git a/plans/reacquire-handoff.md b/plans/reacquire-handoff.md
@@ -1,395 +0,0 @@
-# Re-acquired audio is handed to auto-transcribe, not deleted under it
-
-## Context
-
-**Verified read-only against the tree at `da339a4` (clean) on 2026-08-27.** The previous
-slice (`fed4b01`, `ca42f7b`) made the backfill re-acquire land `audio.mp3` on an ASR-only
-`handling: "youtube"` video, diarize, then delete the audio in the `finally` at
-`backfillBatch.ts:684-693` (`buildCleanup`, `backfillReacquire.ts:257-290`; the only veto is
-`isDoNotClean`). Meanwhile `autoQueue.transcription` (enabled, `replaceAutoSubs: true`,
-strict tree ending in an `all` leaf) draws from the snapshot bucket `downloadedAutoSubsOnly`
-= ASR VTT **and audio present** (`channelSnapshot.ts:987-999`), so the moment any unit
-finishing on that channel regenerates the snapshot (1 s debounce, `autoRunner.ts:871`), the
-runner can start parakeet on the very file the backfill is about to unlink. **There is no
-per-video lock anywhere** — the registry serializes on `queueKey` only (`registry.ts:78-80`).
-Parakeet re-opens the audio per 480 s window (`scripts/parakeet-stitch.mjs:350`); on the
-unlink its next `sliceWav` fails, no `transcript.json` is written, and
-`transcribeOneFromQueue.ts:164-166` appends the id to `failed-transcriptions`. Only
-`TranscribeError` with `failureClass === "no-audio"` is a skip (`:156-163`). The manual
-per-channel batch honours that list permanently (`whisperBatch.ts:101-107`); the auto runner
-passes no `failedSet` and would retry.
-
-Two facts that shape the design. **Nothing automatic deletes audio after a transcription** —
-`cleanAudioFromTranscribed` is a manual channel button (`whisperActions.ts:415`) — so audio
-kept for the runner persists exactly like any downloaded audio, enters `transcribedWithAudio`
-after transcription, and waits for the operator's Clean-audio sweep; the steady-state cost is
-bounded by the existing UI and by the disk floor. And **the operator wants the "whisper wins"
-outcome**: re-acquired audio on an ASR-only video is an opportunity for a real transcript,
-not a hazard. So the fix is a deterministic, policy-driven *hand-off* at cleanup time, an
-in-flight veto as defense in depth, a transcription side that treats vanished audio as a
-skip, and attribution freshness that knows which transcript the names were made from.
-
-**Decided (operator):** attribution only. The digest lane is equally blind to a transcript
-replacement (`contextHash` hashes the channel's `digest-context.md`, not the transcript;
-`DigestProvenance` records no transcript source) — recorded in FACTS as a follow-up, not
-fixed here, because every ASR→whisper replacement would then re-queue a local LLM digest.
-
-**Three things the exploration found that the design must respect:**
-
-1. `replaceAutoSubs: false` alone is not a refusal: a leaf with
- `match.bucket === "downloadedAutoSubsOnly"` draws it regardless
- (`autoQueuePolicy.ts:147-149, :180-184`). The rule is "no leaf covering this channel draws
- that bucket", where a bucket-less leaf draws `defaultBucketsForPolicy(kind, policy)`.
-2. The remote transcribe branch wraps ENOENT as `"transport"` (`remoteTranscribe.ts:111,
- :126-133`), so a vanished-audio check at the local rethrow alone would still let the
- remote path blacklist the video.
-3. Case (11)'s seeded VTT (`backfill.spec.ts:840-842`) carries no ASR fingerprints; provenance
- falls back to `metadata.info.json`, which the fake yt-dlp's re-acquire rewrites **without**
- `automatic_captions` (`fake-ytdlp.mjs:116-123`). The hand-off e2e must seed an ASR-shaped
- VTT (`ASR_VTT`, `auto-subs-replace.spec.ts:35-48`) so the 4 KB sniff decides.
-
-Also fixed in passing, same hunk: the `"failed"` outcome returns a real partial-file cleanup
-(`backfillReacquire.ts:196-208`) that the batch `finally` never calls — it only calls
-`cleanup()` for `"fetched"`.
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/reacquire-handoff.md` and commit it alone:
-`plans: the re-acquire hand-off planned`.
-
-## Order: three commits
-
-1. **The keep decision + in-flight veto + vanished-audio skip**, with units.
-2. **Attribution transcript identity**, with units.
-3. **e2e + wording + docs + memory.**
-
-tsc in all six packages + `pnpm -C common test` + editor units after each code commit. e2e
-once after commit 3, **detached** (memory `e2e-run-detached`): `backfill.spec.ts
-auto-subs-replace.spec.ts auto-queue.spec.ts diarization.spec.ts`. Edit nothing while it
-runs. If port 3011 is held, use the offset block (`PORT=3111 EXPORT_PORT=3110
-OLLAMA_STUB_PORT=11535`) — do not kill anything.
-
-## Commit 1 — `backfill: re-acquired audio is handed to auto-transcribe, never deleted under it`
-
-### `common/jobs/autoQueuePolicy.ts`
-
-- `:307` `function matchesChannel` → **export** it; widen its parameter to
- `Pick<ChannelWork, "slug" | "platform">`.
-- After `defaultBucketsForPolicy` (`:223`) add a pure helper:
-
- ```ts
- // Would this runner kind, under this policy, draw `bucket` for this channel?
- // A leaf naming an operation draws no bucket; a leaf naming a bucket draws
- // only that one; a bucket-less leaf draws defaultBucketsForPolicy — which is
- // where replaceAutoSubs enters, and the only place it does.
- export function policyDrawsBucket(
- kind: "transcription" | "download",
- policy: Pick<AutoQueuePolicy, "replaceAutoSubs" | "root">,
- channel: Pick<ChannelWork, "slug" | "platform">,
- bucket: string,
- ): boolean
- ```
- Body: `flattenLeaves(policy.root).some(l => !l.match.operation && matchesChannel(l.match,
- channel) && (l.match.bucket ? l.match.bucket === bucket :
- defaultBucketsForPolicy(kind, policy).includes(bucket)))`.
-
-### `common/controller/digestYield.ts` — the in-flight helper
-
-After `transcriptionActivity` (`:144`), in the file's own idiom (pure decision + fail-open
-wrapper, `:89-144`):
-
-```ts
-export function evaluateTranscribingVideo(
- jobs: ReadonlyArray<Pick<JobRecord, "status" | "tasks">>,
- videoId: string,
-): boolean // some job with status "running" has a task { kind: "transcribe", id: videoId }
-export function isTranscribingVideo(videoId: string): boolean // getRegistry().list() in try/catch → false
-```
-
-Registry tasks cover BOTH the auto runner and the manual whisper-all batch
-(`transcribeOne.ts:351-357` → `taskHooks.ts:60` → `registry.addTask`); `getAutoRunnerStatus`
-sees only the runner, so it is not used. Fail open to `false`: "not transcribing" just falls
-through to the policy decision, which is the primary mechanism. (Inline transcribe inside a
-download, `downloadOneManaged.ts:1031-1038`, passes no tracker and is invisible — accepted.)
-
-### `common/controller/backfillReacquire.ts`
-
-- **Header `:38-43`** — rewrite as "the two exceptions to (4)": do-not-clean (unchanged) and
- THE HAND-OFF: kept when `settings.autoQueue.transcription` would pick this video from
- `downloadedAutoSubsOnly` (with a fresh disk check at the resume mark) or when a
- transcription task is already running on it. Say what happens next: the runner's own
- transcription leaves the audio in `transcribedWithAudio` for the operator's Clean-audio
- sweep, like any other download.
-- Imports: `getFreeBytes, evaluateDiskGate` (`../lib/diskSpace`; keep `diskGate` for `:107`),
- `readVideoFiles` (`../lib/videoStatus`), `isAutoSubsOnly` (`../lib/subtitleProvenance`),
- `detectPlatform` + `type Platform`, `policyDrawsBucket, type AutoQueuePolicy`
- (`../jobs/autoQueuePolicy`), `isTranscribingVideo` (`./digestYield`).
-- Replace the `cleanup: () => Promise<boolean>` shape in `ReacquireOutcome` (`:61-72`) and
- `NOTHING_TO_CLEAN` (`:74`):
-
- ```ts
- export type KeepReason = "do-not-clean" | "in-flight" | "hand-off";
- export type RefuseReason =
- | "no-audio" | "not-auto-subs-only" | "policy-off" | "policy-snoozed" | "no-leaf" | "disk-low";
- export type KeepDecision =
- | { keep: true; reason: KeepReason }
- | { keep: false; reason: RefuseReason };
- export type CleanupOutcome =
- | { status: "removed" } | { status: "nothing-added" } | { status: "kept"; reason: KeepReason };
- ```
-- **The pure decision, exported**, before `buildCleanup` (`:249`):
-
- ```ts
- export type KeepInput = {
- doNotClean: boolean;
- transcribing: boolean; // isTranscribingVideo(videoId)
- hasAudio: boolean; // files.audioFiles.length > 0, RE-READ after the fetch
- autoSubsOnly: boolean; // isAutoSubsOnly(videoDir, files)
- policy: Pick<AutoQueuePolicy, "enabled" | "replaceAutoSubs" | "snoozeUntil" | "root">;
- channel: { slug: string; platform: Platform | null };
- disk: { freeBytes: number; minFreeDiskGB: number; resumeMarginGB: number };
- };
- export function decideKeep(input: KeepInput): KeepDecision
- ```
- Order: `doNotClean` → `transcribing` → `!hasAudio` → `!autoSubsOnly` → `!policy.enabled` →
- `policy.snoozeUntil != null` (a lapsed snooze is already normalized to `null` by the
- sanitizer, `autoQueuePolicy.ts:582-586`) → `!policyDrawsBucket("transcription", policy,
- channel, "downloadedAutoSubsOnly")` → disk → `{ keep: true, reason: "hand-off" }`.
-
- **Disk bar: `evaluateDiskGate({ ...input.disk, latched: true }).ok`** — i.e. free ≥
- `resumeBytes` (floor + margin); a disabled gate (`minFreeDiskGB: 0`) never refuses. Why the
- resume mark: a hand-off is a download the backfill was about to give back, and the download
- runner itself resumes only at `resumeBytes` (`autoRunner.ts:663-668`) — the backfill must
- never keep audio the runner would refuse to fetch. `latched: true` on the **pure core**
- reuses the hysteresis math without touching the module latch; never call `diskGate` in
- enforce mode from a keep decision (`diskSpace.ts:231` mutates shared state).
-- `buildCleanup(videoDir, before, videoId, log, ctx: { paths; channelSlug; platform })` now
- returns `() => Promise<CleanupOutcome>`. Replace `:273-279`: if nothing added →
- `nothing-added`; else build `KeepInput` with thin I/O — `isDoNotClean`,
- `isTranscribingVideo`, **`readVideoFiles(videoDir, { checkUntranscribable: true })` re-read
- here** (the batch's `Candidate` carries no `files`, and they would be stale by the fetch
- anyway — same "re-checked HERE" discipline as `:96-102`), `isAutoSubsOnly`, `getSettings()`
- for `autoQueue.transcription` / `minFreeDiskGB` / `resumeMarginGB`,
- `getFreeBytes(ctx.paths.transcriptsDir)` — and call `decideKeep`. On keep, log exactly one
- of:
- - `Keeping re-acquired media for ${videoId}: marked "do not clean" (${added}).` (unchanged)
- - `Keeping re-acquired media for ${videoId}: a transcription is running on it (${added}).`
- - `Keeping re-acquired media for ${videoId}: handed to auto-transcribe, which will replace the auto-captions (${added}).`
-
- and return `{ status: "kept", reason }`. Otherwise the existing rm loop and `Removed…` line,
- return `{ status: "removed" }`. Call sites `:198, :207, :212` pass `{ paths: opts.paths,
- channelSlug: opts.channelSlug, platform: detectPlatform(config.url) }`.
-
-### `common/controller/backfillBatch.ts`
-
-- `BackfillBatchResult` (`:134-140`): add `reacquireHandedOff: number` — counts `hand-off`
- **and** `in-flight` (both mean "left to the transcription lane"; the log line already
- distinguishes them). Init at `:261-263`.
-- The `finally` (`:689-692`):
-
- ```ts
- if (reacquired?.status === "fetched" || reacquired?.status === "failed") {
- const out = await reacquired.cleanup(); // the failed path's partial-file cleanup now runs
- if (reacquired.status === "fetched") {
- if (out.status === "removed") result.reacquireCleaned++;
- else if (out.status === "kept" && out.reason !== "do-not-clean") result.reacquireHandedOff++;
- }
- }
- ```
- Update the comment at `:685-688`. (`present` / `disk-floor` / `gone` / config-unreadable
- return `NOTHING_TO_CLEAN` — harmless.)
-- Reconciliation (`:829-836`): same condition; text → `Re-acquired N file(s), removed M,
- handed H to auto-transcribe. Any other difference is media kept because its video is marked
- "do not clean" — if that is not what you expect, check the disk.`
-
-### `common/controller/operationJobs.ts:132-134`
-
-Inside the reacquired clause append `(batch.reacquireHandedOff > 0 ? `, ${…} handed to
-auto-transcribe` : "")`.
-
-### `common/controller/transcribeOne.ts` — vanished audio is a skip
-
-- After `resolveAudioFile` (`:45`): `async function throwIfAudioVanished(videoDir, audio,
- videoId)` — if `!(await pathExists(path.join(videoDir, audio)))`, throw
- `new TranscribeError(`audio ${audio} for ${videoId} vanished mid-run (removed by another
- lane) — skipped, not failed`, "no-audio")`. Reuses the existing skip branch; no new class.
-- Local catch (`:183-197`): after the `pauseRequested` return, `await throwIfAudioVanished`
- before `throw err`. Also before the "produced no output" throw (`:206`).
-- Remote branch (`:128-137`): wrap `transcribeViaRemote` in try/catch → `throwIfAudioVanished`
- then rethrow (finding 2 above).
-- Parakeet resume cache is untouched: `<videoDir>/.audio.mp3.parakeet/` matches none of
- `buildCleanup`'s predicates, and cached windows are re-validated against duration/segment
- when the same audio is re-fetched (`parakeet-stitch.mjs:288-297`). Say so in a comment.
-
-### Units (commit 1)
-
-- `common/controller/backfillReacquire.test.ts` — `decideKeep`, pure, one per reason plus the
- two disk edges: do-not-clean keeps before any policy is consulted; a running transcription
- keeps whatever the policy says; hand-off when ASR-only + enabled policy + covering leaf +
- disk above the resume mark; refuse without audio, or not ASR-only; refuse when the runner
- is off or snoozed; refuse when no leaf covering the channel draws the bucket; **an explicit
- leaf bucket hands off with `replaceAutoSubs` off**; free between threshold and resume ⇒
- `disk-low`; `minFreeDiskGB: 0` ⇒ keep. Never mutates its input.
-- `common/jobs/autoQueuePolicy.test.ts` — `policyDrawsBucket`: all/channel/platform leaves,
- explicit bucket vs default union, operation leaves never.
-- `common/controller/digestYield.test.ts` — `evaluateTranscribingVideo`: only a running job's
- `transcribe` task for this id counts (download task with the same id, finished job, other
- id ⇒ false).
-- `common/controller/transcribeOne.test.ts` (new): tmp dir + an executable shell script as the
- worker binary (the repo's own fake-bin convention, not a module mock): `rm -f audio.mp3;
- exit 1` ⇒ rejects with `failureClass === "no-audio"`; plain `exit 1` ⇒ not `no-audio`. **If
- driving `transcribeOne` locally needs more than ~40 lines of scaffolding (paths, worker
- config, app registry), drop it, cover by inspection, and say so in the report.**
-
-Commit body: the collision mechanics (no lock, 1 s regen, parakeet re-slice, the
-`failed-transcriptions` append), the two exceptions to guard (4), the disk-bar choice, and
-the dead `"failed"` cleanup now called.
-
-## Commit 2 — `attribution: freshness knows which transcript the names were made from`
-
-### `common/lib/attribution.ts`
-
-- `export type AttributionTranscriptSource = "whisper" | "vtt";` — narrower than
- `NormalizedTranscript.source` because cues.json's `source` is `picked.kind`
- (`normalizeTranscript.ts:133`), never `live_chat`. `export function
- transcriptSourceOf(source: string | null | undefined): AttributionTranscriptSource |
- undefined` — identity for the two literals, `undefined` otherwise ("unknown ⇒ do not
- assert").
-- `AttributionProvenance` (after `:111`): `transcriptSource?: AttributionTranscriptSource;`
- with a comment in the `diarizationGeneratedAt` voice: a whisper transcript replacing the
- ASR captions rewrites the text the names were found in.
-- `AttributionFreshnessTarget` (after `:185`): `transcriptSource?:` — absent = do not compare.
-- `isAttributionFresh` (after `:250`):
- `if (target.transcriptSource !== undefined && p.transcriptSource !== undefined &&
- p.transcriptSource !== target.transcriptSource) return false;` — **the record-carries-field
- rule** (the inverse of the `diarizationGeneratedAt` guard), so no record on disk is
- invalidated by the field's arrival. Comment it next to `sameVersion`'s rationale
- (`:215-223`).
-- `attributionTarget()` unchanged; callers splice like the diarized lane does.
-
-### `common/controller/attributeOne.ts`
-
-`const src = transcriptSourceOf(transcript.source)` from the object already in hand (`:141`);
-spread `...(src ? { transcriptSource: src } : {})` into `fullTarget` (`:166-171`) and into the
-written provenance (`:283-296`).
-
-### `common/lib/operations.ts`
-
-Local `transcriptSourceTarget(files: VideoFiles)` → `{ transcriptSource }` from
-`pickIndexTranscript(files)?.kind` (`videoStatus.ts:210-214`, **zero I/O** — `state()` runs
-per video per job start; the cost bar is `channelSnapshot.ts:590-597`), `{}` when `null`.
-Spread it into the target at the text lane (`:862`) and beside `diarizationGeneratedAt` in the
-diarized lane (`:944-947`). `attributionTarget.ts`, `attributionStatus.ts`,
-`attribution-server.ts` validator: no change.
-
-### Units (`common/lib/attribution.test.ts`, after `:165`, the `:143-165` three-assertion shape)
-
-our own transcript replacing the auto-captions invalidates names made from them (vtt record
-vs whisper target ⇒ stale; whisper vs whisper ⇒ fresh); a record written before
-`transcriptSource` existed is not invalidated by it; a target that does not know the source
-does not compare it (`attributionTarget(CURRENT, "text-only").transcriptSource === undefined`);
-`transcriptSourceOf` maps `live_chat`/null to undefined.
-
-## Commit 3 — `backfill: the hand-off is pinned end to end, and the docs say so`
-
-### `editor/e2e/backfill.spec.ts`
-
-- `seedSubtitleChannel(videoId, vtt = SEEDED_VTT)` (`:844`); add `ASR_VTT` (copy of
- `auto-subs-replace.spec.ts:35-48`) and extract `ytAudioFiles(id)` from the inline filter at
- `:910-915`.
-- **Case (12)** after `:945`: `re-acquired audio is handed to auto-transcribe when the policy
- would replace the auto-captions`. Settings: `{ ...backfillSettings({ backfill: {
- allowRedownload: true } }), autoQueue: { transcription: { enabled: true, maxWorkers: 1,
- replaceAutoSubs: true, root: { id: "root", mode: "strict", children: [{ id: "leaf-all",
- match: { type: "all" } }] } }, download: {} } }` — `sanitizePolicy`
- (`autoQueuePolicy.ts:588`) accepts it; `auto-queue.spec.ts:98-100` is the precedent. No
- workers, and the runner is **not** started (`startAutoRunnersIfEnabled` runs only at boot,
- `editor/instrumentation.ts:83-86`; the invalidate-cache route starts nothing) — the case is
- deterministic. `seedSubtitleChannel(VID, ASR_VTT)`, `generateReport`, click "Run speaker
- work". Assert: `diarization.json` lands (poll 60 s); the output contains `handed to
- auto-transcribe`; the summary line reads `… 0 cleaned up, 1 handed to auto-transcribe`;
- `ytAudioFiles(VID)` non-empty after the job; then poll `${YT_ROOT}/snapshot.json` (job-end
- regen, `operationJobs.ts:138`) until `buckets.downloadedAutoSubsOnly` contains `VID`.
-- **Case (12b)**: same seed, no `autoQueue` policy ⇒ output contains `Removed re-acquired
- media`, not `handed to`, `ytAudioFiles(VID)` → `[]` — today's behaviour pinned through the
- new code path.
-- Do **not** drive the runner end to end here: once the audio is in `downloadedAutoSubsOnly`
- the rest is exactly the lane `auto-subs-replace.spec.ts:165` already walks, and a
- backfill-vs-runner race test would be timing-bound.
-
-### Wording — one sentence each
-
-- `common/lib/settings.ts:329-330` (`allowRedownload` doc): after "unless the video is marked
- do-not-clean" — "or unless the auto-transcribe policy would replace its auto-captions
- (`replaceAutoSubs`, or a leaf on `downloadedAutoSubsOnly`), in which case the audio is kept
- for that runner."
-- `editor/app/operations/components/settings/LaneSettingsForm.tsx:109-111`: same content,
- operator-facing.
-- `editor/app/channels/[slug]/components/stages/SpeakersStage.tsx:166`: "…fetch audio (even
- on a subtitle-only channel) and then delete it — or keep it for auto-transcribe when that
- policy would replace the auto-captions — bounded by the free-disk floor."
-
-### Docs and memory
-
-- `plans/FACTS.md` — new section `## Verified 2026-08-27 — the re-acquire / auto-transcribe
- hand-off`: no per-video lock (`registry.ts:78-80`); the `finally` (`backfillBatch.ts:684-693`)
- and the bucket rule (`channelSnapshot.ts:997`); regen timing (`autoRunner.ts:871`, 1 s
- debounce; backfill regenerates once at job end); parakeet re-slice (`:350`) vs whisper
- single open; the `no-audio` skip and the `failed-transcriptions` append; the manual batch
- honours the list, the auto runner does not; remote ENOENT ⇒ `"transport"`; the dead
- `"failed"` cleanup; nothing deletes audio after a transcription (`whisperActions.ts:415`
- only); the disk-bar choice; **the sweep has no inter-download sleep and is channel-major**
- (`backfillSweep.ts:55, 335-368`); **digest lane equally blind** (`contextHash` =
- `hashDigestContext(note)`, `digestContext-server.ts:47-60`) — follow-up, same field, same
- rule, operator's LLM-cost call.
-- `plans/STATE.md` — "Last updated" prepend; runbook item 2 step 3 (`:175-179`): drop the
- "30 s / ≥ 23 days" claim, say channel-major newest-first and no inter-download sleep; step 4
- (`:180-186`) → RESOLVED by commit 1 (sha): hand-off + in-flight veto + vanished-audio skip;
- note the operator no longer needs `replaceAutoSubs: false` for the corpus run.
-- `editor/CHANGELOG.md` [Unreleased], first bullet, house voice: re-acquired audio on a
- subtitle-downloading channel is now kept for auto-transcribe when that policy would replace
- the auto-captions (and still deleted otherwise, bounded by the disk floor); a video whose
- audio is removed mid-transcription is skipped, not marked failed; speaker attribution goes
- stale when the transcript it named speakers in is replaced (only for records written from
- now on).
-- Memory: new `reacquire-handoff.md` (+ `MEMORY.md` line); amend the `slice-3-chosen-next`
- index line: runbook step 4 resolved.
-
-## Verification
-
-1. After commits 1 and 2: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export
- homepage umtool mcp`; `pnpm -C common test` (835 → +N); editor units
- `pnpm -C editor exec tsx --test "app/**/*.test.ts"` (85 → ±0).
-2. Grep gates after commit 1: `grep -rn "decideKeep\|policyDrawsBucket\|isTranscribingVideo"
- common` → definitions, call sites, tests; `grep -n "cleanup()" common/controller/backfillBatch.ts`
- shows the fetched|failed condition.
-3. e2e once, detached, after commit 3: `backfill.spec.ts auto-subs-replace.spec.ts
- auto-queue.spec.ts diarization.spec.ts`.
-4. **No editor boot against `transcripts/`, nothing written under it, no census re-run.**
-5. Manual (optional, on the e2e fixture, `PORT=3021 pnpm dev:test`): the speakers stage
- sentence mentions keeping audio for auto-transcribe; kill the server, remove
- `editor/test-transcripts` and `editor/test-settings.json`, `git status` clean.
-
-## Out of scope
-
-- Digest-lane transcript identity (recorded as a follow-up in FACTS).
-- Automatic audio deletion after auto-transcribe — handed-off audio waits for the operator's
- Clean-audio sweep like every other download; changing that is its own policy.
-- A per-video lock in the registry; the hand-off makes the race moot for the auto runner and
- the in-flight veto covers the manual paths.
-- Driving the auto runner inside the backfill e2e.
-- Re-arming the sweep (operator's, after this lands).
-
-## Handoff — the cadence
-
-On approval, Fable does not implement (memory `plan-then-opus-implements`). It spawns one
-`general-purpose` agent, `model: "opus"`, with: the plan path (after step 0, which the agent
-commits), the fish-shell caveats (commit via `git commit -F <file under $CLAUDE_JOB_DIR/tmp>`;
-quote `[slug]` paths and globs; `cd` persists; `for … end` is fish syntax in a fish shell but
-the Bash tool may hand commands to bash — use POSIX `for … do … done`), never boot against
-`transcripts/`, e2e detached, tmp files under `$CLAUDE_JOB_DIR/tmp`, and the report contract:
-commit shas with one line each; exact tsc/test outputs; e2e pass/fail per spec with any
-retry; every divergence from the plan and why; anything undone. Fable reviews on return
-(`git log --oneline da339a4..`, the hunks in `backfillReacquire.ts`, `backfillBatch.ts`,
-`transcribeOne.ts`, `attribution.ts`, `operations.ts` and the new spec; re-runs grep gates +
-`pnpm -C common test` + editor units, not e2e), sends fixes via SendMessage, and reports.
diff --git a/plans/release-10.md b/plans/release-10.md
@@ -1,2282 +0,0 @@
-# Release 10 — the brand: the Found-line mark, and base × accent reader themes
-
-`main` at `c9223978` (release 9 live on :3001 since 2026-09-25 19:40 as `0213f6c8`; C1b/C2/C3
-deployed to the hub and the homepage the same evening). Release 10's first content is the brand
-the operator asked for on 2026-09-25: one mark and one wordmark for Archilyzer and every official
-site, and a reader theme made of two independent choices, a **base** (System / Light / Sepia /
-Dark) and an **accent** (the site's own by default, any of seven by choice). The five theme
-families retire. The plan, the design decisions and the per-slice records are
-[`brand-and-themes.md`](brand-and-themes.md); this file records the release as a whole. Rules:
-`plans/tools/implementer-rules.md`.
-
-**The release-10 "lows" joined the release** (2026-09-26): they shipped as slices L1 (hub) and L2
-(runner), and merged to `main` with brand S4 before the rollout, on the operator's word. Their
-records and the integration pass that gated the three together are below ("Slice L2", "Slice L1",
-"Integration (S4 + L1 + L2), as merged").
-
-## Record
-
-### The brand, slices S0–S3 (2026-09-25)
-
-Four slices, each one Opus implementer and one Opus review, under the plan's dependency graph:
-S0 alone, then S1 and S2 in parallel worktrees off S0's tip, then S3 on the merged tree.
-
-| Slice | Branch → tip | Review | Merged to `main` |
-|---|---|---|---|
-| **S0** palette + data | `brand/found-line` off `d8dd98b8` → `02295a94` (+ `dbf12219`, the Archilyzer Media proposal) | SHIP | `7c9e3bdf` |
-| **S1** mark, icons, wordmark | `brand/mark` off `02295a94` → `03a0ce06` | SHIP (fixes `541a46e0`, `405fccd5`, `951a0ff5`, `4a7641af`; re-read SHIP) | `575ae1d4` |
-| **S2** base × accent | `brand/themes` off `02295a94` → `42e84f68` (merged `main` as `6456ac6c`) | SHIP AFTER FIXES (7 fixes; re-read SHIP) | `b9772e53` |
-| **S3** integrate | `brand/found-line` fast-forwarded to `b9772e53` → `85cf6e81` + the `plans:` records | SHIP AFTER FIXES (the fixes were in the runbook; test nits `85cf6e81`) | fast-forward |
-
-**Gates per slice** (full numbers in each slice's record in `brand-and-themes.md`):
-
-| Slice | Unit + script tests | Builds | e2e |
-|---|---|---|---|
-| S0 | common 1,874, editor unit 78, scripts 162 + 1 skip, mcp 219; SITE.md `--check` clean | editor, export, homepage ok | editor `sites-crud` + `branding` 16/16 (run 2; run 1's failure was the new test's own locator), export `site-branding` 7/7, `e2e:hub` 12/12 |
-| S1 | common 1,881 → 1,887 (review fixes), editor unit 79, scripts 162 + 1, mcp 219 | editor, export (site, hub, a brass demo), homepage ok; icons + ICO magic checked | export full 199 + 1 (`theme-family.spec:18`, a click-before-hydration race in a spec S2 deleted; rerun 6/6), `e2e:hub` 14, homepage 26, editor 48, `e2e:2origin` 3; review re-gate 8 + 14 |
-| S2 | common 1,893 → 1,907 after merging `main`, editor unit 79, scripts 162 + 1, mcp 219 | editor, export (site, hub), homepage ok | pre-merge: export full 199, hub 12, homepage 24, editor 22; post-merge: export full 203 + 1 (a ready-marker race, fixed `e3e3fb26`, then 39/39 over three repeats), hub 19, 2origin 3, homepage 27, editor 23 |
-| S3 | common 1,913, editor unit 79, scripts 162 + 1, mcp 219 | editor, export (site, hub), homepage ok, twice | below: export 204, hub 19, 2origin 3, homepage 27, **editor full 638 + 1 flaky (rerun 3/3), 12 skipped** |
-
-**What shipped, in one place:**
-- **S0 — the brand as data.** `common/lib/brand.ts` (seven named accents with a value per ground,
- each ≥ 4.5:1 against its ground and its ink; the three grounds; the Found-line mark as a shape
- list; `markSvg`; the subject-split wordmark). `site.json` takes `accent` as an id or a hex and a
- new `wordmarkLead` (a proper prefix of `headerTitle`, else dropped). The published accent stays a
- hex (`accentHex` in `/site.json`, `hub-sites.json`, the homepage summary). The editor's site form
- has the swatch radio group + Custom hex and the Wordmark lead field.
-- **S1 — the mark everywhere.** Every icon file (`/icons/*`, `/favicon.ico`) is rendered at build by
- force-static route handlers (`next/og` PNGs, a PNG-payload ICO), lit with the site's accent; the
- hub, the homepage and the editor wear the parent mark (bone on slate). Header = `BrandMark` +
- `Wordmark`; the footer credit carries the parent mark; the editor gets a favicon. The manifest is
- on ink. Both service workers: `SHELL = "shell-v2"`, `/icons/` network-first, `VERSION` unchanged.
-- **S2 — base × accent.** `tokens.css` is three base blocks × eight accent rules (the seven + custom),
- with fixed validated charts per base; Archivo / IBM Plex Sans / IBM Plex Mono; the pre-paint
- script migrates the retired theme/mode keys once; `ThemeMenu` (Base + Accent), `ThemeToggle`
- (System → Light → Sepia → Dark), the phone sheet's two native radio groups; the hub and homepage
- render dark on the server.
-- **S3 — integrate** (below).
-
-**The absent-accent contract: no change (decided 2026-09-25, S3).** A site with no `accent` renders
-in Signal, but its published `/site.json`, `hub-sites.json` entry and homepage-summary entry still
-carry **no** `accent` key, rather than Signal's hex. Publishing one would change what third-party
-hubs draw for every accent-less site they already list; today they keep their own fallback, as
-before the brand. The official sites get explicit accents at rollout (the settings table below), so
-the question is moot for them. Revisit only if a hub asks for it.
-
-### Slice S3, as shipped — integrate (2026-09-25)
-
-The full record — every carry-over with its numbers, the coherence pass, the visual set, found and
-left — is [`brand-and-themes.md`](brand-and-themes.md) "Slice S3, as shipped". In short:
-- **Review carry-overs, all done:** the brand tests pin the literal 4.5 bar, the sRGB boundary pair
- and all 21 accent values; the service-worker test covers a non-ok and a failed icon fetch; Light's
- success and warning read ≥ 4.5:1 on their own soft fills (`#1c7046` 4.74 / 5.12, `#825809`
- 4.75 / 5.14); `geometricPrecision` is scoped to **1.5dppx** (measured: words split from 1.5x, not
- only 2x); two stale comments fixed; the absent-accent decision recorded above.
-- **Coherence pass:** four stale "theme family" comments and the accent hint fixed; the three
- `[Unreleased]` changelogs rewritten as one release (release 9's bullets untouched).
-- **A build defect the gates found, fixed:** Google Fonts at times serves IBM Plex Sans's static
- weights through `https://fonts.gstatic.com/l/font?kit=…&skey=…`, which Turbopack's
- `next/font/google` cannot load, so `next dev` / `next build` failed intermittently (S1's first
- homepage build, S3's first homepage e2e). Plex Sans is now requested variable (`wght` 100–700,
- identical outlines and advances), whose file is always a pre-built `/s/` URL.
-
-| sha | what |
-|---|---|
-| `6497439d` | brand tests: the literal 4.5 bar, the sRGB boundary pair, all 21 accent values; `accent.test` the literal bar |
-| `53a692ac` | `serviceWorkerRouting.test`: a non-ok and a failed online icon fetch leave the cached icon, both workers |
-| `1da6a265` | light success `#1c7046` / warning `#825809` (+ soft fills); `themeTokens.test` text-on-soft on every base |
-| `408120a3` | `geometricPrecision` under `@media (min-resolution: 2dppx)` + the test (superseded by `dc7ff1cf`) |
-| `58e71a88` | `export/app/lib/site.ts` comment wrap; `playwright.config.ts`'s sw.js comment by its code, no committed icons |
-| `a0790d39` | stale "theme family" comments (`ui/alert`, `laneState`, `WorkersView`) and the site form's accent hint |
-| `25952f12` | the editor/export/homepage `[Unreleased]` brand bullets as one coherent release |
-| `dc7ff1cf` | the scope starts at 1.5dppx (measured), test updated |
-| `a4542721` | `fonts.ts`: IBM Plex Sans requested variable (the `l/font` build failure) |
-| `2c76f6b2` | the `tokens.css` comment: why Plex hints on Linux, why the scope starts at 1.5x |
-| `5a433aa9` | `plans:` the S3 record, `release-10.md`, FACTS, STATE, the rollout section |
-| `85cf6e81` | review nits: the token parser comment; the SW test's no-cache network-error case |
-| _this_ | `plans:` the review fixes |
-
-**Gates** (the code tip is `2c76f6b2`).
-- **tsc** clean before every code commit (four runs: `s3-tsc-1..4.log`; the changelog commit is markdown).
-- **Unit and script tests** on `25952f12`: common **1,913/1,913** (1,907 + 6: brand +1, service worker
- +4, tokens +1), editor unit **79/79**, `test:scripts` **162 + 1 skip**, mcp **219/219**;
- `file-schemas-docs.ts --check` clean. On `2c76f6b2`: common **1,913/1,913** again (the font request
- touches nothing the other three test).
-- **Builds**, `export/public` seeded under sh with `sw.js` a plain copy and no dangling links,
- `homepage/public` data copied from the primary:
- - on `25952f12` (`s3-gates.log`): editor ok (33 s), export site ok (22 s), export hub ok (19 s),
- homepage ok (13 s);
- - on `2c76f6b2` (`s3-regate.log`): editor ok (43 s), export site ok (26 s), homepage ok (14 s), export
- hub ok (27 s);
- - every export/homepage build: `out/icons` = the seven files, PNG magic `89504e470d0a1a0a` and IHDR
- 180/192/32/512/512, `favicon.ico` `00 00 01 00 03 00`; the site's `icon.svg` lit Signal `#5fa8a0`,
- the hub's and homepage's the parent mark; the site `<html>` carries `data-accent="signal"` and no
- `data-base` (theme-color pair `#f3f6f7` / `#0c0a08`), the hub and homepage `dark
- data-base="dark" data-accent="signal"`; the built CSS has `@media (min-resolution:1.5x){html,button,
- input,select,textarea{text-rendering:geometricprecision}}`.
-- **e2e, the full sequence on `dc7ff1cf`** (`s3-e2e.log`, 23:22 → 00:10, no queue wait):
- - export full **204 passed**, 6.4 min;
- - `e2e:hub` **19 passed**, 37 s;
- - `e2e:2origin` (`TWO_ORIGIN_REBUILD=1`, the seven compose outputs + `sw.js` swapped for copies,
- relinked after) **3 passed**, 33 s;
- - homepage full: **did not start** — the webServer timed out at 120 s on the font defect above;
- - **editor full (`pnpm e2e`) 638 passed, 1 failed, 12 skipped, 38.2 min** (651 tests). The failure
- is `pipeline.spec.ts:164` "channel list sync button runs the platform-queue sync", 355 ms:
- `EEXIST: file already exists, mkdir '…/editor/test-transcripts/channels'` inside `resetData`'s
- fixture copy (`editor/e2e/helpers.ts`), before the test touched the page. **Pre-existing,
- flaky:** it is the fixture-reset race the helper's own comment describes (a server runner
- re-creating a path while the tree is reset; the same class hit `channel-work.spec` and
- `pipeline.spec:106` before), and the brand diff touches no helper, runner, channel list or job
- code (`git diff --stat c9223978 HEAD -- editor/e2e/helpers.ts editor/app/channels common/jobs
- common/controller` is empty). Rerun alone ×3 on the final tree: **3 passed**.
-- **e2e re-gate on `2c76f6b2`** (`s3-regate.log`, 00:14 → 00:26, after the font fix):
- - homepage full **27 passed**, 42 s;
- - editor `pipeline.spec.ts:164 --repeat-each 3` **3 passed**, 39 s;
- - editor `theme.spec.ts branding.spec.ts sites-crud.spec.ts` **23 passed**, 58 s;
- - export full **204 passed**, 7.2 min;
- - `e2e:hub` **19 passed**, 43 s;
- - `e2e:2origin` (copies swapped in and relinked as above) **3 passed**, 41 s.
- - The full editor suite was not re-run after `a4542721`/`2c76f6b2`: they change only which
- Google Fonts URL `next/font` requests (same outlines) and a CSS comment. The suites that compile
- those fonts in `next dev` (export, homepage) ran in full on the final tree.
-- **The primary checkout's `export/public` was never written:** `sw.js` 10,027 B, mtime 20:47:37, and
- `hub-summary.json`, `hub-sites.json`, `corpus.json`, `llms.txt`, `robots.txt`, `sitemap.xml` and
- `_headers` kept their sizes and mtimes before, between and after every run.
-- Numbers tools: none.
-
-**Review** (SHIP AFTER FIXES): the must-fix and should-fix were in the runbook, not the code. The
-runbook now checks that the brand's final commit is in the primary's HEAD (it had checked S2's merge,
-which passed while S3 was unmerged), and every rollout script is fail-stop: no homepage deploy after a
-failed build, no hub step after a failed sites run, a skipped site named, no restart on the pre-brand
-`BUILD_ID`. Details: `brand-and-themes.md`, S3 "Review fixes".
-
-## Planned: the lows, L1 ‖ L2 (2026-09-26)
-
-These are the release-10 candidates from `STATE.md`, found on the evening of 2026-09-25. Their
-details are in [`release-9.md`](release-9.md) around :219, :247–300, :459, :577–580 and :650–675. They
-run as two parallel slices, alongside brand S4 (umtool + `common/bin`; see
-[`brand-and-themes.md`](brand-and-themes.md)).
-
-```
-main (4e5630aa) ──┬──> L1 hub lows (r10/hub-lows) ──┐
- ├──> L2 runner lows (r10/runner-lows) ──┼──> reviews ──> merge after the brand rollout
- └──> brand S4 (brand/media) ──┘ (or earlier, on the operator's word + a re-cut)
-```
-
-**Merge timing.** The operator cut editor/export 0.9.0 for the brand rollout, and the runbook
-builds `main`. The lows therefore stay on their branches after review, and merge once the brand is
-rolled out. If the operator asks for them sooner, export needs another cut, because its
-`[Unreleased]` notes are public on `/changelog`.
-
-### L1 — hub lows (`r10/hub-lows`)
-
-1. **`retry: false` on the hub's subs query.** A member with no subs corpus is ready about 1 s late
- (release 9 C2 re-read).
-2. **`/ask` on the hub honours the scope chips.** Use `useHubScope().isOn` in `AskHub`. It still
- waits for every archive to settle.
-3. **Official sites' accents on the hub.** A shared `seriesColor` fallback for the result stripes
- and chip dots, for an official site with no accent. This needs `hub-summary.json`'s order. The
- rollout's accents fix the cards' stripes; this covers everything else and any site without an
- accent.
-4. **One order for the official instances.** The hub orders its cards alphabetically (by
- `hub-sites.json`), the homepage by transcripts, so the same colours land on different rows. The
- hub follows the homepage, which puts `seriesColor` and the rows in the same order. If the code
- shows a reason to prefer alphabetical, say so instead.
-5. **`export/playwright.config.ts` unlinks `public/sw.js` before copying it.** In a worktree that
- path is a link into the primary checkout, and a worktree export e2e run overwrites the
- primary's hub service worker (FACTS 2026-09-25).
-
-L1 owns: `export/app/components/hub/**`, the hub search/scope files, `homepage/**` (ordering only),
-`export/playwright.config.ts`, and `export/CHANGELOG.md`.
-
-### L2 — runner lows (`r10/runner-lows`)
-
-6. **YouTube's soft block backs off.** "Try again later" classifies as `deleted` → per_video, so it
- never backs off. Classify it as a rate/bot condition that backs off, and keep genuinely deleted
- videos per_video. See the release 9 F record.
-7. **The boot pass's wait on the storage pass gets a timeout.** Log it when the timeout fires, and
- let the boot pass continue.
-8. **`/jobs` shows `cancelReason`.** It is already in the meta and the log (release 9 B4b); draw it
- on the job row / detail.
-9. **The safeRevalidate warning fires per occurrence, not once per bundle.** Rate-limit or count it,
- rather than printing it once per module load.
-
-L2 owns: `common/controller/**` and `common/jobs/**` for 6–7, the editor `/jobs` UI, and the
-safeRevalidate helper.
-
-### Shared, and whoever merges later resolves it
-
-- `editor/CHANGELOG.md`. Add a NEW `## [Unreleased]` above `[0.9.0]`, and never edit `[0.9.0]`.
-- This file's records.
-- Neither slice touches S4's files: `common/lib/brandMedia*`, `common/bin/brand-media.ts`,
- `common/bin/gen-media-glyphs.py`, `umtool/report-to-video/**`.
-
-### Gates, per slice
-
-- tsc.
-- Unit tests: common, editor, `test:scripts`, mcp.
-- **L1:** `next build` for editor, export (site and hub) and homepage; the full export suite,
- `e2e:hub`, `e2e:2origin` and the homepage e2e. Also prove item 5: after a worktree export e2e,
- the primary's `export/public/sw.js` is untouched.
-- **L2:** the editor `next build`, and the editor e2e specs for `/jobs`, boot and downloads (the
- full editor suite runs at integration). Unit tests for the classification (6) and the timeout (7).
-
-**S4 — Archilyzer Media** (the YouTube channel's assets and umtool's opt-in `render.brand` preset)
-merges after the release-10 cut, from `brand/media`, and is **not part of the site rollout**: it
-touches only `common/lib` + `common/bin` and umtool; see `brand-and-themes.md`, "Slice S4, as
-shipped". (Merged 2026-09-26 as `dcb04f61`; its one rollout step is the optional umtool rebuild,
-"Rollout" 2b.)
-
-### Slice L2, as shipped — runner lows (2026-09-26)
-
-Branch `r10/runner-lows` off `main` `5dfc9c3a`, one Opus implementer, beside L1 (hub lows) and brand
-S4. Items 6–9 of "Planned: the lows". Nothing on disk moves, and no settings, site or channel key
-changes; `JobListEntry.cancelReason` and `JobRowView.cancelReason` are additive and optional.
-
-**6 — YouTube's soft block backs off.** YouTube answers a session it is rate-limiting with the
-playability reason "This content isn't available, try again later." Its "content isn't available"
-matched `parseUnavailableFromStderr`'s `deleted` group, so it was `per_video`: no platform cooldown,
-the batch kept requesting into the block, and the video joined `EXCLUDED_FROM_DOWNLOAD` as gone.
-`isSoftBlock` (`common/lib/availability.ts`, `/isn['’]?t available,? try again later/i`) is now
-checked first in both functions: `parseUnavailableFromStderr` → `error` (transient: not excluded, not
-pinned as gone), `classifyDownloadFailure` → `rate_limit`, even over a per-video class a caller
-already holds. What that drives is the existing path, unchanged: `runManagedDownloads` records the
-platform cooldown and aborts the batch; the auto runner's `applyUnitOutcome` backs the platform off
-and defers the video 6 h; `fetchWindowManaged` records the cooldown; the metadata scan stops the
-pass (its block `kind` is `"soft-block"` for this line, which only changes the log wording; the one
-cookie retry every block gets is unchanged). "Try again later" is what marks it. A bare "Video
-unavailable", "…removed by the uploader", a terminated account, a ToS removal and Rumble's `HTTP Error
-410: Gone` stay `deleted` / `per_video`, and so does "This content isn't available." with no retry
-advice. Every failure still sleeps between downloads; the release 9 comments that gave the soft block
-as the reason now say why the pace stays anyway.
-- **The strings, and where they came from.** No sidecar on the live corpus holds one (read-only grep,
- 2026-09-26: 136,401 `availability.json` / `download-outcome.json` files and every
- `metadata-scan.json`, zero hits for "try again later", "content isn't available" or "rate-limited by
- YouTube"). The tests use:
- - `ERROR: [youtube] H64QQZuw-aA: This content isn't available, try again later.` — the line
- reported in yt-dlp issue #11426 (what a yt-dlp before #12958 prints);
- - `ERROR: [youtube] <id>: This content isn't available, try again later. The current session has
- been rate-limited by YouTube for up to an hour. It is recommended to use `-t sleep` to add a delay
- between video requests to avoid exceeding the rate limit. For more information, refer to
- https://github.com/yt-dlp/yt-dlp/wiki/Extractors#this-content-isnt-available-try-again-later` —
- built by `yt_dlp/extractor/youtube/_video.py` (yt-dlp #12958, commit `26feac3dd`) in the build the
- editor runs (`~/Projects/yt-dlp-patched`, 2026.08.19); "Your account" instead of "The current
- session" when cookies were passed;
- - the bare line with a right single quote.
- yt-dlp's wiki puts the limit at ~300 videos/hour for a guest session, ~2,000 signed in.
-
-**7 — the boot pass's wait on the storage pass is bounded.** `settleAfterStoragePass`
-(`common/jobs/bootQueuedJobs.ts`) waits for the storage pass for at most `STORAGE_PASS_WAIT_MS`,
-then settles anyway; `instrumentation.ts` calls it in place of `storagePass.then(settle…)`.
-- **60 s, and why.** A healthy pass takes milliseconds: `findmnt -T` answers in under 10 ms on this
- machine. Its bounded worst case is two or three `findmnt`s per location at `FINDMNT_TIMEOUT_MS`
- (3 s) — identity and fstab, or where the uuid is mounted — plus, for a location being re-pointed,
- the preflight's second probe and a stat per channel on it: about 12 s a location. Nothing bounds
- the `stat` of a location's root or its statfs, and on a hung network mount they never return. 60 s
- covers several locations at their worst; past it the pass is stuck on a syscall, and waiting buys
- nothing.
-- **When it fires:** `[boot] storage pass still running after 60 s; settling queued jobs without it
- (a hung mount? a job re-queued for a channel on it will wait on the same mount, and the re-queues
- after it with it)`, and, when the pass finally ends, `[boot] storage pass finished N s after the
- queued-job pass began waiting (it stopped waiting at 60 s)`. The race is over a derived promise,
- so the storage pass is never cancelled and a re-point it enqueued runs to the end. A pass that
- throws counts as finished.
-- **What a re-queue then meets** (corrected in review; as first shipped this said every such job is
- refused at once). For an UNMOUNTED drive, the media guard's `stat` gets ENOENT at once, so the job
- is refused — at submission, closing the old meta `cancelled` with the error, or when it starts —
- and `/jobs` says so. For a HUNG mount, the case the bound exists for, the guard's own `stat`
- (`lib/channelMedia.ts`) hangs on the same syscall; re-queues run one at a time, so the ones after
- it stay `queued` until the mount answers. Every cancel has run by then. Left: see below.
-
-**8 — `/jobs` shows `cancelReason`.** `JobListEntry.cancelReason` is read from the meta only when its
-status is `cancelled`; `fromEntry` copies it to `JobRowView.cancelReason`. `JobRow.tsx` draws it
-wherever the cancelled pill is: under the pill in the table's Status cell, at the end of a card row's
-heading, and as the pill's `title` on a compact row. The job page (`/jobs/[id]`) adds a full-width
-**Cancelled because** cell. All carry `data-testid="cancel-reason"`. Everything is added; no existing
-label, text or test id changed (`editor/e2e` had no `cancel-reason`, `Cancelled because` or detail-page
-cell assertions to collide with). A live row never has one: only the boot pass writes it, to metas
-from before the boot.
-
-**9 — the safeRevalidate warning is counted.** `SkipReporter` (`editor/app/lib/safeRevalidate.ts`),
-one per process on `globalThis.__yttSafeRevalidateSkips__` (LOW-4: one per module instance was not
-even once). A skip is one `safeRevalidate` call with no request store, however many targets it names.
-The first after a quiet spell is logged at once with its paths, under the old prefix, and opens a
-`SKIP_REPORT_WINDOW_MS` (10 min) window. The rest of the window are counted, and one line at its end
-reports them: `[safeRevalidate] N more skip(s) with no request store in the last 10 min (latest:
-…); T since this process started.` So at most two lines per window. The end-of-window timer is
-unref'd. It is not reset by `/api/test/invalidate-cache`: it decides only how many log lines a skip
-costs, and nothing reads that log.
-
-| sha | what |
-|---|---|
-| `deaff1d9` | 6: `isSoftBlock`; `parseUnavailableFromStderr` → `error`, `classifyDownloadFailure` → `rate_limit`; the scan's `soft-block` kind; stale comments; `availability.test.ts` +3, `managedDownloadsSleep.test.ts` +1 |
-| `d2ff1411` | 7: `STORAGE_PASS_WAIT_MS`, `waitForStoragePass`, `settleAfterStoragePass`, `instrumentation.ts`; `bootQueuedJobs.test.ts` +5 |
-| `904ffc4e` | 8: `cancelReason` through `listJobs` → `fromEntry` → `JobRow` and the job page; `listJobs.test.ts` +1, `jobRows.test.ts` +1, `jobs-filters.spec.ts` +1 |
-| `11446fba` | 9: `SkipReporter`, one per process; `safeRevalidate.test.ts` 3 → 9 |
-| `fc2ce63c` | 8: a card row's reason at the end of its heading, not beside the pill |
-| `5b657aeb` | `plans:` this record, FACTS (three release 9 bullets amended), the editor `[Unreleased]` bullets |
-
-**Gates**, all from the worktree root.
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) clean before every code
- commit (`l2-tsc-1..5.log`).
-- **common 1,924/1,924** (1,913 + 11: availability +3, managedDownloadsSleep +1, bootQueuedJobs +5,
- listJobs +1, jobRows +1); **editor unit 85/85** (79 + 6, `safeRevalidate.test.ts`);
- **`test:scripts` 162 + 1 skip of 163**; **mcp 219/219** (`l2-units.log`, on `11446fba`).
-- **Editor build** `pnpm --filter editor exec next build` ok: 89 s on `11446fba` (`l2-build.log`) and
- 52 s on the code tip `fc2ce63c` (`l2-build-2.log`).
- `export/public` in the worktree: the generated paths linked from the primary, `sw.js` a plain copy.
-- **EDITOR e2e.** Spec list `l2-specs.txt`, 37 specs: every spec that opens `/jobs` or its jobs
- (`jobs jobs-filters jobs-retry jobs-channel jobs-active-order jobs-reorder jobs-batch-tasks-drain
- job-stream-cancel cancel queue queues dashboard widget channel-work`), the boot and runner specs
- (`auto-queue lane-runner ops-api backfill`), downloads and their classification (`availability
- availability-backfill metadata-scan-softblock metadata-scan-botcheck pacing retry-bucket
- rumble-sweep fetch-window undownloaded download-part-files partial-downloads-bucket title-filter
- pre-clean-availability maybe-missing`), sync (`sync-deep sync-break-on-existing scheduler`), a
- revalidating job (`truncated-check`) and `storage-locations`, all `.spec.ts`. A content grep for
- the prompt's five words matches 122 of 123 specs ("sync" is in "async"), so the list is by name and
- by what each spec drives.
- - Run 1 (`l2-e2e-1.log`, on `fc2ce63c`, 7 min in the queue behind L1): **213 passed, 2 failed,
- 13.9 min** (215 tests). `ops-api.spec.ts:447` (B1) printed the new first line live: `[safeRevalidate]
- no request store …; skipped revalidating /channels/slow-b, /channels, /operations/[id] (page),
- /cleanup, /. … 1 skip(s) since this process started; more in the next 10 min are counted and
- reported together.`
- - `channel-work.spec.ts:208`, 233 ms: `EEXIST: file already exists, mkdir
- '…/editor/test-transcripts/channels'` in `resetData`'s fixture copy (`helpers.ts:69`), before the
- test touched the page — the pre-existing fixture-reset race S3 met in `pipeline.spec.ts:164`.
- - `lane-runner.spec.ts:203`, 7.9 s: `apiRequestContext.get: read ECONNRESET` on a
- `/api/auto-queue/status` poll; the next four lane-runner tests passed.
- - Rerun alone, `channel-work.spec.ts:208 lane-runner.spec.ts:203 --repeat-each 3`
- (`l2-e2e-rerun.log`, 4m55s in the queue behind S4): **6 passed, 0 failed, 1.0 min**. Both are
- **pre-existing flakes**, not this slice: the EEXIST is the fixture-reset race in the helper, and the
- reset was a socket dropped mid-poll by the dev server. The slice's diff touches neither
- (`git diff --stat 5dfc9c3a HEAD -- editor/e2e/helpers.ts editor/app/api/auto-queue
- common/controller/autoRunner.ts common/jobs/autoQueueState.ts editor/app/channels` is empty).
- - The primary checkout's `export/public/sw.js` was not written (10,027 B, md5 `55cbf381…`, mtime
- 2026-09-25 20:47:37, before and after).
-- **Numbers tools: none.**
-
-**Found and left.**
-- ~~A soft-blocked prefetch still makes the primary attempt~~ and ~~the availability check has no
- rate-limit stop~~: both done in the review fixes, below.
-- **A hung mount can hold the boot pass's re-queues.** After the 60 s timeout, a job re-queued for a
- channel on a hung mount waits on the media guard's `stat`, and the re-queues after it wait with it
- (above). Cancels are unaffected, and re-queues are few (one at the first live boot). A bound on the
- guard's `stat`, or re-queues that do not wait on each other, would fix it.
-- **An old yt-dlp's soft-block line on a channel listing.** A flat-playlist listing that fails with
- the bare pre-#12958 line now classifies `rate_limit`, so `enumeratePlaylistUrls` throws
- `EnumerationIncompleteError` (`runYtdlp.ts:420`) and a full sweep falls back to its paged walk (one
- more page request). The current yt-dlp's longer line took that path before this slice (it matches
- `/rate-limit/`), and a flat listing never reaches the playability check that prints it.
-- **Manual batches have no per-video deferral.** A video that answers "try again later" every time
- stops every manual download-missing at itself, on every run; the auto runner defers it 6 h
- instead. It errs toward backing off.
-- **Earlier misreads cannot be found.** An availability check stores no stderr for a `deleted`
- result, so a soft block it read before this release is indistinguishable from a real removal. None
- shows in the download outcomes or scan stores (above).
-- **No e2e drives the soft block through a download.** The fake yt-dlp has no sentinel for the
- "try again later" line; the chain is pinned by the classifier tests and by
- `managedDownloadsSleep.test.ts`, which feeds the real line through the classifier into the batch
- loop.
-- `plans/STATE.md` still lists items 6–9 as open; it is shared with L1, so the merge updates it.
-- ~~An unblocked tier C check judges a suspect with no `webpage_url` on its old record~~
- (pre-existing, seen while fixing): fixed in the re-read, below.
-- **New low: `resolveMaybeMissingState` reads an `error` probe newer than the scan as `available`**
- (`stateFromAvailability`'s default; pre-existing, seen while fixing). A maybe-missing video whose
- confirm probe failed (a 403, a network error, or the one rate-limited probe of a blocked run)
- stops being flagged. It is display-only: it feeds the maybe-missing state in `buildIndex.ts`
- (~:1180), i.e. the published site's presence badge. No deletion path reads it; the clean gate uses
- `resolveEffectiveAvailability`. The fix is one line (`error` → `maybe_missing`), but it changes
- published presence semantics and the maybe-missing count, so it needs its own export check: not
- in this slice. Before this slice the soft block published a false "deleted", which was worse.
-
-**Review fixes (review verdict SHIP AFTER FIXES, `l2-review.md`).**
-
-- **Item 7's wording (should-fix).** The comment, the timeout line and this record promised that a job
- re-queued for a channel the storage pass had not reached is refused at once. True for an unmounted
- drive; not for a hung mount, where the media guard's own `stat` hangs too and the sequential
- re-queues behind it stay `queued`. Corrected in all three; listed under found and left. No
- behaviour change.
-- **A rate-limited prefetch ends the download (question a).** In `runManagedDownload`, after the
- prefetch's auth retry: when the last prefetch attempt classifies `rate_limit`, one log line
- (`Metadata prefetch for <id> was rate-limited by the source; not attempting the download …`) and
- the record `failed` / `rate_limit` with only the prefetch attempt(s). The sidecar and
- availability-history tail is one helper, `writeOutcome`, which both exits call. Every other failure
- class keeps today's flow. The batch's cooldown and abort, and the runner's deferral, follow from the
- record unchanged.
-- **The availability check stops on a rate limit (question b), with the data-loss guard in the same
- commit.**
- - `runAvailabilityCheck`: the first probe that classifies `rate_limit` records its own `error`
- and sets `blocked`. No further probe starts; the rest count as `skipped`, and a `STOPPED: …` line
- says how many. After the pass the platform cooldown is recorded once, best-effort, with
- `recordDownloadBackoff(detectPlatform(config?.url ?? url) ?? "unknown", paths)`, the key the batch
- and the Sync gate use (`onPlatformBackoff` is the test seam). The result gains `blocked`,
- `blockMessage` and `probedIds`.
- - **`verifyBeforeClean`: every tier C suspect the check did not probe is `unverified`.** Judged on
- its old `availability.json` (a months-old `public`), it would have been cleared for an
- irreversible delete. As first fixed (`b8053655`) this applied only to a BLOCKED check. The re-read
- (`52bb00ef`) dropped that condition, so a suspect an unblocked check skipped for having no
- `webpage_url` is unverified too. That closes a pre-existing gap. The review's read-only scan found
- no such video on the live corpus (79,700 dirs, 1,186 clean candidates), so nothing changes today;
- such a video is simply never cleaned until it has a `webpage_url`. A suspect every probe reached
- is judged exactly as before.
- - The other callers are unaffected, as the review said. `checkKeptDeleted` only pins, and an unprobed
- id keeps its old verdict (pinning is the safe direction). The full-sweep confirm leaves an
- unprobed id `maybe_missing`, because its probe time is older than the scan's.
-- **Two found-and-left lines** (above): an old yt-dlp's soft-block line on a flat listing, and manual
- batches stopping at a persistently soft-blocked video.
-
-| sha | what |
-|---|---|
-| `61c03ac1` | (a) the rate-limited prefetch exit, `writeOutcome`; `prefetchRateLimit.test.ts` (4) |
-| `24e0f7d5` | item 7's comment and timeout line say what a hung mount does |
-| `b8053655` | (b) the availability check's stop + cooldown + `probedIds`; `verifyBeforeClean` leaves unprobed suspects unverified; `checkAvailability.test.ts` (3), `verifyBeforeClean.test.ts` +2 |
-| `89218c38` | `plans:` this paragraph, the item 7 record text, found and left, FACTS, the `[Unreleased]` bullets |
-| `52bb00ef` | (re-read) every unprobed tier C suspect is unverified, blocked or not; `verifyBeforeClean.test.ts` +1 (a no-URL suspect in an unblocked check) |
-| _this_ | `plans:` the re-read fix and the `resolveMaybeMissingState` low in this record, FACTS |
-
-**Tests, and the proof they bite.**
-- `prefetchRateLimit.test.ts` drives the real `downloadOneManaged` against a temp yt-dlp script that
- counts its spawns. A soft block gives 1 spawn, 1 attempt and a `rate_limit` sidecar, and a 429 is
- the same. A 403 still reaches the primary (2 spawns, `network`), and so does a removed video (2,
- `per_video`). With the exit disabled, the soft-block and 429 cases fail.
-- `checkAvailability.test.ts` covers four probeable videos:
- - a soft block gives 1 spawn, 3 skipped, one `error` written and one youtube cooldown;
- - a 429 and the bot check behave the same;
- - a 403 and a removed video probe all four, with no cooldown.
-- `verifyBeforeClean.test.ts` runs through the real quick check and tier C:
- - a blocked confirmation leaves all 3 suspects `unverified`, although two carry a stale `public`;
- the listed video stays cleanable, and the cooldown lands in the state file;
- - an unblocked one probes all 3 and judges `public` / `deleted` / 403 as before;
- - with the guard disabled, the blocked case fails.
-
-**Re-gate on `b8053655`:**
-- tsc clean before each fix commit (`l2-tsc-6..8.log`).
-- Unit tests (`l2-units-2.log`): common **1,933/1,933** (1,924 + 9), editor unit **85/85**, `test:scripts`
- **162 + 1 skip of 163**, mcp **219/219**.
-- Editor `next build` ok, 43 s (`l2-build-3.log`).
-- EDITOR e2e (`l2-e2e-2.log`): the 37 specs plus 9 cleanup / availability specs (`cleanup-actionable
- cleanup-holds cleanup-page do-not-clean shard cookies-mode whisper channels-actions
- auto-subs-replace`; `pre-clean-availability`, `availability`, `availability-backfill` and
- `maybe-missing` were already in the list). **256 passed, 0 failed, 16.2 min**, no queue wait.
-- The primary's `export/public/sw.js` was untouched again.
-
-**Re-read fix (`l2-review.md`, "Re-read of fixes": no must-fix, one should-fix), on `52bb00ef`.**
-- The fix is `52bb00ef`, above.
-- The new `verifyBeforeClean.test.ts` case puts a no-URL suspect with a stale `public` into an unblocked
- check:
- - only the other suspect is probed;
- - the no-URL one comes back `unverified` and excluded;
- - the probed `public` suspect and the listed video stay cleanable;
- - no cooldown is recorded.
- With the old blocked-only condition it fails; the blocked and unblocked cases still pass.
-- tsc clean (`l2-tsc-9.log`).
-- common **1,934/1,934** (+1, `l2-units-3.log`).
-- EDITOR e2e `cleanup-actionable cleanup-holds cleanup-page do-not-clean pre-clean-availability`
- (`l2-e2e-3.log`): **12 passed, 0 failed, 1.1 min** (9 s in the queue). `pre-clean-availability`
- was added to the four named specs because it drives all three tiers of the gate end to end.
-
-### Slice L1, as shipped — hub lows (2026-09-26)
-
-Branch `r10/hub-lows` off `main` `5dfc9c3a`, worktree `/home/user/Projects/r10-hub-lows` (port
-block #6). All five items are done. Item 4 follows the homepage: the code gave no reason to keep
-alphabetical (below).
-
-1. **`retry: false` on the federated subs manifest** (superseded by review fix 4 below: a 404 is an
- empty manifest, and a real error is retried once) (`common/components/SearchDataContext.tsx`,
- the `subsQueries` of `MultiSiteDataProvider`). Readiness waits for the subs query to settle. A
- member with no live chat answers 404, and the client default (`retry: 1`, `QueryProvider.tsx`)
- held its chip at `loading` for one more second. The single-site `useSubsManifest("")` shares the
- query key shape but never an origin the hub uses, so it is unchanged. **Cost, accepted in the C2
- re-read:** a transient network error on a member's subs manifest is also not retried. Its chip
- reads `ready` without that member's live chat, and no Retry is offered, because the chip is not
- `failed`.
-2. **`/ask` honours the scope chips.** `AskHub` builds its list with `useFederatedSites()`, the same
- hook `HubHome` uses, so an archive switched off on the front page is not fetched on `/ask`. It is
- still not `progressive`: the chat waits for every archive in scope to settle.
-3. **One colour per archive, on every surface.** `officialInstances(members, summary)`
- (`common/lib/hubSummary.ts`, pure) resolves each official instance's colour: the site's own
- accent, else the summary's, else `seriesColor()` at its index in the summary, the colour of its
- homepage card and chart layer. It replaces `ArchiveShelf`'s private fallback (C1). A member the
- summary does not name takes the colours after the summary's, so it cannot share a colour with a
- named instance. Before, an unnamed member took its card index, which could collide.
- `useHubSites()` (`export/app/components/hub/useHubSites.ts`) is the one list every hub surface
- reads, each official entry wearing its resolved colour: the shelf's cards, the scope chips' dots,
- the result cards' left edge (`accentOf`), and the channel groups' dots (`FiltersPanel`,
- `HubOfflineManager`). An added archive with no accent still has no stripe in the results. Its
- shelf card keeps `var(--brand)`.
-4. **One order.** `officialInstances` also orders the official instances by the summary's `sites`,
- the homepage's order (transcripts, most first: `homepageSummary.ts:160`). A member the summary
- does not name follows, in `hub-sites.json` order, and with no summary that order stands. The
- cards, the chips, the filter panel's groups and `/ask` all follow it.
- **Why not alphabetical:** nothing in the code depends on `hub-sites.json`'s order. The channel
- list sorts by origin itself, `corpus.json`/`llms.txt` keep their own (compose-time, unchanged),
- and the merge sorts records by date. The one cost is that the order moves when two instances'
- transcript counts cross. The homepage already does that, and the hub now does it on the same
- build.
- **No reorder flash:** `useHubSites` lists the official instances only once `/hub-summary.json`
- has settled (`useHubSummary` now returns `{summary, settled}`), whether it was found, missing or
- unreadable. Both files are small, same-origin and requested together (the hub service worker
- passes both straight through), so the wait is the gap between two requests already in flight.
- `HubStats` now counts the provider's list (`federation.sites`) rather than the registry. It
- therefore never reads "Searching 0 archives" while that list waits.
-5. **`export/playwright.config.ts` unlinks `public/sw.js` before copying `site-sw.js`**
- (`fs.rmSync(SW_DEST, {force: true})`). In a worktree that path is a link into the primary, and
- `copyFileSync` writes through a link. Proof below.
-
-| sha | what |
-|---|---|
-| `1f852979` | `export: playwright.config.ts` unlinks `public/sw.js` before copying the site worker (item 5) |
-| `6fa6bd3b` | `common: officialInstances`: the summary's order and one colour each, plus 4 unit tests (items 3–4) |
-| `cf5455c0` | `hub:` `retry: false` on the federated subs manifest; e2e counts one subs request at `ready` (item 1) |
-| `90ec10a1` | `hub:` `useHubSites` / `useFederatedSites`; `ArchiveShelf`, `HubHome`, `HubStats`, `AskHub` read it; `useHubSummary` `settled`; e2e for order + colour (items 3–4) |
-| `21be8700` | `hub: /ask` honours the scope chips; e2e (item 2) |
-| `86d686fb` | `export: [Unreleased]` (a new section above `[0.9.0]`) |
-| `a9d31063` | `plans:` this record |
-
-**Gates**
-- **tsc:** clean before every code commit. Five runs, 37–91 s (`l1-tsc-1..5.log`). `cf5455c0` was
- staged as a subset of a tree that had passed tsc (`l1-tsc-3`), with no type dependency on the
- unstaged rest.
-- **Unit and script tests** on `86d686fb`: common **1,917/1,917** (1,913 + 4, all `officialInstances`),
- editor unit **79/79**, `test:scripts` **162 + 1 skip**, mcp **219/219**.
-- **Builds** on `86d686fb` (`l1-gates.log`), with `export/public` seeded under sh (no dangling links)
- and `homepage/public` data copied (60 MB):
- - editor ok (44 s);
- - export site ok (30 s), `data-accent="signal"`;
- - export hub ok (31 s), `dark data-base="dark"`, `out/ask/index.html` present;
- - homepage ok (22 s).
-- **e2e on `86d686fb`** (`l1-e2e.log`):
- - export full **204 passed**, 9.6 min;
- - `e2e:hub` **22 passed** (19 + the 3 new tests), 46.1 s, after 18.4 min in the queue behind L2;
- - `e2e:2origin` (`TWO_ORIGIN_REBUILD=1`; the seven composed entries + `sw.js` swapped for copies,
- relinked after) **3 passed**, 35.7 s;
- - homepage full **27 passed**, 42.6 s.
- - During development: `e2e:hub` 21/21 (56.8 s, with the item-1 and items-3–4 tests). Then
- `federated-search` + `ask` + `ask-grounding` went 9 passed, 1 failed, and 10/10 after a fix to
- the new `/ask` test's own wait. `AskChat`'s composer reads ready for the instant before the
- registry loads, so the test now waits for Origin A's fetch first (below).
-- **Red on the base source** (`l1-redgreen.log`). The three new tests were run with the six source
- files checked out at `5dfc9c3a` and the specs kept. Each failed for the reason it exists:
- - the subs test made **2** subs requests by `ready` (expected 1);
- - the order test's first card read "Origin A" (expected "Origin B"), so its colour assertions
- never ran;
- - `/ask` made **7** requests to the switched-off Origin B (expected none).
-
- The source was restored and the tree left clean.
-- **Item 5, proved.** Before the export run the worktree's `export/public/sw.js` was a LINK to the
- primary's. The config loaded, and the worktree's became a plain 11,172 B file (md5 = `site-sw.js`).
- The primary's `export/public/sw.js` read **10,027 B, mtime 2026-09-25 20:47:37.183119759, md5
- `55cbf381…`** before the run, during it (02:38), after it, and after every later run. The other
- seven composed files kept their sizes and mtimes throughout (`l1-primary-public-before.txt`,
- `l1-gates.log`, `l1-e2e.log`).
-- Numbers tools: none. No `settings.json`, `site.json` or `config.json` key changed. `hub-sites.json`
- and `hub-summary.json` are unchanged on disk: the order is applied in the browser.
-
-**Found and left**
-- **The `/ask` composer reads ready before the hub's list loads** (pre-existing; CLOSED by review
- fix 1 below: an empty scope is never ready on `/ask`). With no archives
- listed yet, the provider has nothing in scope, so it counts as settled and `summariesReady` is
- true for that instant. A question sent then would ground in nothing. `ask.spec` relies on the
- empty-hub case being ready. The window used to end when `hub-sites.json` arrived. It now ends
- when both it and `hub-summary.json` have arrived: same-origin, and requested together. A fix would
- be for `AskHub` to count as ready only once the registry's built-ins have loaded. That needs a
- "loaded" signal from `siteRegistry.ts`, which does not expose one.
-- **`/ask` does not show which archives are in scope.** The front page has the chips; `/ask` silently
- follows them. A visitor who switched an archive off weeks ago gets answers from the rest. A
- one-line "Searching N of M archives — change on the front page" would need a copy ruling.
-- **After the rollout the hub's cards and the homepage's cards differ in colour.** The hub prefers a
- site's own accent (C1, kept); the homepage's `ArchiveCards` deliberately draws only
- `seriesColor(i)` so a card matches its chart layer. The two sites now list the instances in the
- same order.
-- **FACTS is stale after merge:** "Replace `export/public/sw.js` with a copy before any export e2e in
- a worktree" (Release 9 facts, "Worktree e2e can write INTO the primary") no longer holds for
- `sw.js`. Review fix 2 below retires the compose-output swap too. Not edited here (a shared file).
-
-`[Unreleased]` bullets: `export/CHANGELOG.md` (three: order and colour, `/ask` scope, subs).
-`editor/CHANGELOG.md` and `homepage/CHANGELOG.md` are unchanged, because neither app changed. The
-item-5 harness fix is not in the public changelog.
-
-**Review fixes** (review SHIP AFTER FIXES, `l1-review.md`; four findings, all fixed on `r10/hub-lows`).
-
-1. **Must-fix: `/ask` with every archive switched off** (`efe6e48f`).
- - **The failure.** With L1's scope, an empty in-scope list counted as settled, so the composer
- enabled and a question went out over zero records.
- - **Readiness.** `MultiSiteDataProvider` now counts an empty scope as NOT ready unless it is
- `progressive`. `/ask` is not progressive, so it stays disabled. That also closes the instant
- before the hub's list arrives (the early-ready window from "Found and left", which no longer
- applies). The progressive front page still settles on an empty scope. Its results read "No
- videos match" rather than "loading index…" forever, and its chips and "Searching 0 archives"
- say why.
- - **The line.** `AskChat` shows one line in the composer when the hub has archives and every one
- is off: `NO_ARCHIVES_IN_SCOPE`, `role="status"`, `data-testid="ask-blocked"`. It replaces the
- placeholder and the key hint. The box and the Ask button are disabled.
- - **The copy** is a single exported constant in `export/app/ask/hubScopeCopy.ts`, for the
- operator. The draft is now "No archives selected. Choose some on the [hub's front page] to ask."
- (re-read, `0fc63ed7`). The first draft said "Turn one on above", but `/ask` shows no chips.
- The [bracketed] words render as a link to `/`, where the chips are; dropping the brackets
- drops the link.
- - **A hub with no archives at all** now reads "Loading transcripts…" on `/ask`, instead of being
- ready over nothing. `ask.spec` accepts either.
-2. **Should-fix: the compose scripts wrote through the worktree links** (`1203f4a6`).
- - **The helpers.** `common/bin/_publicFile.ts`: `writePublicFile` and `copyPublicFile` `rm` the
- path first (`fs.rm` uses lstat, so only a link is removed, never its target). `ownDir` replaces
- a linked directory with an empty real one.
- - **compose-hub** routes every write through them.
- - **compose-site** routes through them every top-level file and the per-site subs/posts/digests
- manifests, and `reconcileChannelTree` owns its tree first. The paths that already removed first
- (summaries/stats `replaceDir`, archives, `sw.js`, chart-templates) are unchanged.
- - **Real builds are unchanged.** Where the paths are real (the primary checkout's
- `export/public`, which holds no links, and the docker per-site `/site/public` dirs), the result
- is what a plain write gave.
- - **Tests.** `_publicFile` (4). `compose-hub`: a worktree compose leaves all seven of the
- primary's files' content and mtime as they were. This one was red on the old `compose-hub`.
- `compose-site`: a linked tree is owned, and the primary's is untouched.
- - **Proof:** below.
-3. **Nit** (`609a7fe1`): `useHubSummary` runs with `networkMode: "always"`, so a first mount
- after an `offline` event settles as "no summary" instead of pausing.
-4. **Nit: the subs query** (`78e837f1`, replacing `cf5455c0`'s `retry: false`; its failure rule
- was corrected in the re-read, `d0fa13ae`).
- - **A 404** resolves to an empty manifest at once, the way posts does. It is one request.
- - **Any other error** keeps one retry (explicit on this query). If it still errors, the query
- counts as SETTLED: the archive is ready, its videos are searched, and only its live chat is
- missing. This is C2's rule. `78e837f1` had instead made such an archive `failed`, which the
- re-read reverted (below).
- - **Why a 404 is readable.** A member's `/subs/*` carries CORS on 404s too: checked live,
- `https://jeralyzer.pages.dev/subs/<missing>.json` → `404` + `access-control-allow-origin: *`.
- So a missing file reads as a 404, not as a network error. `serve`, which self-hosted docker
- archives use, sends a 404 with no CORS header, and that is the case the settled rule covers.
-
-| sha | what |
-|---|---|
-| `78e837f1` | `hub:` subs: a 404 is an empty manifest; a real error is retried once, then failed its archive (reverted by `d0fa13ae`); e2e (finding 4) |
-| `efe6e48f` | `hub: /ask` with every archive off is not ready and says why (`NO_ARCHIVES_IN_SCOPE`); an empty scope is never ready when not progressive; e2e (finding 1) |
-| `609a7fe1` | `hub: useHubSummary` `networkMode: "always"` (finding 3) |
-| `1203f4a6` | `common:` `_publicFile.ts`; compose-hub and compose-site never write through a link; 6 unit tests (finding 2) |
-| `323c878f` | `export: [Unreleased]` — the two reader-visible fixes |
-| `5304ce2d` | `plans:` these review fixes |
-
-**Gates on `323c878f`**
-- **tsc:** clean before every code commit (`l1-tsc-6..8`). `78e837f1` was staged as a subset of the
- tsc-green `l1-tsc-7` tree.
-- **Unit tests:**
- - common **1,923** (1,917 + 6);
- - editor unit **79**;
- - `test:scripts` **162 + 1 skip**;
- - mcp **219**.
-- **Builds** (`l1-fix-gates.log`), all ok:
- - editor (53 s);
- - export site (43 s);
- - export hub (33 s);
- - homepage (20 s).
-- **e2e** (`l1-fix-e2e.log`):
- - export full **204 passed**, 7.1 min (after 9.0 min in the queue behind L2);
- - `e2e:hub` **24 passed** (22 + the 2 new tests), 1.4 min;
- - `e2e:2origin` (`TWO_ORIGIN_REBUILD=1`, links in place, **no swap**) **3 passed**, 34.0 s;
- - homepage full **27 passed**, 44.8 s.
-- **During development:** the three touched hub specs went 11 passed, 1 failed. The failure was the
- new `/ask` test waiting for an answer the fixture member cannot produce: it serves no transcript
- tree, so the chat's own search never finishes. The test now asserts the question reaches the
- provider. After that, 1/1.
-- **Red on the pre-fix source** (`l1-fix-e2e-red.log`, with the four `/ask` and provider files at
- `a9d31063`): the two new tests fail for the reason each exists.
- - The subs-500 chip read `ready` (expected `failed`).
- - With every chip off, `/ask` showed no blocked line.
-
- The source was restored and the tree left clean.
-- **Proof of finding 2:** the export and hub runs left the seven composed entries as LINKS into
- the primary (`sw.js` was already the worktree's own, from item 5).
- - **Before**, primary `export/public` (size, mtime, md5):
-
- | file | size | mtime | md5 |
- |---|---|---|---|
- | `sw.js` | 10,027 | 20:47:37.183119759 | `55cbf381…` |
- | `hub-summary.json` | 1,441 | 20:48:07.499176932 | `7d8a101e…` |
- | `hub-sites.json` | 579 | 20:47:37.173642710 | `28b9893c…` |
- | `corpus.json` | 1,535 | 20:47:37.177642649 | `54b64280…` |
- | `llms.txt` | 1,031 | 20:47:37.177642649 | `87255fa7…` |
- | `robots.txt` | 130 | 20:47:37.178642634 | `60217070…` |
- | `sitemap.xml` | 364 | 18:08:42.340736263 | `76ffaa3c…` |
- | `_headers` | 459 | 20:47:37.178642634 | `a5f88f82…` |
-
- All mtimes are 2026-09-25 (`l1-fix-primary-before.txt`).
- - `e2e:2origin` ran `build:hub` through those links.
- - **After, the worktree** holds its own plain files: `hub-sites.json` 2 B (`[]`), `corpus.json`
- 468 B, `llms.txt` 494 B, `robots.txt` 76 B, `_headers` 459 B, `sw.js` 11,005 B.
- `hub-summary.json`'s link was removed (no index). `sitemap.xml`, which compose-hub does not
- write, is still a link.
- - **After, the primary's eight files** are byte-identical, with the same sizes and mtimes
- (`l1-fix-primary-after-2origin.txt`, `diff` empty). They were identical again after the homepage
- run (`l1-fix-primary-after.txt`).
-
-**Retired at merge (for FACTS; not edited here):** both worktree workarounds become unnecessary.
-- "Replace `export/public/sw.js` with a copy before any export e2e in a worktree" (Release 9 facts):
- `playwright.config.ts` unlinks it (item 5).
-- "Swap the compose outputs for copies before `e2e:2origin` and relink after" (Brand facts,
- "Worktree e2e and builds write through the `export/public` links"): compose-hub and compose-site
- unlink before writing.
-
-The seed (per-path links from the primary) stays as it is. A worktree run now replaces a link with
-its own file, and the next seed relinks it.
-
-**Re-read of the fixes** (`l1-review.md`, "## Re-read of fixes"; SHIP AFTER FIXES).
-- **R1, must-fix: a subs failure must never fail an archive** (`d0fa13ae`). After `78e837f1`, a
- non-404 subs error, after its retry, made the archive `failed`. Its already-loaded videos then left
- the search and `/ask`, and the line said it "did not answer". This was reachable on a self-hosted
- archive with no subs manifest, where `serve` sends a 404 without CORS. C2's rule is restored: a
- subs query that still errors after its retry counts as settled, so the archive is `ready` without
- its live chat. The 404 → empty manifest and the one retry are kept. The e2e is inverted: a 500
- gives 2 subs requests, the chip reads `ready` with no Retry, Origin B's result is present, and
- there is no status line. The changelog sentence now says what a reader sees: the archive is
- searched without its live chat, and its chip reads ready.
-- **The copy** (`0fc63ed7`). The new draft, with its front-page link, is described under finding 1
- above. `copyWithLink` / `copyText` split and flatten the one constant. The e2e takes the link text
- from the constant and checks that it points to `/`.
-- **R2** (`ownDir` is safe) and **R4** (the non-progressive rule is confined to `/ask`) were verified
- by the re-read. No change.
-
-| sha | what |
-|---|---|
-| `d0fa13ae` | `hub:` a subs manifest that still fails after its retry never fails its archive (C2's settled rule); e2e inverted; changelog sentence |
-| `0fc63ed7` | `hub: NO_ARCHIVES_IN_SCOPE` draft "No archives selected. Choose some on the [hub's front page] to ask.", the phrase a link to `/` |
-| _this_ | `plans:` this re-read record |
-
-**Gates on `0fc63ed7`** (`l1-fix2.log`)
-- **tsc:** clean (`l1-tsc-9`, on this tree; `d0fa13ae` is a subset of it).
-- **Unit tests:** common **1,923**, editor unit **79**.
-- **Build:** export hub ok (26 s), `out/ask/index.html` present.
-- **e2e:**
- - `e2e:hub` **24 passed**, 51.1 s;
- - export full **204 passed**, 6.7 min, `sw.js` a link at the start;
- - `e2e:2origin` (`TWO_ORIGIN_REBUILD=1`, the seven composed entries links in place, no swap)
- **3 passed**, 36.3 s.
-- **The primary's eight `export/public` files** kept the size, mtime and md5 in the table above
- through all three runs (`l1-fix2-primary-before.txt` vs `-after.txt`, `diff` empty). The worktree
- again held its own `hub-sites.json` (2 B), `corpus.json`, `llms.txt`, `robots.txt` and `_headers`
- after 2origin.
-
-**Found and left (new lows, both need copy):**
-- **`/ask` waits forever on a hub with no archives.** When `hub-sites.json` is `[]` (a fresh
- self-hosted hub) or failed (`loadBuiltins` never retries), and the reader has added none, `/ask`
- reads "Loading transcripts…" forever. The fix is a "built-ins loaded" flag from `siteRegistry.ts`
- plus a blocked line for "this hub has no archives", whose copy goes to the operator. The production
- hub (five members) never reaches this state online.
-- **Show a member's missing live chat.** A subs manifest that settled in error leaves its archive
- `ready` with no sign that its live chat is missing. A chip note with a subs-only Retry would show
- it.
-
-### Integration (S4 + L1 + L2), as merged (2026-09-26)
-
-The operator asked for S4, L1 and L2 on `main` now, before the brand rollout, and will re-cut the
-editor and export release notes before deploying. Each slice was reviewed to SHIP on its own branch;
-they had never run together. The parent merged them in the planned order, and this pass gated the
-combined tree, wrote the records and updated the runbook. Worktree `/home/user/Projects/brand-found-line`,
-branch `brand/found-line` fast-forwarded to `main` `5c0a6ef9`, port block #1. **No code changed at
-integration**: every gate below ran on `5c0a6ef9`, and the commits after it are `plans:` only. During
-the pass `main` gained `4ac32a2e` (`plans/mcp-fetch-clip.md`, plans-only), and the integration commits
-were rebased onto it so `main` can fast-forward.
-
-| merge | branch → tip | review | on `main` |
-|---|---|---|---|
-| **S4** Archilyzer Media | `brand/media` → `333d2826` | SHIP AFTER FIXES → re-read SHIP | `dcb04f61` |
-| **L2** runner lows | `r10/runner-lows` → `14e96739` | SHIP AFTER FIXES → re-read fix `52bb00ef` | `41ddc382` |
-| **L1** hub lows | `r10/hub-lows` → `b6b47ec1` | SHIP AFTER FIXES, twice (re-read `d0fa13ae`, `0fc63ed7`) | `5c0a6ef9` |
-
-**Conflicts resolved at merge** (`git show --remerge-diff`): `plans/release-10.md` in all three (the
-record sections; every section kept, S4's line, then L2's record, then L1's), and one
-`editor/CHANGELOG.md` `[Unreleased]` join in L2's merge (S4's bullet and L2's four in the one new
-section). No code file conflicted.
-
-**Changelogs, checked as one set.** `editor/CHANGELOG.md` and `export/CHANGELOG.md` each have exactly
-one `[Unreleased]`, and everything from `[0.9.0]` down is byte-identical to the 0.9.0 cut
-(`31798769`; md5 of the released part `aeb7fd45…` editor, `ae97cb39…` export). The editor's five
-bullets (S4's umtool brand; L2's soft block, boot wait, `cancelReason`, safeRevalidate count) and
-export's three (L1's order and colour, `/ask` scope, subs) neither repeat nor contradict each other
-or the code as merged (the subs bullet states the final rule: a failure after its one retry leaves
-the archive searched without its live chat). No rewrite was needed. `homepage/CHANGELOG.md` is
-unchanged by all three.
-
-**Gates**, all from the worktree root on `5c0a6ef9` (`$T/i10-gates.log`, `$T/i10-e2e.log`).
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`): clean, 0 errors, 80 s.
-- **Unit and script tests:**
- - common **1,954/1,954** (1,913 + S4's 10 + L1's 10 + L2's 21), 59 s; the glyph-parity test ran,
- not skipped (fontTools 4.65.0 installed);
- - editor unit **85/85** (79 + L2's 6);
- - `test:scripts` **173 passed + 1 skip of 174** (162 + S4's 11 `brand.test.mjs`; the report-to-video
- tests are in this script; the skip is the `LIVE=1` network test);
- - mcp **219/219**;
- - `file-schemas-docs.ts --check` clean.
-- **Builds**, all ok, `export/public` seeded per path from the primary (links, no copies), `homepage/public`
- copied (60 MB):
- - editor 64 s (`BUILD_ID` `OjVWgLuZA1ucPntDKDx8C`);
- - export site 41 s: `<html … data-accent="signal">`, theme-color `#f3f6f7` / `#0c0a08`;
- - export hub 44 s: `… dark" data-base="dark" data-accent="signal"`, `out/ask/index.html` present;
- - homepage 20 s: `dark data-base="dark" data-accent="signal"`;
- - umtool 29 s (`pnpm --filter umtool run build`, `BUILD_ID` `BktSP58PkTab_aLIBJ1Vc`).
- - Every export/homepage build: `out/icons` = the seven files; PNG magic `89504e470d0a1a0a` and IHDR
- 180/192/32/512/512 (apple-touch, 192, 32, 512, maskable-512); `favicon.ico` `00 00 01 00 03 00`
- (1,804 B site, 1,832 B hub/homepage); the site's `icon.svg` lit Signal `#5fa8a0` on `#0c0a08`, the
- hub's and homepage's the parent mark `#151b20 #3f4c56 #e7edf1`.
-- **e2e**, one detached sequence (13:04 → 14:19), every run through the machine-wide queue:
-
- | suite | passed | failed | skipped | time |
- |---|---|---|---|---|
- | export full | **204** | 0 | 0 | 9.7 min |
- | `e2e:hub` | **24** | 0 | 0 | 1.1 min |
- | `e2e:2origin` (`TWO_ORIGIN_REBUILD=1`, links in place, no swap) | **3** | 0 | 0 | 1.4 min (2.2 min with `build:hub`) |
- | homepage full | **27** | 0 | 0 | 49.7 s |
- | umtool full (`SONG_DIR=~/reports/quartering-uh-song/data`) | **175** | 2 | 45 | 5.8 min |
- | **editor full** (`pnpm e2e`, 652 tests) | **634** | 6 | 12 | 54.6 min |
-
- The 45 umtool skips are the song-data capabilities this machine lacks (FACTS "The umtool suite skips
- instead of going red…"); S4's full run had the same 175 / 2 / 45.
-- **Failures, classified** (each re-run alone ×3: umtool `$T/i10-rerun.log`, editor `$T/i10-rerun2.log`):
- - **umtool `mix.spec.ts:166` and `:201`: known flake, not the integration.** The pair FACTS records
- as failing in every full umtool run on `main` (`FACTS.md:5013`, "`mix.spec.ts` IS
- ORDER-DEPENDENT"): an earlier spec leaves a clip window in the fixture's
- `channels/testchan/data/vid1/clips/`, and the row links to it (`…/clips/0.00-14.00.mp4`) instead of
- `/out/clips-raw/vid1_0.00-9.00.mp4`. S4's full run failed on exactly this pair. Alone,
- `--repeat-each 3`: **6 passed**, 24.4 s; the whole `mix.spec.ts` alone: **12 passed**, 23.0 s.
- None of the three slices touches `umtool/app/mix`, `umtool/lib/projects/report.mjs`, `mix.spec.ts` or the fixture: in umtool's app
- and lib, S4 changed only `bin/umtool.mjs` (`--brand`), `components/NewProjectMenu.tsx`,
- `lib/projects/{kinds,scaffold}.mjs`, `scaffold.ts` and `lib/tools.mjs`'s doctor label (`git diff
- --stat 386ac995 5c0a6ef9 -- umtool/app umtool/lib umtool/components umtool/bin`).
- - **Editor: six failures, all flakes under machine load; none is the integration.** Each alone,
- `--repeat-each 3`, straight after the suite (`$T/i10-e2e-editor-x3.log`): **18 passed, 0 failed,
- 1.8 min**. The suite ran while the live :3001 editor was busy with its own auto-queue work (load
- average 10–13 on 8 cores; 7.4 during the re-runs), and took 54.6 min against S3's 38.2. The six:
- - `queues.spec.ts:144` (281 ms): `EEXIST: file already exists, mkdir
- '…/test-transcripts/channels/slow-b'` in the fixture setup, before the test touched the page.
- This is the fixture-reset race S3 met in `pipeline.spec.ts:164` and L2 in `channel-work.spec.ts:208`.
- - `pulse.spec.ts:18` (3.6 s): the idle `/api/pulse` averaged 499.2 ms a call against its 250 ms
- tripwire. The spec calls that budget "a tripwire … not a benchmark, and it runs on a shared
- machine". The idle path (in-memory state plus two `stat`s) is untouched by all three slices; the
- one `listJobs` change adds a field only to cancelled metas, and pulse does not list jobs.
- - `sync-deep.spec.ts:256` (ENOENT reading `viddeleted1/availability.json`) and `:442`
- (`lastFullSweepAt` undefined). Both read something the sync writes AFTER the `lastSyncedAt`
- stamp their `runSync` helper waits on: `runYtdlp.ts:1853` `touchLastSync`, then `:1858`
- `touchLastFullSweep` and `:1859` `safeBackfillAvailability`. That is a pre-existing race in the
- spec's wait, which load widened. The merges change `runYtdlp.ts` by one comment (`:904-909`) and
- `backfillAvailability.ts` not at all.
- - `jobs-batch-tasks-drain.spec.ts:54` (24.6 s): the task row's elapsed timer read `0:06` and did
- not pass it within 10 s. The fake whisper's slow task lives 7 s (`fake-whisper.mjs`, ten 700 ms
- lines), so a bar that renders late under load leaves about a second before the task ends. L2's
- `JobRow.tsx` change draws only on `cancelled` rows (`cancelReasonOf`), and the running task's
- timer (`JobProgressBars.tsx`) is unchanged.
- - `diarization.spec.ts:185` (1.3 min): the channel snapshot's `transcribedWithAudio` bucket read
- `[]` for the whole 60 s poll (expected `["vidA"]`). The same poll failed in an earlier full run
- (the storage-locations slice 4 worktree, job `4cc6ed24`: `["vidC"]`, left by the previous test's
- batch) and passed on its re-run. `channelSnapshot.ts` is untouched by the merges, and the file's
- other four tests passed, including the backfill test that drives the same cleanup.
-- **The `export/public` links stayed in place, and the primary was never written.** The rules' per-path
- seed (`$T/i10-seed-public.sh`): every gitignored entry of the primary's `export/public` linked into
- the worktree, and no `sw.js` or compose-output copies (the workarounds L1 retired, FACTS updated).
- - The primary's `export/public` had changed since L1's proof: the live editor's Jeralyzer
- build-deploy (below) re-composed it at 11:03 as a SITE, so it holds `site.json` and no hub `sw.js`,
- `hub-sites.json` or `hub-summary.json`. Of L1's eight files, five exist, plus
- `site.json`. The worktree's stale links to the three absent ones were dropped before the seed, so
- none dangled (the rules' check before every export build).
- - With no primary `sw.js` to link, the worktree's `sw.js` was linked to a sentinel in the job's
- scratch (`$T/i10-sentinel/sw.js`), so a write-through by the export config would change it.
- - The snapshot (`$T/i10-snap.sh`): every entry of the primary's `export/public` (614 entries, 543
- files, 2.9 GB) by type, size and mtime, and the md5 of every file, plus the sentinel's md5. It was
- taken before the gates, after them, before the e2e, after the export run, after `e2e:hub`, after
- `e2e:2origin`, and after the editor suite: **identical every time** (tree md5 `2f7f3bb9be9d`,
- content md5 `e3661fb98468`, sentinel `fc1bd566…`), and the primary still had no `sw.js`,
- `hub-sites.json` or `hub-summary.json`. The five named files throughout:
-
- | file | size | mtime (2026-09-26) | md5 |
- |---|---|---|---|
- | `corpus.json` | 13,702 | 11:03:23.547761504 | `f89e603b…` |
- | `llms.txt` | 4,245 | 11:03:23.574761030 | `5b6be721…` |
- | `robots.txt` | 125 | 11:03:23.574761030 | `17b7cc13…` |
- | `sitemap.xml` | 352 | 11:03:23.575761012 | `4bd0cd6b…` |
- | `_headers` | 736 | 11:03:23.513762100 | `302b4216…` |
- | `site.json` | 5,858 | 11:03:23.541761609 | `9394b81b…` |
- | `sw.js`, `hub-sites.json`, `hub-summary.json` | absent | | |
-
- - **What the runs did in the worktree:** the export suite replaced the `sw.js` LINK with a plain
- 11,172 B file whose md5 equals `service-worker/site-sw.js` (`15b4689b…`), and the sentinel kept its
- md5 — `playwright.config.ts:54`'s `rmSync` removed the link. `e2e:2origin`'s `build:hub` replaced
- the `corpus.json`, `llms.txt`, `robots.txt` and `_headers` LINKS with the worktree's own plain
- files (468 / 494 / 76 / 459 B), wrote a plain `hub-sites.json` (2 B, `[]`) where none existed,
- removed the `site.json` link and left `sitemap.xml` (which it does not write) a link. The next
- seed relinked them for the homepage and later suites.
-- **The live processes were never touched:** :3001 still serves `BUILD_ID` `P0VMdKX7gbdsaiS5GvorF` and
- :3050 `a9YAe_dwhuM6DiCPzIwMD`; nothing was deployed, pushed, restarted or written under
- `transcripts/`.
-- Numbers tools: none.
-
-**Found during the pass.**
-- **Jeralyzer is already on the brand, in Signal.** Job `01M3F36N7SCKGC5JV27EBDFYPN` (`build-deploy`,
- queue `deploy`, no agent recorded) ran on the live :3001 editor 2026-09-26 10:51–11:06. It built
- Jeralyzer from the primary's working tree, then `main` @ `386ac995` (the brand plus the 0.9.0 cut,
- before S4/L1/L2), and deployed it to production (`https://35593886.jeralyzer.pages.dev`). The old
- editor runs the on-disk build scripts, so the site got the brand, but its `site.json` has no
- `accent` (the pre-brand editor cannot set one), so it wears Signal. `jeralyzer.pages.dev` serves
- `data-accent="signal"`; the other four sites, the hub and the homepage are pre-brand. The runbook
- now says so. The sites step (the runbook's 4, "Rollout" 5 below) rebuilds Jeralyzer in Brass,
- and its readers' stored themes have already migrated.
-- **umtool is not "untouched" any more.** The live :3050 already spawns `main`'s report-to-video
- scripts from disk. That is safe (a render that does not opt in is byte-identical), and the form's
- brand choice needs a rebuild. The runbook adds an optional step for it (`r10-umtool.sh`).
-
-**Runbook** (`~/reports/release-10/make-runbook.py`, regenerated `RUNBOOK.html`):
-- `FINAL` is this pass's tip, and every script's ancestor guard checks it.
-- It says what the rollout contains: the brand, then S4, L1 and L2, in plain words.
-- Step 0 is a **re-cut**: both `[Unreleased]` sections are shown, since export's is public. The editor
- cut, the hand commit of both files and the untracked-file caveat are unchanged.
-- The new **step 1b** is an OPTIONAL `r10-umtool.sh`: fail-stop, with the ancestor guard, and it
- refuses while a umtool job runs. It builds into the live `umtool/.next` and never restarts after a
- failed build. Then one restart on :3050 and a smoke: `/` and `/api/jobs` 200, the form offers
- "Archilyzer Media", no `⨯` in the start log. `r10-rollback-umtool.sh` is its rollback twin.
-- It adds what readers and the operator will notice.
-- The YouTube assets point to `~/reports/archilyzer-media/brand/INDEX.html`.
-- It adds these gates and the link-safety proof.
-- The copy rulings and new lows are listed.
-- `bash -n` and `sh -n` pass on all nine scripts. No script was run.
-
-| sha | what |
-|---|---|
-| `9e3047e3` | `plans:` FACTS: the two worktree workarounds superseded (L1), and the release 10 facts for S4, L1 and L2 |
-| _this_ | `plans:` this record, STATE ("Merged to main (2026-09-26), NOT rolled out"), the Rollout steps |
-
-### Slice M, as shipped — fetch_clip (2026-09-26)
-
-Branch `mcp/fetch-clip` off `main` `4ac32a2e`, worktree `/home/user/Projects/mcp-fetch-clip`, one
-Opus implementer. The plan is [`mcp-fetch-clip.md`](mcp-fetch-clip.md), §1–§5 and its Amendment
-(`full: true` exposed). The MCP server gains ONE tool, `fetch_clip`, which asks the local editor for
-the media behind a cited moment through its existing `POST /api/media/fetch-window`. So an agent
-following `/ask` or `/sweep` no longer has to shell out to yt-dlp (unpaced, no cookies, bytes
-outside the corpus) or stop. The guidance now makes the tool the way, and `yt-dlp
---download-sections` only the no-editor fallback. Nothing in `common/`, `editor/`, `export/`,
-`scripts/` or `umtool/` changed; no settings, site or channel key; nothing on disk.
-
-**The client** (`mcp/src/fetchClip.ts`, pure; `env`, `fetch`, `sleep` and `now` injected, no MCP
-imports).
-- `parseSeconds`: a number, `ss`, `mm:ss` (minutes may pass 59) or `h:mm:ss`.
-- `planWindow`: umtool's arithmetic, `from = max(0, start-pad)` and `to = end+pad`, each
- `.toFixed(2)`; the 900 s cap (`MAX_CLIP_WINDOW_SECONDS`, imported) applies AFTER padding.
-- `validateFetchClipArgs`: a `job` alone is a whole request and every other argument is ignored;
- `full: true` ignores `start`/`end`/`pad` (not required, not validated); `reason` is required in
- both modes; `wait_seconds` is clamped to [0, 300], default 90.
-- `fetchClip`: POST (unless resuming), then poll every 1 s via `deps.sleep` until the job is
- terminal or `deps.now()` passes the deadline. A resume polls before it sleeps. The body is
- `{channelSlug, videoId, webpageUrl?, from, to, pad, requestedBy: "mcp", manifest, reason}`, the
- reason cut to 400; in full mode exactly `{channelSlug, videoId, full: true, requestedBy, manifest,
- reason}`.
-- `renderFetchClip`: the plan's texts, verbatim where the plan gave them.
-- HTTP only: the MCP process writes nothing.
-
-**The tool** (`mcp/src/server.ts`): the schema after `get_video_metadata`, `required: []`,
-`additionalProperties: false`. `createServer(source, {fetchClipDeps})` defaults to `process.env`,
-`globalThis.fetch`, a `setTimeout` sleep and `Date.now`. `source` resolves first and `withCorpus`
-adds the trailer, as for every tool. `handleFetchClip`:
-- **no editor configured** is said before argument validation and before any corpus read;
-- `findVideo(source, video, channel)`;
-- the id sent is `extractVideoId(record.webpageUrl) ?? video` (the editor's own directory naming —
- a Rumble embed id `vxe1ae` becomes `v1007ay`), and the record's `webpageUrl` rides along in
- window mode;
-- a video `source` does not hold goes through as cited, with the plan's `note:` prefix.
-
-**The plans** (`mcp/src/instructions.ts`): one shared `clipStep`, after "Answer with citations" in
-ask and before **Finish** in the sweep. It carries the plan's sentence with the amendment's
-clause. `wait_seconds` and `full` are not backticked, and `NOT_TOOLS` is unchanged.
-
-**Docs.**
-- `README.md`: both `claude mcp add` blocks carry the two optional `--env` lines. In "Clips and
- video", step 3 is `fetch_clip` (window → `clips/`, `full: true` → the saved-video store), the
- editor path no longer claims `out/clips-raw`, and yt-dlp is the no-editor fallback.
-- `mcp/README.md`: the one exception to "writes nothing", the tool row, and "Still read-only"
- now says the editor writes.
-- `AGENTS.md`: the env lines, and the clips loop through `fetch_clip`.
-- `grep -n 'download-sections' README.md AGENTS.md mcp/README.md` gives two lines, both in
- no-editor fallback sentences (`AGENTS.md:87`, `README.md:366`).
-
-**Where the texts depart from, or fill in, the plan** (for the reviewer):
-- **A 503 is a token problem only when its error says "disabled".** The plan put every 401/503 on
- the token text. But `fetchWindowAction` answers 503 for an unreachable-media refusal
- (`videoActions.ts`, the `!res.ok` after `runManagedFunction`), and `fetchFullSourceAction` for
- any `archiveSourceVideo` error that is not low disk. Under the token text, "plug the drive in"
- would have read as "fix your token". Such a 503 goes through the generic `The editor refused
- (HTTP 503): <error verbatim>`.
-- **The channel sent is the record's own `ch.slug` when the video is found** (the plan: the
- `channel` argument). A citation that spells the channel by name or in another case still reaches
- the right directory. When the video is not found, the argument goes as given.
-- Texts the plan left open:
- - `Already on disk — the exact window: <from>–<to>.`
- - `requested by <x>` is a footer line, shown for a cached whole recording too (`SavedVideoOrigin`
- carries it).
- - The footer names the window's real sidecar (`7.00-23.00.json`).
- - A missing start/end reads `fetch_clip: start is required (seconds, mm:ss or h:mm:ss) — or pass
- full: true for the whole recording`.
- - A bad pad reads `fetch_clip: pad "<p>" must be a finite number of seconds, 0 or more`.
- - A done window job with no file uses the amendment's full-mode "finished but named no file"
- text.
- - A poll 401, or a disabled 503, adds the token sentence.
- - A resume knows no channel or video, so its "Fetched …" line omits "of <channel>/<video>", and
- window or full is read off the poll's answer (a window's carries `from`/`to`).
- - A 409 is `isError`; only the expired wait (`Still <status> …`) is not.
-
-| sha | what |
-|---|---|
-| `55f81128` | `mcp: fetchClip` — the pure client and its texts; `fetchClip.test.ts` (30) |
-| `2cd35fbf` | `mcp: fetch_clip` tool — schema, `createServer(…, {fetchClipDeps})`, `handleFetchClip` (Rumble mapping, not-found note); `EXPECTED_TOOLS` +1; `fetchClip.tool.test.ts` (9) |
-| `345bf26d` | `mcp:` the ask and sweep plans' `clipStep`; `instructions.test.ts` +1 |
-| `a0326dfd` | `docs:` README (both blocks, "Clips and video"), `mcp/README.md`, `AGENTS.md` |
-| _this_ | `plans:` this record; the editor `[Unreleased]` bullet |
-
-**Gates**, all from the worktree root.
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) clean on the full tree
- before the first commit (`m-gate1.log`). The mcp package's `tsc --noEmit` is also clean on each of
- the three code commits checked out alone (`m-tsc-per-commit.log`). The docs commit has no code.
-- **mcp 259/259** (219 + 40: `fetchClip.test.ts` 30, `fetchClip.tool.test.ts` 9,
- `instructions.test.ts` +1; `protocol.test.ts` still 8 tests, its list now 15 names), 23 s.
-- **`test:scripts` 173 + 1 skip of 174**; **common 1,954/1,954** (`m-gate2.log`). Both are `main`'s
- counts: the prompt's 162 + 1 and 1,845 predate L1, L2 and S4. This slice changes neither
- (`git diff --stat 4ac32a2e a0326dfd -- common scripts umtool editor export homepage` is empty;
- the `plans:` commit adds only the `editor/CHANGELOG.md` line).
-- **Builds and e2e: none, by design.** No editor, export, homepage or umtool code changed, and no
- e2e spec names an MCP tool: `grep -rln 'fetch_clip\|get_video_metadata\|ask_plan' editor/e2e
- export/e2e homepage/e2e umtool/e2e` is empty.
-- **The tests bite.** With the mapping line reverted to pass the cited id, 2 of the 9 tool tests
- fail: the Rumble window and the full-mode Rumble. The timeout test runs its 3 s wait (three
- 1 s polls) on a fake clock that advances by each `sleep`, so no real timer is involved.
-- **Numbers tools: none.** Nothing here was run against the live :3001 editor. The live proofs are
- rollout step 1.
-
-**Found and left.**
-- **`mcp/bench/smoke.ts --clip` (optional) was not done.** The rollout's live proof is an in-memory
- client script, as the plan says. A `--clip` smoke would need the stdio transport to pass
- `WORKER_TOKEN` through: `StdioClientTransport` gives the child only `getDefaultEnvironment()`
- unless `env` is set.
-- **Both plan heads still say "The MCP is read-only".** That is true of the process. The new step
- sits beside it and says the editor fetches.
-- **`mcp/README.md`'s own "Add to Claude Code" and `mcp.json` examples** do not carry the two env
- lines. The plan named only README.md's two blocks and AGENTS.md's; the tool row names both
- variables.
-- **The plan's known limitations stand**, plus one the review found (S2, now documented):
- - The editor fetches only for a channel it already archives: a fresh editor behind an MCP
- pointed at a public site answers 404 `Channel "<slug>" not found` on every clip.
- - A video absent from `source` is passed through as cited, with the note.
- - Full mode sends no `webpageUrl`, so a video the editor has never seen gets the editor's 404
- (with the added sentence), where a window can still fetch it by URL.
- - A public-only setup gets the no-editor error.
-- **FACTS and STATE are not edited** (shared files): the plan's rollout step 4 adds "`fetch_clip`
- is the only MCP tool that causes a write, and the editor does it".
-- **Registration is owed by the operator** (rollout step 2): this machine's `archilyzer` entry has
- `"env": {}`, so until it is re-registered `fetch_clip` answers "no editor configured".
-- ~~N2: the `queued` text ends "the next ask finds it cached"~~: taken by the plan owner with the
- re-read's R2, below.
-- **Review nits not taken** (`m-review.md`):
- - N3: a poll-phase disabled 503 gets the token sentence but not "the endpoint is off". Cosmetic.
- - N4: the sweep's step says "(or a report needs one)", so extractors could fetch per finding.
- Plan text, left for the operator.
- - N5 (pre-existing): `AGENTS.md`'s "What it needs: **yt-dlp**" line for umtool's report-to-video
- is stale, because umtool asks the editor by default.
-- **A request whose body stalls after its headers** reads as `{}`. `readJson` swallows the
- aborted body, so a POST reads as `The editor refused (HTTP 200): no reason given` and a poll
- keeps polling until the wait ends. Rare; the timeout still bounds it.
-
-**Review fixes** (review SHIP AFTER FIXES, `m-review.md`: no must-fix, four should-fix, all fixed;
-nit N1 taken).
-
-1. **S1: the job id survives an editor that stops answering mid-poll** (`868d4ab7`).
- - **The failure.** A network error while polling answered "Could not reach the editor" with no
- job id. The natural retry was the same call. With `full: true` that queues a second
- whole-recording download, because `fetchFullSourceAction` checks the saved-video pointer
- only when a request arrives.
- - **The fix.** The poll-phase outcome carries the `jobId`, and the text is `Could not reach the
- editor at <url> while polling job <jobId>: <message>. Is it running? Call fetch_clip again
- with job: "<jobId>" — do not repeat the original request, the fetch may still be running.`
-2. **S2: the docs say the editor must already archive the channel** (`d117e533`). The route answers
- 404 `Channel "<slug>" not found` for a channel with no dir under the editor's `transcripts/`, so
- pointing the MCP at a public site with a fresh editor gets a 404 on every clip. One sentence
- each in README "Clips and video" (whose yt-dlp fallback now also covers an editor that does not
- archive the channel), AGENTS.md's clips loop and the `mcp/README.md` row. The tool description
- says it too. The `download-sections` grep still gives two lines, both fallback sentences
- (`AGENTS.md:87`, `README.md:369`).
-3. **S3 + N1: every request is bounded, and a failure says why** (`0777bfd1`).
- - Each request, the POST and every poll, carries its own `AbortSignal.timeout(REQUEST_TIMEOUT_MS
- = 15 s)`. Before, a POST that stats a hung mount, or an editor whose event loop had stalled,
- held the call until undici's 300 s headers timeout. Now `wait_seconds` is the bound, give or
- take one request (at most POST 15 s + the wait + one poll of 15 s).
- - A timeout reads `no answer within 15 s (request timed out)`. A timed-out POST adds `It may
- have queued the fetch anyway: check the editor's /jobs page before asking again.`
- - Node's bare `fetch failed` carries its cause, e.g. `fetch failed (connect ECONNREFUSED
- 127.0.0.1:3001)`.
- - `requestTimeoutMs` is injectable in `FetchClipDeps` for the tests only.
-4. **S4: the 60 s client timeout** (`8cf50cf6`).
- - (a) The tool description and the `mcp/README.md` row say that a client with a 60 s default
- request timeout must raise it or pass `wait_seconds` ≤ 50. The fetch continues on the editor
- either way; resume it with `job` (wording corrected in the re-read, R2 below).
- - (b) **Progress notifications: done, because it was cheap.** The `tools/call` handler now takes
- `ctx`. When `ctx.mcpReq._meta.progressToken` is set, `progressNotifier` turns `fetchClip`'s new
- `onPoll` hook into one `notifications/progress` per poll that finds the job still waiting
- (`progress` = the poll count, `message` `editor job <id>: <status>, <n>s waited`, no `total`),
- sent with `ctx.mcpReq.notify`. A client's `resetTimeoutOnProgress` then keeps the call alive.
- A failing notify never fails the fetch, and with no token none is sent.
- - Claude Code sets its own, longer tool timeout. **The rollout's in-memory proof script must
- still pass `{ timeout: 330_000 }`** (or `onprogress` with `resetTimeoutOnProgress`) to
- `callTool`.
-
-| sha | what |
-|---|---|
-| `868d4ab7` | S1: the poll-phase `unreachable` keeps `jobId`; the resume text; `fetchClip.test.ts` +1 (POST 202, poll throws, then the named resume polls once and posts nothing) |
-| `d117e533` | S2: README, AGENTS.md, mcp/README: the editor must already archive the channel |
-| `0777bfd1` | S3 + N1: `AbortSignal.timeout(15 s)` per request, `describeFetchError` (cause, timeout), the POST-timeout `/jobs` sentence; `fetchClip.test.ts` +6 (a signal per request, the cause, a fake `TimeoutError`, and over a real socket: a POST never answered, a poll never answered → the job id, a refused connection) |
-| `8cf50cf6` | S4: `onPoll` → `notifications/progress`; the 60 s clause in the tool description and the README row; `fetchClip.test.ts` +1, `fetchClip.tool.test.ts` +1 (in-memory progress), `protocol.test.ts` +1 (the real process on the modern era with a stub editor) |
-| _this_ | `plans:` these review fixes; the changelog bullet names the channel requirement, the progress and the 60 s clause |
-
-**Gates on `8cf50cf6`** (`m-gate3.log`):
-- **tsc:**
- - The whole workspace is clean.
- - The mcp `tsc --noEmit` is clean on `868d4ab7` and `0777bfd1`, each checked out alone.
- - `d117e533` is docs only.
-- **mcp 269/269** (259 + 10), 17 s.
-- common and `test:scripts` were not re-run: nothing outside `mcp/` and the three docs changed.
-- **The new tests bite:**
- - Without the timeout signal, the signal test fails, and the real never-answering POST hangs
- past an 8 s test timeout.
- - With the progress wiring disabled, the in-memory progress test fails.
-- **The modern era carries progress.** The protocol test drives the real `src/index.ts` over stdio,
- negotiated `modern`, with `ARCHILYZER_EDITOR_URL` and `WORKER_TOKEN` passed through the
- transport's `env`. The stub editor sees three polls, each with `Bearer tok-proto`, and the client
- gets progress `[1, 2]`.
-
-**Re-read of the fixes** (`m-review.md`: SHIP). The plan owner took R1 and R2 in one commit.
-- **R2: the queued text no longer invites a repeat.** The editor does not dedupe a running
- whole-recording job (`archiveSourceVideo` → `runManagedFunction` has no running-job check), so
- "the next ask finds it cached" held only once the job had finished. A repeated `full: true`
- while it ran queued a second download.
- - The queued text now reads `Still <status> on the editor (job <jobId>, waited <n>s). Call
- fetch_clip again with job: "<jobId>" to keep waiting — never repeat the original request while
- it runs (that would queue a second fetch). Nothing is lost: the fetch continues on the editor,
- and once it has finished the same request finds it cached.`
- - The two 60 s clauses (tool description, `mcp/README.md` row) now end: "the fetch continues on
- the editor either way; resume it with job, and once it has finished the same request finds it
- cached".
- - The instructions step already said "call it again with the job it names" and is unchanged.
- - The plan's queued text in `mcp-fetch-clip.md` is amended to match, with the reason.
-- **R1:** the three real-socket tests carry `{ timeout: 10_000 }`, so a timeout regression fails in
- 10 s instead of hanging.
-
-| sha | what |
-|---|---|
-| _this_ | R2's queued text and the 60 s clauses; the test that asserts the queued text; R1's test timeouts; the plan's queued text; this paragraph and N2 struck above |
-
-**Gates** (`m-gate4.log`): tsc clean (whole workspace); **mcp 269/269**, 16 s.
-
-### Slice N, as shipped — the whole-recording fetch downloads anyway; metadata history (2026-09-26)
-
-Branch `editor/full-fetch-media` off `main` `555bc454`, worktree
-`/home/user/Projects/editor-full-fetch-media`, one Opus implementer. The plan is
-[`full-fetch-forces-media.md`](full-fetch-forces-media.md) (Decisions 1–6, Implementation 1–8). It
-answers the operator's ask of 2026-09-26: the whole-recording fetch downloads whatever is on disk,
-and every rewrite of the metadata is kept so changes can be detected. No settings, site or channel
-key; no new job kind; no new directory.
-
-**`forceMedia`** (`common/ytdlp/downloadOneManaged.ts`).
-- One option on `ManagedDownloadOpts` (:154): the caller wants the media; a transcript or captions
- on disk are not a reason to skip. `archiveSourceVideo` (`videoActions.ts:310`, so both "Persist
- source video" and `fetchFullSourceAction`) and `persistKept` (`persistKept.ts:137`) set it. The
- download lane, re-acquire and import do not.
-- **Attempt 3** (:1285-): `forced = !noSubsFallback && forceMedia` (:1304) — a video with no
- transcript and no captions takes today's path whoever asked. The pass then runs when the primary
- succeeded, and logs one line first: `forceMedia: downloading the source although a transcript is
- on disk` (or `… although captions exist`).
-- **`keepTranscript = forced && hasTranscript`** (:1314) makes it persist-only:
- - `--no-write-subs --no-write-auto-subs` after the channel's own args (:1368), so a channel whose
- `ytdlpExtraArgs` carry `--write-auto-subs` cannot overwrite the transcript (the chat-only
- pass's last-occurrence rule);
- - `finalizeAppExtraction` gains `extractAudio?: boolean` (:253); `false` moves the container into
- the store and extracts nothing, logging `Persist only: a transcript is on disk, so no
- audio.<fmt> is extracted from <source>.`;
- - no inline whisper, no short-audio probe (it would probe audio the pass never made);
- `fellBackToTranscribe` stays unset and the status stays the subtitle pass's (`ok`); the attempt
- is still recorded as `no-subs-fallback`, n: 3.
-- With `forceMedia` and NO transcript (captions listed, none fetched), the pass is today's fallback
- in full: download, extract, transcribe inline if configured, persist.
-- A caller that does not set `forceMedia` gets byte-for-byte today's behaviour: the same gate, log,
- args and finalize. Every existing e2e arg-ordering assertion passed unchanged.
-
-**Metadata history.**
-- `common/lib/metadataHistory.ts` (pure; `node:crypto` only): the key sets exactly as the plan
- lists them; `normalizeForDiff`, `diffMetadata`, `buildMetadataHistoryEntry` (null when the sha is
- unchanged), `appendMetadataHistoryEntry` (cap 200, oldest dropped), the 16 KB guard
- (`guardStoredValue` → `{ sha256, bytes }`, `isValueDigest`), `coerceMetadataHistory` (drops a torn
- entry instead of failing the file). Volatile values are compared on canonical (key-sorted) JSON.
-- `common/lib/metadataHistory-server.ts`: `sidecar("metadata.history.json", …)` (indented, trailing
- newline); `snapshotMetadata`; `recordMetadataRewrite`, a read-modify-write under
- `withJsonFileLock`; and `withMetadataHistory(videoDir, {by, requestedBy, onLog}, run)`. That
- snapshots before `run()` and records in a `finally`, so a failed run is recorded too. It returns
- or rethrows `run`'s own result, and logs and swallows a failure to record.
-- Wrapped, with `requestedBy` = `persistOrigin.requestedBy` where there is one:
- - the prefetch spawn and its auth retry (`by: "prefetch"`, :700);
- - the audio-check primary when the canonical id is known (`by: "audio-check"`, :1088);
- - `downloadOneAudio` when its output dir is pinned (`by: "download-one"`,
- `runYtdlp.ts:1395`).
- `dataDirIdForUrl` (`runYtdlp.ts:321`) is the id test `outputArgsForUrl` already made, now named.
-- **Not on `discardPrefetchDir`'s allow-list**, said at `PREFETCH_OWN_FILES` (:407) and in the
- server module's head.
-- `SIDECAR_FILENAMES`' enumeration test: ten names.
-
-**The surface.**
-- `common/views/metadataHistoryView.ts` (pure, the clock as `nowMs`): `metadataHistoryView(history,
- nowMs)` → `{count, line, entries}` newest first, or null.
- - The line is `Metadata rewritten N× · last <5m ago> by <by>: <summary>`.
- - Values are cut at 300 characters, with the full text kept for `title=`.
- - `atLabel` is fixed UTC.
-- `page.tsx` reads the sidecar once beside `availability.json`. The new server component
- `components/MetadataHistoryDetails.tsx` draws it in the page header, under the Description:
- a `<details>` whose summary is the line, with each entry's keys as from → to and the volatile
- keys named. No client state and no control.
-
-**Where the code departs from, or fills in, the plan** (for the reviewer):
-- **The "Persist source video" button had to be un-gated.** `SourceVideoSection` returned
- "Source-video persistence applies to transcribe-handling channels only." for any other handling,
- so the plan's e2e 6(a) — click the button on a youtube-handling video — had no button to click.
- - The gate is gone.
- - A youtube channel gets its own description line: "…YouTube's subtitles are fetched again
- first, as on any re-download; a Whisper transcript is not touched, and no audio is extracted
- beside a transcript." (review M1: the first wording said the transcript was "kept", which a
- re-fetched VTT is not).
- - Labels, aria-labels and test ids are unchanged.
- - `videoChoreCards.ts`'s `shown` text is updated.
-- **`keepTranscript` with a plan that persists nothing fetches nothing.** The plan said "do not
- assume `plan.persist`". With a transcript the pass may extract no audio, so a plan that keeps no
- container leaves the download with no destination. It logs `forceMedia: a transcript is on disk
- and this download keeps no source video (<reason>); nothing to fetch.` and skips. Unreachable
- today: every `forceMedia` caller sets `keepSourceVideoOverride: true`.
-- **The summary names counters when nothing else moved:** `only counters (view_count, …)`.
- - "nothing meaningful (formats only)" is kept for an all-volatile entry;
- `unreadable metadata (no diff)` for a torn side.
- - Real rewrites nearly always move a counter, so without this the line would read "formats only"
- over a view count that changed.
-- **An unparseable side** records the rewrite (both fingerprints) with an empty diff and
- `unparseable: ["from"|"to"]`, rather than diffing against `{}` (which would list every key).
-- **A counter present on one side only** is `[null, x]` in `counters`, not in added/removed.
-- **The surface is in the header, not in a card.** There is no metadata card. The header is where
- the page shows the metadata, and a header `<details>` is visible without opening a collapsed
- card.
-- **README: nothing.** `grep -n "Persist source video" README.md` is empty. Its `full: true` line
- ("it needs a video the editor already knows") is still true.
-
-| sha | what |
-|---|---|
-| `92ae844c` | `common:` `metadataHistory.ts` + `metadataHistory-server.ts`; `metadataHistory.test.ts` (13), `metadataHistory-server.test.ts` (5); the sidecar enumeration test names ten |
-| `51166736` | `common:` `forceMedia` (attempt-3 gate, the log line, the subs refusals, persist-only finalize); the three history wraps + `dataDirIdForUrl`; `archiveSourceVideo` and `persistKept` pass it; `forceMedia.test.ts` (6) |
-| `1877d3a5` | `editor:` `views/metadataHistoryView.ts` (+ test, 6), `MetadataHistoryDetails.tsx`, the page loader; the Source video card un-gated |
-| `92c26c73` | `e2e:` `persist-youtube-handling.spec.ts` (2), `fetch-window.spec.ts` +1, the fake's `.fake-ytdlp-metadata.json` knob |
-| `6adbd455` | `docs:` AGENTS.md, "Clips and report-to-video" |
-| `31eeece4` | `common:` the `PREFETCH_OWN_FILES` comment (comment only) |
-| _this_ | `plans:` this record; two `[Unreleased]` bullets; the FACTS amendment (slice M's "silent no-op" is fixed, with the VTT-overwrite fact) |
-
-**Gates**, all from the worktree root:
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) clean before every
- commit (`n-tsc1.log` … `n-tsc5.log`).
-- **common 1,984/1,984** (on `6adbd455`). That is 1,954 + 30: `metadataHistory` 13, `-server` 5, `forceMedia` 6,
- the view 6.
-- **editor unit 85/85.**
-- **`test:scripts` 173 + 1 skip of 174.**
-- **mcp 269/269**, unchanged (`n-gates1.log`).
-- **`pnpm --filter editor exec next build`** ok: compiled in 17.5 s, 50 s total (`n-build1.log`).
-- **e2e** (queued, detached, `export/public` links in place, no dangling links): **78 passed,
- 0 failed, 8.7 min** (`n-e2e1.log`), on `92c26c73` (the two commits after it are AGENTS.md and
- a comment). The specs:
- - the plan's: `saved-videos`, `fetch-window` and the new `persist-youtube-handling`;
- - the grep for `downloadOneManaged|Persist source video|persist-kept|redownload`: `import-video`
- and `incomplete-transcript` (plus `saved-videos`);
- - the paths this slice touched: `no-subs-fallback` (attempt 3), `video-page` (the header),
- `title-filter` and `chat-only` (the prefetch wrap beside `discardPrefetchDir`), `skip-live`
- (the prefetch), `audio-check-scenarios` (the audio-check wrap).
-- **The new tests bite.**
- - e2e: with `forceMedia: true` removed from `archiveSourceVideo` and `withMetadataHistory` made a
- pass-through (uncommitted), `persist-youtube-handling.spec.ts fetch-window.spec.ts` gave
- **6 passed, 3 failed, 1.3 min** (`n-bite1.log`), and the three failures are exactly the new
- tests:
- - the full fetch ends `done` with `file` undefined (slice M's live no-op, reproduced);
- - no `forceMedia:` line;
- - no `metadata.history.json`.
- - unit: with the attempt-3 gate forced off, 3 of the 6 `forceMedia.test.ts` fail; with
- `extractAudio: true`, 1 fails.
-- **Numbers tool: none**, as the plan says. Nothing was run against the live :3001 editor or the
- real corpus.
-
-**Found and left.**
-- **The primary subtitle pass rewrites a `transcript.<lang>.vtt`.**
- - This is not new: the decision keeps that pass "as today", and every re-download already does
- it. yt-dlp deletes and re-fetches an existing subtitle file unless `--no-overwrites` is passed
- (`YoutubeDL.existing_file`, `default_overwrite=True`; verified in the installed
- `yt-dlp-patched` 2026.08.19).
- - So the rollout's check "the transcript's mtime unchanged" on `teamrcn/dbnS-cBgStY` holds for a
- whisper `transcript.json`, not for a VTT. A VTT's bytes are what YouTube serves now.
- - What slice N guarantees is that the MEDIA pass writes no transcript. The new e2e asserts it on a
- `transcript.json`, with inline whisper on.
-- **A title-filter rejection now keeps a directory that has a history** (the plan's allow-list
- rule). This takes a dir left by an earlier pass that was not rejected (a failed download) and a
- filter that rejects it now. Real rewrites always differ (`epoch`), so such a dir gets a history
- and keeps its metadata stub.
-- **Two history entries per audio-checked download** (the prefetch, then the audio-check primary's
- own re-extraction), as the plan's wraps imply.
-- **No history for an unidentifiable URL** (the `%(id)s` dir is known only afterwards), nor for a
- rewrite by a pass the plan did not wrap: the subtitle primary and the fallback load the
- prefetched info json and write none, unless a channel's `ytdlpExtraArgs` carry
- `--write-info-json`.
-- **"Persist kept now" on a youtube-handling channel now downloads every kept video's source**
- (the plan's known limitation). `persistKept` still counts a returned-but-failed download as
- `persisted` (pre-existing).
-- **A forced download that fails on a video with a transcript marks the whole download failed**
- (review L2; a low for a later slice, not fixed here).
- - The `else` branch after the attempt-3 run (`downloadOneManaged.ts:1470-1472`) sets `status =
- "failed"` and `lastSucceeded = false` for a `keepTranscript` pass too.
- - So the video page shows "Download failed" on a video whose transcript is fine.
- - The whole-recording fetch job still ends `done` with no file, and the MCP says "finished but
- named no file".
- - yt-dlp's `source-media.*.part` (from `bestvideo*+bestaudio`, possibly several GB) can stay in
- `data/<id>/` until a later persist resumes it.
- - These are the same mechanics as today's no-subs fallback, now reachable on youtube channels.
- - The review's option: on a `keepTranscript` failure, keep the subtitle pass's status and record
- only the failed attempt.
-
-**Review fixes** (review SHIP AFTER FIXES, `n-review.md`: one medium, three lows; the three
-questions ruled as asked — the card un-gated, no `--no-overwrites`, the history file kept off
-`PREFETCH_OWN_FILES`).
-
-1. **M1: nothing the operator reads says the transcript is "kept"** (`3067f8af`). On a
- youtube-handling channel the subtitle pass deletes and re-fetches `transcript.<lang>.vtt` (and
- the live chat) before the media pass runs, so "kept" was true only of a Whisper
- `transcript.json`.
- - The Source video card, the `[Unreleased]` bullet and the AGENTS.md paragraph now say:
- "YouTube's subtitles are fetched again first, as on any re-download; a Whisper transcript is
- not touched, and no audio is extracted beside a transcript."
- - The AGENTS.md sentence also says the pass was skipped for a transcript *or captions* (nit N5).
-2. **L1: a test that `persistKept` passes `forceMedia`** (`42f836cd`,
- `controller/persistKeptForceMedia.test.ts`, 1 test).
- - Setup: youtube handling, `keepLatest: 1`, a kept video with a `transcript.json`,
- `SETTINGS_FILE` set to a temp file with the disk floor off.
- - Asserts: three spawns, the last without `--skip-download`; `persisted: 1`; the pointer
- (`override`) and the container in the store; no `audio.*` or `source-media.*` in the data dir;
- the transcript's bytes unchanged.
- - It bites: with `persistKept.ts:137` removed it fails.
-3. **L2:** recorded above, under "Found and left".
-4. **L3: the full editor suite** (below).
-- **Nits not taken:**
- - N1 is covered by M1's "beside a transcript".
- - N2, N3 (a 300-unit cut can split a surrogate pair), N4 and N6 are cosmetic.
-
-| sha | what |
-|---|---|
-| `3067f8af` | M1: the card text, the changelog bullet, the AGENTS.md clause (+ N5) |
-| `42f836cd` | L1: `persistKeptForceMedia.test.ts` |
-| _this_ | `plans:` these fixes, L2, the full-suite gate |
-
-**Gates on `42f836cd`:**
-- **tsc:** clean before each commit (`n-tsc6.log`, `n-tsc7.log`).
-- **common 1,985/1,985** (+1, the L1 test).
-- **editor unit 85/85.**
-- **`test:scripts` 173 + 1 skip.**
-- **mcp 269/269.**
-- **Editor build:** `pnpm --filter editor exec next build` ok, compiled in 19.9 s, 54 s total
- (`n-gates2.log`).
-- **The FULL editor e2e suite** (`pnpm e2e`, no spec list; queued, detached, `export/public` links
- in place with none dangling): **641 passed, 2 failed, 12 skipped of 655, 48.6 min**
- (`n-e2e-full1.log`). Each failure was re-run alone ×3
- (`pnpm e2e cookies-mode.spec.ts:241 tags.spec.ts:220 --repeat-each=3`): **5 passed, 1 failed,
- 3.0 min** (`n-rerun1.log`).
- - `tags.spec.ts:220` ("a video whose description and transcript are large previews and
- renders"): **3/3 alone — a flake.**
- - The failed assertion is the `addTag` helper's `tags-saved` wait (5 s), under load.
- - The test downloads nothing, so no `metadata.history.json` exists and the new header block
- renders nothing.
- - `cookies-mode.spec.ts:241` ("defer: … downloads via the bucket button"): **2/3 alone — an
- intermittent that predates this slice.**
- - Both failures are the same: `getByLabel('Retry needs cookies output')` → "element(s) not
- found" while waiting for "Managed download complete". The captured log shows the download
- itself finished (`single-url fetched vidcookiegated1`).
- - The cause: `NeedsCookiesList` (`editor/app/channels/[slug]/components/stages/DownloadStage.tsx`)
- returns `null` when the bucket empties, so the refresh after the successful download
- unmounts the card and its run log before the last line arrives. That is the FACTS
- "a run log lives in the panel's React state" hazard, in a file this slice does not touch.
- - Nothing of this slice runs on that path. The gated video's first prefetch fails before
- writing metadata, so there is no history. The retry is not a forced download, and its
- transcript comes from the subtitle pass, so there is no attempt 3.
- - Left for a later slice: render the card while its run lives, as `SourceVideoSection` does.
-### Slice O, as shipped — the Ko-fi mark on every site (2026-09-26)
-
-Branch `export/kofi-mark` off `main` `9860bcbe`, worktree `/home/user/Projects/export-kofi-mark`,
-one Opus implementer. The plan is [`kofi-mark-on-sites.md`](kofi-mark-on-sites.md), Implementation
-items 1–5. The operator's 2026-09-26 ruling supersedes the 2026-09-25 one ("a site build carries no
-Ko-fi link"). Every export build, each site and the hub, now ends its footer's social row with
-Ko-fi's official symbol. "No copy" still holds: the accessible name is exactly "Ko-fi" and nothing
-else is visible. The homepage is untouched and keeps its bare text link (decision 4).
-
-**The asset.** `export/public/kofi-symbol.svg` is `kofi_brandasset/kofi_symbol.svg` from
-`~/Downloads/kofi_brandasset.zip`, byte-for-byte: 3,234 bytes, sha256
-`f5a2d5f1abb5c7f13392ecf6e7d5dffc8bef77917ab59c28a6080deab52f5078`. The same hash comes from the
-unpacked copy, from `unzip -p` of the zip, from the tracked file and from the build's
-`out/kofi-symbol.svg`. It is a tracked real file beside the five starter SVGs. `.gitignore` names
-the generated `export/public` entries one by one, so nothing ignores it, and the worktree's
-`export/public` links from the primary leave it alone.
-
-**The footer** (`export/app/components/Footer.tsx`).
-- The social `<ul>` now always renders. The operator's links are mapped first (an empty list maps
- to nothing), then one last `<li>`: `<a href={KOFI_URL} title="Ko-fi" aria-label="Ko-fi"
- target="_blank" rel="noopener noreferrer">` holding `<img src="/kofi-symbol.svg" alt=""
- width={20} height={20} className="block w-full h-full object-contain">`. `object-contain`
- letterboxes the 241 × 194 mark in the 20 px square (20 × 16).
-- It never goes through `normalizeSocialSvg` / `sizeSocialSvg`, so it keeps Ko-fi's colours. The
- hover is `hover:opacity-80`, where the operator's icons change colour.
-- The `<img>` carries `eslint-disable-next-line @next/next/no-img-element`, umtool's precedent. The
- export's images are `unoptimized`, and `next/image` adds nothing for an SVG. `eslint` on the four
- changed TS files is clean.
-- **The hub's "Ko-fi" text link is removed**, and its comment block is replaced by the plan's.
-- `KOFI_URL`'s comment in `common/lib/project.ts` said "A site build never shows it". It now says
- where the link renders. This is a comment-only edit outside `export/`.
-
-**Offline** (decision 4). Neither service worker precaches anything, and `offlineCache.ts`
-enumerates only archive documents. Both workers route by prefix, so `/kofi-symbol.svg` fell
-through to the network, and an installed app opened offline would draw an empty 20 px link. Both
-workers (`site-sw.js`, `sw-hub.js`) now give it the `/icons/` rule, network-first into `shell-v2`.
-No cache was renamed, and nothing is evicted. `common/lib/archive/serviceWorkerRouting.test.ts`
-gains +1 per worker: online, the mark is fetched and stored; offline, it is served. The test fails
-with the site worker's old condition.
-
-**The specs.**
-- One helper, `expectKofiMarkLast(page)` in `export/e2e/helpers.ts`, which the hub spec already
- imports from. It checks:
- - exactly one Ko-fi link in the footer, and one on the page (`/ko-?fi/i` and `a[href=KOFI_URL]`),
- so the hub's text link is gone;
- - the link is visible, with href `KOFI_URL`, `target=_blank` and `rel="noopener noreferrer"`;
- - its `innerText` is empty;
- - it holds an `img[src="/kofi-symbol.svg"]` with `alt=""`, which is drawn (`complete &&
- naturalWidth > 0`);
- - it is the LAST `<li>` of the footer's social `<ul>`;
- - `/kofi-symbol.svg` is served 200 as `image/svg+xml`, with the official sha256.
-- `site-branding.spec.ts`: "a site build carries no Ko-fi link" becomes "every build carries the
- Ko-fi mark, last in the social row". It adds that the row has two items and the fixture's GitHub
- link is first.
-- `e2e-hub/official-instances.spec.ts`: "the hub footer carries a bare Ko-fi link" becomes "the
- hub footer carries the Ko-fi mark, once, last in the social row".
-- **The tests bite.** With `main`'s `Footer.tsx` put back, both fail:
- - the site test: `toHaveCount(1)`, received 0;
- - the hub test: the empty-text check, received "Ko-fi".
-
-**Docs.** There is no `export/README.md`, and `AGENTS.md` does not mention Ko-fi, so neither
-changes (item 4). `SITE.md` and `SETTINGS.md` are generated and gain no key. The changelog bullet
-is in `export/CHANGELOG.md` `[Unreleased]`, which every site's `/changelog` reads, beside L1's
-three hub bullets.
-
-| sha | what |
-|---|---|
-| `17ee125d` | `export:` vendor the official `kofi_symbol.svg` as `public/kofi-symbol.svg` (sha256 in the message) |
-| `f27b1a83` | `export:` the mark as the last `<li>` of every footer's social row; the hub's text link removed; the `KOFI_URL` comment |
-| `f144c85e` | `export:` both service workers cache `/kofi-symbol.svg` like the icons; `serviceWorkerRouting.test.ts` +2 |
-| `7e0989e8` | `export(e2e):` `expectKofiMarkLast`; the site-branding and hub official-instances tests flipped |
-| _this_ | `plans:` this record; the `export/CHANGELOG.md` `[Unreleased]` bullet |
-
-**Gates**, all from the worktree root; the logs are `o-*.log` in the job's scratch dir.
-- **tsc:**
- - `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` is clean on the tip tree, in
- 109 s (`o-tsc2.log`).
- - The two intermediate states are clean too: `f27b1a83` and `f144c85e`, each with the later
- edits stashed, under `--filter export --filter yt-dlp-transcript-common` (`o-tsc-c1.log`,
- `o-tsc-c2.log`).
- - The asset commit has no code, and the base tree was clean (`o-tsc1.log`).
-- **common 1,956/1,956** (1,954 + the 2 worker tests), 41 s. Editor unit, `test:scripts` and mcp
- were not run, because nothing under `editor/`, `scripts/`, `mcp/` or `umtool/` changed.
-- **`pnpm --filter export exec next build`: ok, in 61 s.**
- - `out/kofi-symbol.svg` has the official sha256, and `out/index.html` carries the mark.
- - The one Turbopack warning is the existing NFT trace of `export/next.config.ts`, which is not
- this slice.
-- **e2e** (queued, detached, `node scripts/worktree.mjs run -- …`; no queue wait on any run):
-
- | run | passed | failed | time |
- |---|---|---|---|
- | `e2e site-branding.spec.ts` | 7 | 0 | 45.4 s |
- | `e2e:hub official-instances.spec.ts` | 3 | 0 | 17.3 s |
- | bite check (`main`'s Footer, `-g "Ko-fi"`), site + hub | 0 | 1 + 1 | — |
- | **export full** | **204** | **0** | **8.8 min** |
- | **`e2e:hub` full** | **24** | **0** | **54.7 s** |
-
- - `e2e:2origin` was not run: it asserts nothing about the footer.
- - The homepage suite was not run: the homepage is untouched.
- - The worktree's tree was clean after every run. Its `public/sw.js` is the config's real copy,
- not a link, so nothing wrote through to the primary.
-- **Screenshots** (the job's scratch dir): `o-footer-light.png` and `o-footer-dark.png`, with
- `-row` crops of the social row.
- - Taken from a static `serve` of the build's `out/` at `localhost:3710`, 1280 px wide at 2×,
- with `colorScheme` emulated.
- - The page is the default site that a worktree build renders. Its row is the worktree
- `settings.json`'s two operator links (Kiwi Farms, x.com), then Ko-fi.
- - The mark is drawn in both, as a 20 × 20 box at the right end of the row.
-- **Numbers tool: none.**
-
-**Found and left.**
-- **Decision 5 was too pessimistic about dark.** The official file's first path is a white halo
- around the whole mark, so on the dark ground the mark is outlined in white. The `#202020` ring
- sits inside it, and the cup and heart read.
-- **The operator's x.com icon is near-invisible on the light ground**, which you can see in
- `o-footer-light.png`. Its `<path>` carries `fill="white"`, and `normalizeSocialSvg` sets
- `currentColor` only on the root `<svg>`. This predates the slice and is operator data
- (`settings.json` `socialLinks`), so it is not touched here. Two possible fixes: re-paste the
- icon without the path fill, or have `normalizeSocialSvg` strip child fills.
-- **Files outside `export/`:** the `KOFI_URL` comment (`common/lib/project.ts`) and the worker
- test (`common/lib/archive/serviceWorkerRouting.test.ts`). Neither touches slice N's files.
-- **Commit trailers:** they carry `Claude Opus 5.5 (1M context)`, as slice M's commits do, and not
- the rules file's `Claude Fable 5.1`, because this implementer is Opus.
-- **Rollout** is the plan's: every site plus the hub rebuild and redeploy (runbook steps 5–6).
- Check live with `curl -sI https://<site>/kofi-symbol.svg` (expect 200) and look for the
- footer's Ko-fi link on each site. An installed PWA picks up the worker change on its next
- update check, and no data cache moves.
-
-### Slice P, as shipped — cut a release from the CLI (2026-09-26)
-
-Branch `cli/cut-release` off `main` `84c502f3`, worktree `/home/user/Projects/cli-cut-release`,
-one Opus implementer. The plan is [`cut-release-cli.md`](cut-release-cli.md), Implementation
-items 1–5. Reviewed SHIP AFTER FIXES; the fixes are in (the review round is under Gates). The
-operator asked (2026-09-26): "Are you able to cut releases with the CLI ops? add that
-ability if not." The answer was no: the only cutter was the "Cut release" form. Now three callers
-share one writer:
-- the form, whose fields and labels are unchanged (its version box now also takes `next` /
- `next-minor`);
-- `archilyzer release cut|show`, local, with no editor running;
-- `pnpm ops cut-release`, through a new `POST /api/ops/cut-release`.
-
-**The writer** is `common/controller/cutRelease.ts`.
-- `cutReleaseForWorkspace({workspace, version, commit, date?, root?})` is the old server action's
- body moved to common, in the same order: the dirty-tree guard, the read, `cutRelease`, the
- atomic write, then the path-limited `Release <workspace> <version>` commit. Every old refusal
- keeps its wording. It returns
- `{ok: true, workspace, version, heading, committed, commitSha?} | {ok: false, workspace, error}`.
- Internally it is a PLAN (read, resolve, cut in memory: every refusal about the changelog) and
- an APPLY (the write and the commit: only I/O and git can fail there).
-- **Two new refusals, in `changelog.cutRelease` itself so every caller has them** (review L1 +
- L2). They are new for the form too.
- - A date must be a calendar day, not just YYYY-MM-DD-shaped (`dateISOProblem`, a `Date.UTC`
- round trip): `Date "2026-13-45" is not a calendar date.`
- - A version must be newer than the latest heading, by semver precedence (`compareVersions`: a
- release ranks above its own prereleases, so `1.0.0-rc.1` passes over `0.9.0` and
- `0.9.0-rc.1` does not): `Version 0.9.0 is not newer than the latest release, 0.9.0.`
- `next` / `next-minor` pass by construction.
-- `version` is a literal X.Y.Z(-pre), `next` (`suggestNextVersion`, the patch bump the form
- pre-fills) or `next-minor` (the new `suggestNextMinorVersion`: `0.9.3` → `0.10.0`).
-- `cutReleases({workspace: "all", …})` cuts editor, then export, with the SAME version, and
- **cuts both or neither** (review M1):
- - A keyword resolves against the HIGHER of the two latest headings (`compareVersions`), so
- neither changelog goes backwards when they have drifted apart.
- - **The preflight, before either write:** it reads both changelogs, plans both cuts in memory,
- and (with `commit`) runs the dirty-tree guard once. Any refusal there returns
- `{ok: false, version, results: [<the failing workspace's refusal>], notAttempted: [<the
- other>], untouched: true}`, and both files and the log are left alone. A guard refusal is
- reported against `editor`, the first commit it blocks.
- - Both changelogs may be dirty. The guard's allowed set is both files, so export's uncommitted
- bullets do not block editor's commit. (A single-workspace cut allows only its own changelog,
- so there a dirty other changelog does block the commit, as it always did.)
- - Only then does it write and commit each, in order: two commits in today's message form.
- Past the preflight only I/O or git can stop it: a write or a commit that fails after the
- editor's went through. The outcome then lists what was done (`results`) and what was not
- tried (`notAttempted`), without `untouched`.
- - Before the review, `all` wrote (and with `--commit` committed) the editor before it looked at
- the export. "Only the editor has changes" left a lone `Release editor` commit behind a
- non-zero exit.
-- `describeRelease(workspace)` is the read-only side of `release show`. It uses the new
- `getLatestRelease` (version + date), `hasUnreleasedHeading` and `countUnreleasedBullets`
- (top-level bullets; nested items are not counted).
-- **A failed write is a result, not a throw (deliberate).** A failed write (`writeFileAtomic` throwing) is now
- `{ok: false, error: "Could not write <file>: …"}` instead of an exception, so `all` can still
- say what it did. The form shows such a failure as its alert instead of an error boundary.
-- `root` is for tests only. It means the standard layout under that directory and ignores the
- environment, so every test builds its own git repo and passes it. Without `root`, the writer
- uses `getPaths()`: the monorepo root, plus the `EDITOR_/EXPORT_CHANGELOG_FILE` overrides.
-- `git.ts` gains `headSha`.
-- **No `package.json` bump and no git tag** (decision 4). Neither has been a convention here: every
- workspace is 0.1.0, and the repo has no tags. The changelog heading is the version.
-
-**The form** (`editor/app/sites/lib/cutReleaseAction.ts`) is now a FormData adapter over
-`cutReleaseForWorkspace`. Its fields, labels, "Invalid workspace." / "Version is required." and
-returned state are unchanged, and `cut-release.spec.ts` passes unmodified (3/3). What it accepts
-changed in two ways, both through the shared writer:
-- its version box also takes `next` and `next-minor` (resolved against the file);
-- a version that is not newer than the latest heading is now refused.
-
-Its three `revalidatePath`s moved to `revalidateAfterReleaseCut.ts`, which the ops route shares.
-
-**The local verbs** are two rows in `common/bin/archilyzer.ts` over `common/bin/release.ts`:
-- `archilyzer release show [editor|export]`. `all` is accepted as "both", the default. It prints
- one line per changelog, plus an `all:` line when both are shown, which says what
- `release cut all next` would cut:
- `editor: latest 0.9.0 (2026-09-26); 8 bullets pending under [Unreleased]; next 0.9.1, next-minor 0.10.0`.
-- `archilyzer release cut <editor|export|all> <X.Y.Z|next|next-minor> [--commit] [--date YYYY-MM-DD]`.
- - It prints one line per changelog, for example
- `editor: ## [0.10.0] - 2026-09-26 (committed 1a2b3c4d)`, `… (not committed)`,
- `export: failed — <sentence>`, and for a workspace `all` did not reach either
- `editor: not cut — all cuts both or neither, and nothing was written` (the preflight refused)
- or `export: not cut — stopped at the failure above` (an I/O or git failure after the editor's
- cut).
- - A bad target, version or date (shape or calendar) is refused before anything is read, with
- exit 2. A failed cut exits 1.
- - `--date` is used verbatim (decision 5). The default is today, in local time, as the form
- stamps it.
-- Both verbs work with no editor running, from the checkout they are run in.
-
-**The remote verb.** `POST /api/ops/cut-release` takes `{workspace, version, commit?, date?}`. It
-is synchronous and built on `ops()`.
-- A bad workspace (`oneOf`), version, date or `commit`, or an unknown key, is an OpsInputError
- 400 before any read.
-- `commit` defaults to false. The CLI's `--commit` is opt-in too; only the form defaults it on.
-- A full cut answers 200 `{ok: true, version, results}`.
-- A refusal answers 400 `{ok: false, error, version, results, notAttempted, untouched?}`.
- `error` is the writer's sentence, prefixed `<workspace>: ` for `all`. `untouched: true` means
- `all` was refused before anything was written.
-- The changelog pages are revalidated whenever anything was cut.
-- `scripts/archilyzer-ops.mjs`: `ACTIONS` gains `cut-release`, and the header gains an example.
- The usage block says what the body takes (`"commit": boolean (default false)`), that `all` cuts
- both with one version and a commit each or neither, and that only an editor built from release
- 10 or later has the route (an older one answers 404). With no editor running, it points to
- `archilyzer release cut`.
-
-**Two fixes the route made necessary.**
-- **The e2e server's export changelog.** `EDITOR_CHANGELOG_FILE` already pointed the test server
- at a gitignored copy, but nothing redirected the export changelog. The new route would have let
- a spec cut the worktree's tracked `export/CHANGELOG.md`, the trap FACTS records for the editor
- one. `dev:test`/`start:test` now set
- `EXPORT_CHANGELOG_FILE=$(pwd)/test-export-changelog.md`, which is gitignored. The `paths.ts`
- comment says why.
-- **`/sites` read a different file from the one its form cuts.** It read
- `path.join(exportDir, "CHANGELOG.md")`, while the action wrote `exportChangelogFile`. The two
- are the same path unless `EXPORT_CHANGELOG_FILE` is set, which the e2e server now does. The page
- now reads `exportChangelogFile`, as `/changelog` reads `editorChangelogFile`. Production is
- unchanged. No spec reads the export notes' content (`deploy-page.spec.ts` checks only the
- heading's position; 4/4).
-
-**Docs.** Neither `README.md` nor `AGENTS.md` mentions cutting a release (grepped for
-"Cut release", "re-cut", "cut a release", "changelog"), so neither changes (item 5). The runbook is
-the parent's.
-
-| sha | what |
-|---|---|
-| `9224059a` | `common:` the `cutRelease` controller (the one writer; next / next-minor; `all`; `describeRelease`), the changelog helpers, `headSha`; `cutRelease.test.ts` 12 + `changelog.test.ts` 4 |
-| `ea390ebc` | `editor:` the form's action is a FormData adapter; `revalidateAfterReleaseCut`; `/sites` reads the export changelog the form cuts |
-| `2657aa9b` | `common:` `archilyzer release show` / `release cut` (`bin/release.ts`); `_cli.test.ts` +6 |
-| `867aaf15` | `editor:` `POST /api/ops/cut-release`; `pnpm ops` `ACTIONS` + usage; `archilyzer-ops.test.mjs` +1 |
-| `7ef9dd6c` | `editor(e2e):` `ops-cut-release.spec.ts` (3); the test server's `EXPORT_CHANGELOG_FILE` + `.gitignore`; the `paths.ts` comment |
-| `80212507` | `editor(e2e):` the second-cut expectation corrected (see e2e run 1) |
-| `6a258d5d` | `plans:` this record (first cut); the `editor/CHANGELOG.md` `[Unreleased]` bullet |
-| `7a1ea858` | `common:` review L1 + L2 in `cutRelease` itself: a calendar date (`dateISOProblem`), a version newer than the latest (`compareVersions` replaces `compareVersionCores`); tests changelog +2, cutRelease +1 |
-| `eeb1e587` | `common:` review M1: `all` cuts both or neither (plan/apply, the preflight, `untouched`); the CLI line and the route body say so; cutRelease tests 13 → 16; `ops-cut-release.spec.ts` updated (+2 bad-input cases) |
-| `7011ba62` | `scripts:` `pnpm ops` usage: "or neither"; `"commit": boolean` (review nit) |
-| _this_ | `plans:` this record updated for the review round; the changelog bullet's wording (review L5 + L6) |
-
-**Gates**, all from the worktree root; the logs are `p-*.log` in the job's scratch dir.
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) was clean before every
- commit, in 72 s, 36 s, 34 s, 73 s and 57 s (`p-tsc1`–`p-tsc5`). The last run covers the tip's
- code.
-- **common 2,009/2,009** (1,987 + 22: cutRelease 12, changelog 4, `_cli` 6), 45 s.
-- **editor unit 85/85**, 4 s.
-- **`test:scripts` 174 + 1 skip** (173 + 1 before, +1 for `cut-release`), 9 s.
-- **mcp 269/269**, unchanged, 18 s.
-- **`pnpm --filter editor exec next build`: ok**, 38 s. `ƒ /api/ops/cut-release` is in the route
- table.
-- **The export build was not run.** Nothing under `export/` changed.
-- **e2e** (editor suite, queued and detached, spec list in `p-specs.txt`; no queue wait on either
- run). The list is `cut-release`, `ops-cut-release` (new), the three specs that grep `api/ops`
- (`ops-api`, `chat-only`, `channel-rename`), and the two `/sites` specs (`deploy-page`,
- `sites-crud`) for the loader change.
-
- | run | passed | failed | time |
- |---|---|---|---|
- | 1 | 52 | 1 | 2.2 min |
- | 2 (after `80212507`) | **53** | **0** | **1.7 min** |
-
- Run 1's failure was the new spec's own mistake, not a flake. A second cut of an
- already-cut file finds no `## [Unreleased]` heading at all, so the writer answers "Could not
- find a `## [Unreleased]` heading to cut from.", not "Nothing pending". Run 2's per-spec
- counts: `cut-release` 3 (unchanged spec), `ops-cut-release` 3, `ops-api` 22, `chat-only` 5,
- `channel-rename` 2, `deploy-page` 4, `sites-crud` 14. The worktree's tracked changelogs were
- untouched after both runs.
-- **The manual proof** (`p-proof.log`) ran in the worktree at `80212507`, with a clean tree. Both
- changelogs' md5s were identical before and after, the tree was clean after, and nothing was
- committed.
- ```
- $ archilyzer release show
- editor: latest 0.9.0 (2026-09-26); 8 bullets pending under [Unreleased]; next 0.9.1, next-minor 0.10.0
- export: latest 0.9.0 (2026-09-26); 4 bullets pending under [Unreleased]; next 0.9.1, next-minor 0.10.0
- all: next 0.9.1, next-minor 0.10.0
- $ archilyzer release cut editor next
- editor: ## [0.9.1] - 2026-09-26 (not committed)
- $ archilyzer release show editor
- editor: latest 0.9.1 (2026-09-26); no [Unreleased] heading; next 0.9.2, next-minor 0.10.0
- $ archilyzer release cut editor next # again
- editor: failed — Could not find a `## [Unreleased]` heading to cut from.
- $ archilyzer release cut site next
- release cut: "site" is not editor, export or all
- $ archilyzer release cut editor next --date 26/09/2026
- release cut: Date "26/09/2026" is not in YYYY-MM-DD form.
- ```
- After the cut, `git diff` was the one heading line; `git checkout -- editor/CHANGELOG.md`
- restored it. `--commit` was never run against a real checkout; the commit path is proven by
- `cutRelease.test.ts` in temp repos.
-- **The review round** (verdict SHIP AFTER FIXES, `p-review.md`; M1, L1, L2, L5, L6 and one nit
- taken; L3 and L4 left, below):
- - tsc clean before each commit, 37 s and 36 s (`p-tsc6`, `p-tsc7`). `7011ba62` touched only
- `.mjs` and `test:scripts` covers it.
- - **common 2,015/2,015** (2,009 + 6: changelog +2, cutRelease +4 net), 40 s. **editor unit
- 85/85**, 3 s. **`test:scripts` 174 + 1 skip**, 9 s. **mcp 269/269**, 19 s (`p-units2.log`).
- - **editor build ok**, 40 s (`p-e2e3.log`).
- - **e2e, the same spec list, run 3: 53 passed, 0 failed, 1.8 min** (no queue wait; no dangling
- `export/public` link). `ops-cut-release` 3/3 with the updated partial-`all` expectation
- (`untouched`, the editor byte-identical) and the two new bad-input cases.
- - **Manual proof, round 2** (`p-proof2.log`, `p-proof3.log`; worktree at `7011ba62`; both
- changelogs copied to scratch and copied back, md5s identical before and after; no commit):
- ```
- $ archilyzer release cut editor 0.9.0
- editor: failed — Version 0.9.0 is not newer than the latest release, 0.9.0.
- $ archilyzer release cut editor next --date 2026-13-45
- release cut: Date "2026-13-45" is not a calendar date.
- $ archilyzer release cut all next
- editor: ## [0.9.1] - 2026-09-26 (not committed)
- export: ## [0.9.1] - 2026-09-26 (not committed)
- $ archilyzer release cut all next # again
- editor: failed — Could not find a `## [Unreleased]` heading to cut from.
- export: not cut — all cuts both or neither, and nothing was written
- # restored; then the export alone cut, so only the editor has pending bullets:
- $ archilyzer release cut export next
- export: ## [0.9.1] - 2026-09-26 (not committed)
- $ archilyzer release cut all next
- export: failed — Could not find a `## [Unreleased]` heading to cut from.
- editor: not cut — all cuts both or neither, and nothing was written
- ```
- The editor changelog's md5 was the same before and after that last `all`. This is M1's case,
- and before the fix it cut the editor.
-- **Numbers tool: none.**
-
-**Found and left.**
-- **Through `pnpm --filter … exec`, every non-zero exit reads as 1.** pnpm's recursive runner maps
- it. `archilyzer build site --bogus` does the same, so this is not the slice's doing. Run
- directly (`common/node_modules/.bin/tsx bin/archilyzer.ts …`, or `pnpm exec` from `common/`),
- a refusal exits 2.
-- **`--commit` refuses on any untracked file.** `git status --porcelain` lists `??` entries, and
- that was already the form's behaviour: an untracked `settings.json.pre-priority-*` blocked the
- 0.9.0 cut. The primary's tree was clean at this writing (0 dirty paths).
-- **The `_lib.ts` header says every ops route "call[s] ONE existing server action".** This one
- calls the controller that the server action also calls. The route's comment says so; the
- header is left as it is.
-- **Review L3, left: a commit that fails after its write revalidates nothing.** The file changed,
- but the result is `{ok: false}` with no sign of the write, so neither the form nor the route
- revalidates. The form always behaved this way. The pages are `force-dynamic` and re-read the
- file on the next request, so the cost is small. The fix would carry `written: true` on that
- failure.
-- **Review L4, left: the route's top-level `error` for an `all` stopped half-way names only the
- failure.** The earlier cut is in `results`, not in `error`. After M1 this happens only on an I/O
- or git failure, and the 400 then lacks `untouched`.
-- **Commit trailers** carry `Claude Opus 5.5 (1M context)`, as slices M–O's do.
-- **Rollout** is the plan's. From the primary, after this merges and before step 1's restart:
- `pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts release show`, then
- `… release cut all next --commit`. With both changelogs at 0.9.0, that cuts both as 0.9.1; use
- `next-minor` or an explicit version for 0.10.0. If either changelog cannot be cut, neither is.
- After the restart, check `pnpm ops cut-release`
- on the live editor with a request that is refused before anything is written, for example
- `--json '{"workspace":"site","version":"next"}'` (expect a 400 naming the three workspaces).
- The route has no read-only mode: `release show` is the CLI's.
-
-### Ko-fi dropped (2026-09-26)
-
-The operator dropped Ko-fi for now (2026-09-26). Branch
-`export/drop-kofi` off `main` `b1e8827b`, worktree `/home/user/Projects/export-drop-kofi`, one Opus
-implementer. It undoes three things: release 9 slice C1b's bare "Ko-fi" link (hub and homepage
-footers, live on both), slice O's official mark on every site's and the hub's social row (merged
-`6a5167a7`, never deployed) and the homepage's mark (`9801a034` + `b1e8827b`).
-
-- **Export footer** (every site and the hub): the social row is the operator's links alone, under
- its old `socialLinks.length > 0` guard, so a site with none renders no empty list. Byte-identical
- to the file before C1b apart from the brand's `BrandMark` changes.
-- **Homepage footer:** byte-identical to the file before C1b. The "Elsewhere" column renders only
- when the operator has social links.
-- **Removed:** `KOFI_URL` (`common/lib/project.ts`) and its comment; `export/public/kofi-symbol.svg`
- and `homepage/public/kofi-symbol.svg`; the `/kofi-symbol.svg` rule in `site-sw.js` and `sw-hub.js`
- and the site worker's header line. `SHELL` stays `"shell-v2"` and `VERSION` `"v1"`, so no cache
- moves; `/icons/` stays network-first. Both workers equal slice O's parent byte for byte.
-- **Nothing else to remove.** Slice O added no `_headers` entry, precache list, icon list or
- `normalizeSocialSvg` exception, and `AGENTS.md`, `homepage/content/**` and the docs never named
- Ko-fi.
-- **Tests:** the Ko-fi case per worker in `serviceWorkerRouting.test.ts`, `expectKofiMarkLast` and
- `KOFI_SYMBOL_SHA256` (`export/e2e/helpers.ts` is back to slice O's parent) and the three Ko-fi
- e2e tests are gone. One negative check per surface replaces them: once the footer is visible, no
- `a[href*="ko-fi.com"]` on the page (`site-branding.spec.ts`, `e2e-hub/official-instances.spec.ts`,
- `homepage/e2e/marketing.spec.ts`). **They bite:** with `b1e8827b`'s footers, `KOFI_URL` and
- SVGs put back, all three fail (expected 0, received 1).
-- **Changelogs** (no released section touched): export `[Unreleased]` loses slice O's bullet and
- gains "The hub no longer links to Ko-fi."; editor `[Unreleased]` (the hub and homepage
- convention) gains "The hub and the homepage no longer link to Ko-fi."; homepage `[Unreleased]`
- gains "The footer no longer links to Ko-fi."
-
-| sha | what |
-|---|---|
-| `70f0a9ea` | `export:` the footer's social row drops the mark and is guarded again; `public/kofi-symbol.svg` removed |
-| `a8658444` | `export:` both service workers drop the `/kofi-symbol.svg` rule; the worker test's Ko-fi case removed |
-| `741133e4` | `export(e2e):` a site page and the hub have no link to ko-fi.com; the helper and its hash removed |
-| `af516047` | `homepage:` the Elsewhere column drops the mark and renders only with social links; its SVG removed; e2e negative |
-| `a36fd3d9` | `common:` `KOFI_URL` removed |
-| `37ffc782` | `export, editor, homepage:` the `[Unreleased]` bullets |
-| _this_ | `plans:` this record; `STATE.md`'s Ko-fi ruling |
-
-**Gates**, all from the worktree root; the logs are `k-*.log` in the job's scratch dir.
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`): clean before each of
- the five code commits, and on the tip tree (the changelog commit is Markdown only).
-- **common 2,013/2,013** (slice P's 2,015 minus the two worker cases), 47 s; **editor unit 85/85**;
- **`test:scripts` 174 + 1 skipped**; **mcp 269/269**.
-- **Builds:** export `next build` site mode, ok in 29 s; `INSTANCE_MODE=hub` `next build`, ok in
- 32 s; homepage `next build` (its `public/` data copied from the primary), ok in 16 s. After each,
- `out/icons` has its 7 files and there is no `out/kofi-symbol.svg`. `grep -rIl -i ko-fi out` finds
- only (a) `/changelog`, which renders export's `[Unreleased]` "no longer links" bullet, and (b) on
- the export builds, corpus data linked from the primary (`subs/friday-night-tights` live chat, a
- viewer's `ko-fi.com` link; a `the-quartering-rumble` transcript). No `ko-fi.com` href anywhere
- outside that data. The homepage's case-insensitive `kofi` hits are a video id in `stats/`.
-- **e2e** (queued, detached, `node scripts/worktree.mjs run -- …`; no queue wait):
-
- | run | passed | failed | time |
- |---|---|---|---|
- | **export full** | **204** | **0** | **8.7 min** |
- | **`e2e:hub` full** | **24** | **0** | **57.1 s** |
- | **homepage full** | **27** | **0** | **50.4 s** |
- | bite check (`b1e8827b`'s Ko-fi code, `-g ko-fi`), site + hub + homepage | 0 | 1 + 1 + 1 | — |
-
-- **Numbers tool: none.**
-
-**Left.** `plans/` keeps its Ko-fi history (release 9 C1b, slice O, `kofi-mark-on-sites.md`), as a
-record. **Rollout:** the hub and the homepage keep the Ko-fi link they were last deployed with (at
-least C1b's text link) until they are rebuilt and redeployed; no site was ever deployed with Ko-fi,
-so their release 10 rebuild simply does not add it. An installed PWA picks up the worker change on
-its next update check, and no data cache moves.
-
-### Slice AC, as shipped — accent colours (2026-09-27)
-
-The operator's asks (2026-09-27): every site gets a unique accent (Archilyzer's bone mark is not one;
-**Jeralyzer = Brass**, **Hasanalyzer = Blue**, the rest the parent's pick); the search bar's
-"Press Enter or click Search to apply" in the site's accent instead of `text-warning`; the
-homepage's official-instance cards show each site's accent in their left stripe. Branch
-`r10/accent-colors` off `main` `154817f6`, worktree `/home/user/Projects/r10-accent-colors`
-(block #11), one Opus implementer. Scratch files `ac-*` in the job's `tmp/brand`.
-
-**The palette: no assignment of the accents passes, so the chart wears their hue families.** Validated first with the
-dataviz skill's `validate_palette.js`, `--pairs all` (the homepage order moves with transcript
-counts), each base's own swatch values against its `--chart-surface`, contrast also against the
-page ground; all ten sets {Brass, Blue} + three of {Vermilion, Violet, Sakura, Green, Signal}.
-None passes. Brass fails with Vermilion (ΔE **1.0** deutan on light/sepia), Green (1.8 protan on
-dark) and Signal; Blue with Violet (normal **8.5–9.0**, CVD 1.3–1.9) and Signal. Only Sakura passes
-with both, so no passing set has more than three colours. On dark every accent is also above the
-validator's band (L 0.70–0.79 > 0.67): they are text colours, not a categorical palette. The
-least-bad set is {Brass, Blue, Sakura, Violet, Green}: three failing pairs (Brass–Green, Blue–Violet,
-Violet–Sakura on dark only) and one floor pair (Sakura–Green). The proposed mapping, which the
-coordinator took (2026-09-27) and sets through the site form:
-
-```
-jeralyzer=brass
-hasanalyzer=blue
-anilyzer=sakura
-bonnellyzer=violet
-rekietalyzer=green
-jasolyzer=vermilion (unpublished: on neither the chart nor the hub; unique)
-```
-
-The planned Rekietalyzer = Vermilion with Bonnellyzer = Green passes every ADJACENT pair in
-today's order, but fails Brass–Vermilion and Vermilion–Green over all pairs and goes red if
-Hasanalyzer and Rekietalyzer (3,048 vs 2,855 transcripts) swap places.
-
-The slice's fallback first kept the growth chart on `seriesColor`. That made a card disagree with
-its layer: Jeralyzer's card was gold and its layer blue, Hasanalyzer's card blue and its layer amber
-(`ac-cards-*.png`, `ac-chart-*.png`). **Hue-matched chart (the coordinator's follow-up, same day):**
-the proposed set is exactly the chart palette's five hues, so `siteChartColors` draws each site in
-the `--chart-N` of its accent's hue family (blue 1, green 2, violet 3, brass → amber 4, sakura →
-magenta 5) and keeps the validated values. Each accent is 1–21° of hue from its slot, and ≥ 31° from
-any other slot. The validator on the layer colours the code resolves (`ac-layers.log`):
-
-| order | adjacent (the stack), light / sepia / dark | all pairs |
-|---|---|---|
-| today (Jer, Ani, Bon, Has, Rek) | PASS; CVD 12.3 / 11.1 / 11.8, normal 17.7 / 15.3 / 16.6 | CVD WARN 6.2 / 6.1 / 6.9, normal ≥ 15.3 |
-| Has and Rek swapped | PASS; CVD 12.3 / 11.3 / 13.7, normal 19.6 / 19.7 / 16.6 | the same set |
-
-The all-pairs WARN (6–8 floor band) is `--chart-1..5`'s own borderline in any order, legal with the
-legend, the surface-gap edges and the table. A site with Vermilion, Signal, a custom hex or no
-accent takes `seriesColor(i)` when no one holds it, else the lowest free slot: never two sites in
-one colour.
-
-**What shipped**
-- **The hint** (`common/components/SearchBar.tsx`) is `text-brand`: the site's accent, or the
- reader's, at its value for the base, ≥ 4.5:1 on each page ground by construction
- (`MIN_ACCENT_CONTRAST`). The editor renders no `SearchBar`; the hub's accent is Signal.
-- **`accentIdOf`** (`common/lib/accent.ts`) and an optional per-site **`accentId`** in
- `homepage-summary.json` (still v5) and `hub-summary.json` (still v1; `parseHubSummary` keeps only
- a known id). The published hex is unchanged.
-- **`siteChartColors(sites)`** and **`siteColor(site, chart)`** (`common/lib/siteColor.ts`): the chart
- colour above; the mark colour is a named accent → `var(--swatch-<id>)`, a custom hex → that hex,
- neither → its chart colour. So a family accent's card and layer share a hue, and a card with no
- accent equals its layer.
-- **Homepage:** `ArchiveCards` stripes use `siteColor`; `ArchiveGrowthChart`'s layers and legend,
- `/stats`' site series (`homepageChartData`) and its `SiteGrid` cards use `siteChartColors`
- (`STACK_ORDER` unchanged). The By-site leaderboard keeps each site's colour instead of re-keying by
- rank; channels are still rank-keyed. The header comments state the rule and the numbers.
-- **Hub:** `officialInstances` colours through `siteColor`, so the card, chip, result edge and
- channel group wear a named accent per base. `hub-sites.json` carries only the on-dark hex, so the
- summary's id is used when the two name the same colour; a site's own different hex still wins.
-- **e2e fixture:** the homepage dev server reads a copy of the summary on disk with fixture accents
- on its first sites (`HOMEPAGE_SUMMARY_FILE`, set only by `homepage/playwright.config.ts`;
- `homepage/e2e/fixture-accents.ts`, gitignored output `homepage/e2e/.e2e-summary.json`): Brass, a
- custom hex, then none. Every other number is the real summary's.
-
-| sha | what |
-|---|---|
-| `b9b010f7` | `search:` the hint is `text-brand`; `theme-accent.spec` checks class, colour and contrast on light, sepia and dark |
-| `69f5b251` | `common:` `accentIdOf`, `accentId` in both summaries, `siteColor`, `officialInstances` through it; 8 unit tests |
-| `7667e8d5` | `homepage:` `ArchiveCards` stripes through `siteColor`; header comments; the fixture summary; `instance-colours.spec` |
-| `152ade49` | `hub:` comments; `official-instances.spec` checks a Brass member on dark, light and sepia |
-| `e39eb7ea` | `changelogs:` export, editor and homepage `[Unreleased]` (new sections above `[0.9.1]` in export and editor) |
-| `7b1e109b` | `plans:` this record; `FACTS.md`'s official-instance colour line |
-| `4719b333` | `common:` `siteChartColors`; `siteColor` falls back to the chart colour; `ArchiveCards` and the hub pass it; 7 unit tests (its commit message says 8; 7 is right) |
-| `0ce35eab` | `homepage:` the growth chart, its legend and `/stats` wear `siteChartColors`; `instance-colours.spec` checks legend = slot, Brass card within 25° of hue of its layer |
-| `18023e54` | `changelogs, plans:` the `[Unreleased]` bullets, this record and FACTS for the hue-matched chart |
-| `228f0eb8` | `homepage:` review fix — `HOMEPAGE_SUMMARY_FILE` only outside a production build (`summaryFile`); `summary.test.ts` and the homepage's `test` script |
-| `76881374` | `common:` review fix — `homepageChartData.test.ts`: a site series wears `siteChartColors`; the leaderboard keeps a site's colour by site, ranks by channel |
-| `136aa0ec` | `hub, homepage(e2e):` review nits — `ArchiveShelf`/`useHubSites` comments; `instance-colours.spec` requires the chart when the fixture has `monthly` |
-| _this_ | `plans:` the review fixes in this record |
-
-**Gates** (logs `ac-*.log`):
-- **tsc** clean on the code tree (33 s) before the four code commits, which were staged from it
- with no type dependency on the unstaged rest; the later commits are Markdown only.
-- **common 2,021/2,021** (2,013 + 8), editor unit **85/85**, `test:scripts` **174 + 1 skipped**,
- mcp **269/269**.
-- **Builds:** editor ok (42 s); export site ok (25 s); export hub ok (28 s, `out/ask` present);
- homepage ok (14 s; its `public/` data copied from the primary; with the real summary, which sets
- no accents, the stripes are `var(--chart-1..5)`, as before). `export/public` linked per path; the
- primary's `export/public` byte-identical before and after every run.
-- **e2e** (no queue wait): export full **205 passed** (8.2 min), `e2e:hub` **25 passed** (1.1 min),
- homepage **28 passed** (46 s). **They bite:** with the three guarded files at `154817f6`, each new
- test fails for its reason (the card stripe `rgb(53, 97, 200)` = `--chart-1`, not Brass; the hint
- `text-warning`; the hub stripe on light still Brass's on-dark hex).
-- **Visual:** the homepage built with the five real sites carrying the proposed accents, on dark,
- light and sepia at 1280 (`ac-cards-*.png`, `ac-chart-*.png`): each stripe is the accent's value
- for its base, and the chart is unchanged.
-- **Hue-matched chart, on `0ce35eab`:** tsc clean (66 s); common **2,028/2,028** (+7); homepage build
- ok (15 s); homepage e2e full **28 passed** (54.7 s); `e2e:hub` **25 passed** (57.8 s; the hub's
- fallback now reads the chart colours). `instance-colours.spec` bites: with `ArchiveGrowthChart` at
- `7b1e109b` the legend's first swatch is `--chart-1` (`rgb(53, 97, 200)`), not the amber slot.
- Screenshots `ac2-cards-*.png`, `ac2-chart-*.png`: every card and its layer are one hue on dark,
- light and sepia.
-- **Review fixes, on `136aa0ec`** (review `ac-review.md`: SHIP AFTER FIXES): tsc clean (35 s); common
- **2,031/2,031** (+3, the `homepageChartData` cases; the first two fail on `7b1e109b`'s file);
- homepage unit **2/2** (new script); homepage build ok (16 s), and a build with a stray
- `HOMEPAGE_SUMMARY_FILE` pointing at the proposed-accents summary still renders the real summary
- (stripes `var(--chart-1..5)`); homepage e2e full **28 passed** (38.6 s); `e2e:hub` **25 passed** (57.7 s; hub
- comments changed).
-
-**Found and left** (review lows, recorded, not fixed):
-- **A sixth published site would nearly repeat Anilyzer's magenta.** Every chart slot is now held by
- a family, so a sixth site falls past `--chart-5` to `seriesColor(5)` = `hsl(328 64% 55%)`
- (`rgb(214, 67, 145)`), within a degree of hue of `--chart-5` (`#c24a8a`). The strings differ, so
- `siteChartColors`' uniqueness holds, but the colours do not read apart. Owed before Jasolyzer
- (Vermilion) gets a `siteUrl`: a sixth validated slot, or a vermilion chart family.
-- **A custom hex is painted unfitted on every base** on the homepage cards (and the hub, as before):
- a pale hex would be faint on light and sepia. No live site uses one; `resolveAccent` already fits
- one per base if it is ever needed here.
-
-**Left.** The accents themselves are the parent's (site form); until they are set, every stripe is
-its chart colour, as today. Rollout: every export site and the hub rebuilt for the hint; the
-homepage and the hub rebuilt after the accents are set.
-
-### Slice MC, as shipped — mark contrast (2026-09-27)
-
-The operator's asks (2026-09-27): **"the line details inside have too little contrast with the
-background"** — the Found-line mark's three dim lines were 1.59:1 on the child ink tile (`#3b3327`
-on `#0c0a08`) and 1.97:1 on the Archilyzer slate (`#3f4c56` on `#151b20`); on the dark base the
-header's ink tile merges into the ink page and the mark read as a lone lit line. And the accents
-were swapped through the site form (the parent): **hasanalyzer = Violet, bonnellyzer = Blue**, so the
-homepage chart is re-validated. Branch `r10/mark-contrast` off `main` `51c5b562`, worktree
-`/home/user/Projects/r10-mark-contrast`, one Opus implementer. Scratch files `mc-*` in the job's
-`tmp/brand`.
-
-**The values.** Each new dim keeps its old hue and saturation (warm ink h36 s20; slate h206 s15) and
-sits just over 3:1, because the two rules below multiply to lit-on-ground: with the dim at 3:1 the
-darkest lit values (Vermilion 7.03:1 on ink, Signal 6.28:1 on the slate — darker than Blue, 8.19)
-cannot sit more than ~2.3 and ~2.1 above any dim.
-
-| palette | dim before → after | on its ground | tightest lit over the dim |
-|---|---|---|---|
-| child (ink `#0c0a08`) | `#3b3327` → **`#6b5d47`** | 1.59 → **3.09** | Vermilion 2.28, Signal 2.31, Blue 2.65, Violet 2.74, Sakura 2.81, Green 3.04, Brass 3.26 |
-| Archilyzer (slate `#151b20`) | `#3f4c56` → **`#586977`** | 1.97 → **3.06** | bone 4.80; Signal (the Media mark) 2.05 |
-
-The rules, in `brand.ts` beside `ICON_PALETTES` and enforced on every icon palette:
-`MIN_MARK_DIM_CONTRAST = 3` (WCAG 1.4.11, a graphic that must be seen) and
-`MIN_MARK_LIT_OVER_DIM = 2` (the lit line at least double the dim's luminance: the most both
-palettes can hold with the dim at 3:1). A custom accent is fitted only to the 4.5:1 ground rule, so
-one at that floor sits ~1.5:1 over the dim (the e2e fixture's `#cc3366` → `#d14574`: 1.47:1); its
-hue carries it. Rendered at 16, 32, 56 and 128 px on the ink and light pages before choosing
-(`mc-sheet-{ink,light}.png`).
-
-**The chart after the swap: every adjacent pair passes** (`mc-palette.md`, `mc-layers.log`: Slice
-AC's script with the new mapping, `siteChartColors` → each base's `--chart-N` → the dataviz
-validator against `--chart-surface`):
-
-| order | layers | adjacent, light / sepia / dark | all pairs |
-|---|---|---|---|
-| today (Jer, Ani, Bon, Has, Rek) | amber · magenta · blue · violet · green | PASS; CVD 13.1 / 11.1 / 11.0, normal 17.7 / 15.3 / 16.7 | CVD WARN 6.2 / 6.1 / 6.9, normal ≥ 15.3 |
-| Has and Rek swapped | amber · magenta · blue · green · violet | PASS; CVD 13.1 / 13.4 / 11.0, normal 19.6 / 19.7 / 21.7 | the same set |
-
-The all-pairs WARN is `--chart-1..5`'s own 6–8 floor band, the same pairs as AC's (Green–Amber,
-Green–Magenta on dark). The tightest adjacent pair is Violet–Blue on sepia (normal 15.3), which AC
-also had adjacent in the other order. No chart change is owed.
-
-**What shipped**
-- `ICON_PALETTES` child dim `#6b5d47`, Archilyzer dim `#586977`; the two rules as exported constants.
-- `MEDIA_PALETTE` takes ground and dim from `ICON_PALETTES.archilyzer` instead of a copy; the
- banner's field (`#1e262d`) stays under the mark's dim (a test holds it).
-- Regenerated from the code, not by hand: `editor/app/icon.svg` (`markSvg`, parity test green) and
- umtool's `brands/archilyzer-media.json` (`brand-media.ts --video-kit`). The header `BrandMark`s,
- the export/hub/homepage icon routes and the favicon read the palette, so nothing else changed.
-- Tests: `brand.test.ts` holds both rules on all seven accents over the child dim and bone over the
- slate, and pins every ratio; `brandMedia.test.ts` holds them on mark M2. The export, hub and
- homepage `brand.spec`s pin the new computed fills (`rgb(107, 93, 71)`, `rgb(88, 105, 119)`).
-- The YouTube channel assets are regenerated at `~/reports/archilyzer-media/brand/` (avatar,
- watermark, banner, `INDEX.html`); the previous set is kept in `mc-media-before/`
- (`mc-avatar-compare.png`, `mc-banner-compare.png`).
-
-| sha | what |
-|---|---|
-| `c05e6daf` | `common:` the dims, the two rules, `MEDIA_PALETTE` from `ICON_PALETTES`, 3 unit tests, `icon.svg` + the video kit regenerated, three e2e fills |
-| `79d687c9` | `changelogs:` a new `[Unreleased]` above `[0.9.2]` in export and editor; a bullet in the homepage's |
-| _this_ | `plans:` this record; `brand-and-themes.md`'s icon palettes, with a dated note |
-
-**Gates** (logs `mc-*.log`):
-- **tsc** clean (65 s) on the code tree of `c05e6daf`; the later commits are Markdown only.
-- **common 2,034/2,034** (2,031 + 3), editor unit **85/85**, `test:scripts` **174 + 1 skipped** (the
- report-to-video tests among them), mcp **269/269**, homepage unit **2/2**.
-- **They bite:** with the old dims, 9 of the 23 `brand`/`brandMedia` tests fail, both new rules among
- them (`child: dim #3b3327 on #0c0a08 is 1.59:1`); with a too-bright child dim `#807055` the 2:1
- rule fails (`child · signal … 1.74:1`).
-- **Builds:** editor ok (35 s; the built `icon.svg` carries `#586977`); export site ok (22 s;
- `out/icons/icon.svg` 3× `#6b5d47`); export hub ok (24 s; 3× `#586977`, `out/ask` present);
- homepage ok (14 s; 3× `#586977`). The primary's `export/public` byte-identical before and after
- the builds and the e2e.
-- **e2e** (no queue wait, nothing failed, so no re-runs): export `brand` + `pwa` + `site-branding`
- **15 passed** (29 s); `e2e:hub` **25 passed** (1.0 min); homepage full **28 passed** (44 s); editor
- `branding.spec` **3 passed** (23 s).
-- **Visual** (`mc-header-compare.png`): the live Jeralyzer (Brass) and Bonnellyzer (reader accent Blue)
- headers at 2× DPR on dark and light, as served and with only the dim set to `#6b5d47` — the value
- the build now inlines; plus the favicon at 32 px (1:1 and 4×) and 16 px, before and after, for
- Brass, Blue and the parent bone, rendered by `renderIconPng` (the "before" 32 px render is
- byte-identical to live Jeralyzer's `/icons/icon-32.png`). After: four lines on both bases; the lit
- line is still the found line.
-
-**Found and left**
-- **On the dark base the ink tile still merges into the ink page** (both `#0c0a08`): the mark now reads
- as four lines, but not as a tile. A hairline ring or a lifted tile on dark would fix it; not asked,
- and it changes the mark's silhouette, so it is the operator's call.
-- **The live sites carry none of this until rebuilt:** every export site and the hub (the site mark and
- icons), the homepage (the parent mark), and the editor on its next restart (`icon.svg`, sidebar).
- Bonnellyzer still serves Violet and Hasanalyzer Blue until they, the homepage and the hub are
- rebuilt for the swap. The regenerated YouTube picture, watermark and banner are the operator's to
- upload in Studio (`INDEX.html` has the steps).
-
-### Slice MR, as shipped — mark ring on dark (2026-09-28)
-
-The operator's ask (2026-09-28): **"Add a thin outline to the tile on dark."** Slice MC left it as
-found: on the dark base a site's ink tile is the ink page itself (`#0c0a08` on `#0c0a08`) and the
-parent's slate `#151b20` is 1.14:1 on it, so the mark read as four lines with no tile. Branch
-`r10/mark-ring` off `main` `6db8fcda`, worktree `/home/user/Projects/r10-mark-ring`, one Opus
-implementer. Scratch files `mr-*` in the job's `tmp/brand`.
-
-**What shipped.** `BrandMark` (`common/components/BrandMark.tsx`) draws a **1 CSS px ring outside
-the tile, only when `.dark` is on `<html>`** (tokens.css's `@custom-variant dark`), in the palette's
-own **dim**: `--mark-ring` is set from `palette.dim` in the svg's `style`, so a site mark rings in
-`#6b5d47` and the parent mark in `#586977`, and the ring reads as part of the mark. The classes are
-one literal, `BRAND_MARK_RING_CLASS`: `rounded-[21.875%] overflow-visible
-dark:shadow-[0_0_0_1px_var(--mark-ring)]`.
-- A **box-shadow**, so it takes no layout: the mark is 28 × 28 (16 × 16 in a footer) on every base,
- and the header does not move.
-- `rounded-[21.875%]` is the ground's `rx` (112 of 512; the unit test holds the two equal), so the
- ring follows the tile's corner. **`overflow-visible` is needed**: an `<svg>` clips its content by
- default, and with a radius that clip is a second anti-aliased edge over the ground's own corner
- (at 2×, 70 px of the site header and 84 px of the homepage's differed from main by up to 7 levels;
- without the clip, 2 px by ≤ 2).
-- Light and sepia render **pixel-identical to main** (0 px differ, site Brass and Blue, hub and
- homepage, on both).
-- Every `BrandMark` use draws the tile, so all five get the ring: the export header, the footer
- credit, the hub header (and its footer), the homepage header, the editor sidebar. The icon files
- (`markSvg`: favicons, app icons, the OG image, the YouTube assets) are untouched.
-
-**The variant, and why.** Screenshotted at 2× on dark from this branch's builds, the site (Brass) and
-parent marks (`mr-variants-header.png`, `mr-variants-zoom.png`): the full dim outside (chosen); the
-same at 60 % (`#453c2e` on ink, **1.82:1**, and `#3a434b` 1.96:1): it reads as a smudge rather than
-an edge at 1 px; and a ring 1 px inside the edge (an `outline` at offset −1px): it eats a pixel of the
-tile, so the tile looks smaller on dark than on light and the ring crowds the lines. The full dim is
-**3.09:1** on the ink page (child) and **3.48:1** (parent; 3.06 on its own slate), the same WCAG
-1.4.11 floor the dims meet, and at 1 px against the lines' ~2.4 px it reads as the tile's edge
-without competing with them; the lit line stays the found line. Crisp at DPR 1, 2 and 3
-(`mr-dpr.png`: the straight edges are one, two and three full device pixels).
-
-| sha | what |
-|---|---|
-| `c5fc5bb3` | `common:` the ring — `BRAND_MARK_RING_CLASS`, `--mark-ring` from `palette.dim`; `BrandMark.test.ts` (4 tests) |
-| `eb680a9c` | `e2e:` the export, hub and homepage `brand.spec`s and the editor's `branding.spec` read the computed box-shadow on dark, light and sepia |
-| `14fd9f62` | `changelogs:` a new `[Unreleased]` above `[0.9.3]` in export and editor; a bullet in the homepage's |
-| _this_ | `plans:` this record; a dated note in `brand-and-themes.md`'s mark section |
-
-**Gates** (logs `mr-*.log`):
-- **tsc** clean (64 s) on the code tree of `eb680a9c`; the later commits are Markdown only.
-- **common 2,038/2,038** (2,034 + 4), editor unit **85/85**, `test:scripts` **174 + 1 skipped**, mcp
- **269/269**, homepage unit **2/2**.
-- **They bite:** with the shadow class removed, 1 of the 4 unit tests fails, the export `brand.spec`
- 1 failed / 5 passed and the homepage's 1 failed / 2 passed (`ring: []` where the dim was expected).
-- **Builds:** editor ok (43 s), export site ok (29 s), export hub ok (26 s; `out/ask` present),
- homepage ok (14 s). Each built stylesheet carries
- `.dark\:shadow-\[0_0_0_1px_var\(--mark-ring\)\]:where(.dark,.dark *)` and
- `.rounded-\[21\.875\%\]`; the site's `index.html` sets `--mark-ring:#6b5d47` (header) and
- `#586977` (footer), the hub's `#586977` twice, the homepage's once. The primary's `export/public`
- byte-identical before and after the builds and the e2e.
-- **e2e** (no queue wait, nothing failed, so no re-runs): export `brand` + `site-branding` + `theme` +
- `theme-accent` **20 passed** (55 s); `e2e:hub` **26 passed** (63 s); homepage full **21 passed, 8
- skipped** (39 s; no summary on disk in a fresh worktree, see below), then with the primary's
- `homepage/public` data copied in **29 passed** (49 s); editor `branding.spec` **4 passed** (31 s).
-- **Visual** (`mr-compare.png`): the site header in Brass and Blue, the hub and the homepage, on dark
- and light at 2×, before (main's `<svg>` re-created: no radius, the default clip, no shadow) and
- after; the footer credit on dark (site and hub); the two marks on dark at 3×.
-
-**Found and left**
-- **A fresh worktree's homepage e2e skips 8 specs** (`stats.spec` ×7, `instance-colours.spec`) unless
- `homepage/public`'s gitignored data (`homepage-summary.json`, `channel-sites.json`, `stats/`,
- `downloads/`) is copied from the primary: the specs skip on "no summary on disk", so the run is
- green but short. Copied here (not linked, so nothing can write through).
-- **The ring is a box-shadow, which forced-colours mode (Windows High Contrast) removes**; the mark
- then looks as it does on `main`. Not asked, not tested.
-- **The live sites carry none of this until rebuilt:** every export site and the hub, the homepage,
- and the editor on its next restart.
-
-## Rollout
-
-Nothing is rolled out, except that **Jeralyzer is already on the brand, in Signal** (a build-deploy
-on the live editor, 2026-09-26 10:51–11:06; "Integration (S4 + L1 + L2), as merged", above). The
-live :3001 editor still runs `0213f6c8` (the pre-brand build); the other four official sites are at
-release 8's Z + E; the hub and homepage at release 9's C1b/C2/C3. The operator's runbook is
-`~/reports/release-10/RUNBOOK.html` (generated by `make-runbook.py` beside it, with the rollout
-scripts in `scripts/`). The steps:
-
-0. **Check the primary contains release 10's final commit** (the integration pass's `plans:`
- record, on top of the brand, S4, L2 and L1; it was the brand's S3 review-fix commit before):
- `git -C /home/user/Projects/yt-dlp-transcript-browser merge-base --is-ancestor <final> HEAD`. The
- runbook names the sha, and every rollout script refuses to run without it.
-1. **Re-cut the release notes first.** Editor and export 0.9.0 were cut for the brand (2026-09-26
- 01:37); S4, L1 and L2 then added a new `[Unreleased]` to both (export: L1's three hub bullets;
- editor: S4's and L2's). `export/CHANGELOG.md`'s `[Unreleased]` is rendered on every site's public
- `/changelog` until it is cut: `/sites` → Release notes → Cut release (the form suggests
- `0.9.1`). With "Commit changelog" ticked the form refuses a dirty tree; the primary had an
- untracked `settings.json.pre-priority-*` at the 0.9.0 cut (its tree was clean at the integration
- pass), so untick it whenever the tree is dirty and commit the changelog by hand. The
- editor's own notes (`/changelog`) can be cut the same way; they are not public. Commit both files
- in one commit.
-2. **Restart the live :3001 editor on the new `main`** (release 9's procedure): check `/jobs` for an
- operator-started job; md5 `before`; the editor build into the live `.next` (umtool is not
- rebuilt or restarted in this step; see 2b); md5 `pre-restart`; ONE editor restart; md5
- `after-boot` — the three must match; the smoke (`SMOKE_FAIL=0`, or every flag explained). The
- editor itself changes look: the parent mark and a favicon, Archivo/Plex, and the operator's
- stored theme migrates once.
- - **2b. Optional: rebuild and restart umtool on :3050** (`r10-umtool.sh`). Only for the
- new-project form's brand choice (S4). The live :3050 already spawns `main`'s report-to-video
- scripts from disk, which is safe because a render that does not opt in is byte-identical. The
- script refuses while a umtool job runs, never restarts after a failed build, restarts once, and
- checks that `/` offers "Archilyzer Media".
-3. **Set each site's accent and wordmark lead** in the site form (`/sites/<id>`, the one writer; never
- hand-edit `transcripts/`):
-
- | Site | Accent | Wordmark lead |
- |---|---|---|
- | jeralyzer | brass | Jer |
- | rekietalyzer | vermilion | Rekieta |
- | hasanalyzer | violet | Hasan |
- | anilyzer | sakura | Ani |
- | bonnellyzer | blue | Bonnell |
- | jasolyzer | green | Jaso |
-
- Six `site.json` files change, and nothing else (an md5 sweep shows it).
-4. **Preview Anilyzer**: `pnpm ops build-deploy --json
- '{"siteId":"anilyzer","skipArchives":true,"preview":"brand"}' --wait` →
- `https://brand.anilyzer.pages.dev`. On a phone and the desktop: the favicon (Sakura lit line),
- the picker (Base + Accent, Sakura tagged default), and the migration — the preview is its own
- origin with no stored theme, so seed the legacy keys in the console (`ytdlp-tb:theme=archive`,
- `ytdlp-tb:mode=light`) and expect Sepia. The real phone test is on production: pick an old theme
- on `anilyzer.pages.dev` before step 5, expect Sepia after it; an installed app's icon updates only
- from production (SW `shell-v2`, `/icons/` network-first).
-5. **Every official site**: `pnpm ops build-deploy --json
- '{"siteIds":["jeralyzer","anilyzer","bonnellyzer","hasanalyzer","rekietalyzer"],"skipArchives":true}'
- --wait --wait-timeout 7200` (by name, never `all`).
-6. **The hub**: `pnpm ops build-hub --json '{"deploy":true}' --wait`. **The homepage**:
- `pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts build homepage`, then
- `… deploy homepage`.
-7. Live checks per surface, and the record of this rollout under this heading.
-
-**What readers will notice:** a stored theme migrates once (light stays light, Archive light becomes
-Sepia, dark stays dark, system stays system; the family is dropped). After the service-worker update
-an installed app opens offline only after one more online visit (`shell-v2` drops the old shell);
-offline channel downloads are kept. From L1 (on the hub): the official instances are listed in
-the homepage's order, each in one colour everywhere; `/ask` follows the scope chips and, with every
-archive off, is disabled with one line saying why; an archive whose live chat fails is still searched
-(without its live chat, its chip ready).
-
-**What the operator will notice:** a YouTube soft block ("…isn't available, try again later") now
-pauses the platform like a 429 (the batch stops, the runner defers the video 6 h, a scan stops,
-the availability check stops) instead of excluding the video as deleted; cleanup keeps the audio of
-every video its confirmation check did not reach; `/jobs` says why a job was cancelled at boot.
-
-### Slice N — merged 6a1678a0 (2026-09-26 evening); restart owed
-
-`editor/full-fetch-media` @ `115f9656` → `main` `6a1678a0`, clean merge. FINAL moves again. Nothing is
-live until the :3001 restart (step 1); then prove: `fetch_clip` `full: true` on `teamrcn/dbnS-cBgStY`
-(the slice M no-op) → 202 → done with a file under `transcripts/saved-videos/teamrcn/dbnS-cBgStY/`,
-`transcript.json` mtime unchanged, no `audio.*`, and `data/dbnS-cBgStY/metadata.history.json` with one
-entry (its `changed` may be empty). Reviewer's follow-up DONE: `cookies-mode.spec.ts:241 --repeat-each=5` on merged `main` (5f577437)
-→ 5/5 passed in 1.8 min — the branch's 2-of-4 was machine load (7–10 during its run), not slice N.
-
-### Slice M — fetch_clip, merged and proved live (2026-09-26 evening)
-
-Merged AFTER the integration pass: `mcp/fetch-clip` @ `fa44984a` → `main` `64f26a71` (the one
-conflict was this file's `## Rollout` insertion point; both sections kept). The runbook's `FINAL`
-predates it — the primary's `main` is the tip to check, not the integration tip. Nothing to
-restart: the MCP is relaunched per Claude Code session, and the live :3001 editor already serves
-`POST /api/media/fetch-window` (every proof below ran against it, from the primary with the merged
-code, through an in-memory MCP client — no yt-dlp by hand).
-
-- **Merged-tree gates:** mcp 269/269 (219 + 50), mcp tsc clean; nothing outside `mcp/` and the docs
- changed after the integration gates.
-- **YouTube window** (`teamrcn/2Xu514rMOAI`, start 10 → end 20, reason "release 10 live proof"):
- 202 → done in 16 s; `data/2Xu514rMOAI/clips/7.00-23.00.mp4` (5,746,423 bytes; pad 3 both sides),
- sidecar `7.00-23.00.json` with `requestedBy: "mcp"` and the reason; `metadata.info.json` kept its
- 07:01 mtime; the job (`01M3FH6T4NKQT5H12CQBREPE1M`, kind fetch-window) polls `done`. The same
- call again: "Already on disk — the exact window" in 0.1 s; a narrower 12 → 15 inside it: "a WIDER
- cached window that contains 9.00–18.00: 7.00–23.00".
-- **Rumble mapping** (`the-quartering-rumble`, cited embed id `vxe1ae`, 83.72 → 86.76): the tool
- posted the slug id — the clip landed in `data/v1007ay/clips/80.72-89.76.mp4` (1,614,518 bytes,
- 13 s), no `data/vxe1ae/` was created. The Rumble window itself downloaded (the 2026-09-24 embedJS
- 403 did not bite this path).
-- **Whole recording** (`full: true`): FIRST attempt on the captions-only `teamrcn/dbnS-cBgStY`
- (`handling: "youtube"`, transcript on disk) was a 7 s no-op — both yt-dlp passes ran with
- `--skip-download` and the job named no file; the tool answered with the planned text ("finished
- but named no file; check the video's page in the editor"). Cause, editor-side and pre-existing:
- the persistence plan with `keepSourceVideoOverride` applies only to transcribe handling or the
- no-captions fallback (`downloadOneManaged.ts:1233-1235`), so `fetchFullSourceAction` (umtool's
- `--full` too) cannot archive the source of a youtube-handling video that already has a
- transcript. It DID rewrite `metadata.info.json` (the full path writes metadata; the window path
- never does). **Low, owed:** full mode on a captions-only channel should either force the media
- step or refuse with one line. SECOND attempt on transcribe-handling `midwestly/
- 79934a667be267dc6b2126cad3fdde79266739da` (Odysee, 49 s): 202 → done in 32 s, file
- `transcripts/saved-videos/midwestly/<id>/source-media.mp4` (6,561,079 bytes), pointer
- `saved-video.json` with `keepReason: "override"` and `origin.requestedBy: "mcp"`; the same call
- again: "Already on disk — the whole recording" in 0.1 s. Side effect of the editor's path, not
- the tool's: the transcribe download also left `audio.mp3` beside the transcript. The `note:`
- prefix fired correctly (midwestly is not in the local Jeralyzer export).
-- **Re-registered** `archilyzer` for this machine with `ARCHILYZER_EDITOR_URL=http://localhost:3001`
- and `WORKER_TOKEN` (from `editor/.env`); `claude mcp get archilyzer` shows both and Connected.
-- **`/ask` proof in a fresh session — DONE (2026-09-26 19:15Z, the "resume parsing" session, Kirsche/Pippa
- sweep):** the ask_plan text carried step 5 "Media for a cited moment — through the editor only" naming
- `fetch_clip`; the agent called it ONCE (`source: remote:https://anilyzer.pages.dev` — it overrode the
- plan's `local:` corpus line because the citation came from Anilyzer; `kirsche/OiVQQFXSp9s`, 8205 →
- 8250, `report` = its sweep manifest) and got done in 47 s: `data/OiVQQFXSp9s/clips/8202.00-8253.00.mp4`
- (7,757,140 bytes, h264 720p + aac, 51.0 s), sidecar `requestedBy: "mcp"` + `manifest`, job
- `01M3FJ90M2WDP4DSDZ6049B5SW` polls done. No yt-dlp by hand. Nothing owed on slice M.
diff --git a/plans/release-11.md b/plans/release-11.md
@@ -1,1930 +0,0 @@
-# Release 11 — release 10's follow-ups, the homepage deploy from `/sites`, umtool's brand fonts, one-core Phase 4 slice 3
-
-`main` at `ee9d41fa` (release 10 fully rolled out as 0.9.4 on 2026-09-28 at 00:53: the five sites,
-the hub `10d6946f` and the homepage `7ca70923`; the :3001 editor restart is still owed). Release 11
-is the overnight session of 2026-09-28, which the operator asked for with all four candidate
-bundles: the lows left by release 10, the homepage deploy from `/sites`
-([`homepage-deploy-from-ui.md`](homepage-deploy-from-ui.md)), umtool's brand fonts, and one-core
-Phase 4 slice 3 ([`one-core.md`](one-core.md), "Phase 4"). Rules:
-`plans/tools/implementer-rules.md`, with the commit trailer this release's prompts give.
-
-**The operator's standing choices for the night:**
-- **Copy:** the three items that need words ship with **draft lines**, one marked `DRAFT`
- constant each in `export/app/ask/hubScopeCopy.ts`, for a morning ruling.
-- **Merging:** each slice merges to `main` after its review. **No cut and no deploy**; an
- unattended build-deploy would publish the merged code with its `[Unreleased]` notes, and the
- operator accepts that.
-- **Cleanup:** the 14 merged worktrees of releases 9–10 were removed first (55 GiB freed;
- `diet-series` kept).
-
-## The slices
-
-| Slice | Branch | What | Owns |
-|---|---|---|---|
-| O3 | `r11/runner-lows` | `resolveMaybeMissingState` reads a newer `error` probe as `maybe_missing` (+ an export check of the presence badge); a failed forced download keeps the subtitle pass's status; the `cookies-mode.spec:241` flake (keep the run log mounted); cut-release review lows L3 + L4 | `common/lib/availability*.ts`, the maybe-missing part of `buildIndex.ts`, `downloadOneManaged.ts`, `DownloadStage.tsx`, `common/controller/cutRelease.ts`, `api/ops/cut-release` |
-| O4 | `r11/homepage-deploy-ui` | The homepage's build and deploy from `/sites`: three job kinds, the refusals, a Homepage section, `pnpm ops build-homepage` / `deploy-homepage` | `editor/app/sites/**`, the two new ops routes, the job-kind entries, `scripts/archilyzer-ops.mjs` verbs, `builtHomepageProblem` |
-| O1 | `r11/hub-lows` | A "built-ins loaded" flag; three DRAFT copy lines (a zero-archive `/ask`, a member's missing live chat with a subs-only Retry, "Searching N of M archives"); `normalizeSocialSvg` fills children; `mcp/README.md`'s `fetch_clip` env lines | `export/app/ask/**`, `export/app/components/hub/**`, `SearchDataContext.tsx`, `siteRegistry.ts`, `normalizeSocialSvg`, `mcp/README.md` |
-| O2 | `r11/homepage-lows` | A custom hex fitted per base on the homepage cards; a 6th validated chart slot; a forced-colours fallback for the mark ring; the homepage e2e fixture copy | `homepage/app/components/*`, `common/lib/siteColor.ts` / `homepageChart.ts` / `homepageChartData.ts`, `BrandMark.tsx`, the homepage e2e setup |
-| O5 | `r11/umtool-fonts` | The rail, ledger and chart text in Plex Sans under the brand preset; a vendored bold IBM Plex Mono; an unbranded render byte-identical | `umtool/report-to-video/**` |
-| O6 | `r11/phase-4-s3` | `archilyzer doctor`, `run <operation>`, `mcp`; `PUBLISH.md` absorbing `DEPLOY_DOCKER.md` + `DEPLOY_CLOUDFLARE.md`; the env-var docs; the `E2E_` prefix cleanup LAST | `common/bin/archilyzer.ts`, the docs, then the playwright configs + helpers |
-
-**Waves:** O3 ‖ O4 ‖ O6 (the marathon) first; O1 ‖ O2 as the first two merge; O5 last. O6
-merges `main` once O1–O5 have landed, then does its `E2E_` rename. Then one integration gate on
-`main`, and the morning runbook (`~/reports/overnight-2026-09-28/MORNING.html`).
-
-**Priority if the night runs short:** O3 > O4 > O1 > O2 > O5 > O6's remainder.
-
-## Record
-
-### Slice O4, as shipped — deploy the homepage from /sites (2026-09-28)
-
-The operator's ask (2026-09-26): **"Is there a way to redeploy archilyzer.pages.dev from the UI?"**
-There was not: `/sites` built and deployed the hub, and the homepage was a CLI
-(`archilyzer build|deploy homepage`) with no job, no `/jobs` row and no `pnpm ops` verb. Plan:
-[`homepage-deploy-from-ui.md`](homepage-deploy-from-ui.md), decisions 1–5, now with an "As shipped"
-note. Branch `r11/homepage-deploy-ui` off `main` `2162db92`, worktree
-`/home/user/Projects/r11-homepage-deploy-ui`, one Opus implementer. Scratch files `o4-*` in the
-job's `tmp/overnight`.
-
-**What shipped.**
-- **A Homepage section on `/sites`, after Hub.** The Hub paragraph lost its homepage sentence, and
- the new section says it instead: the `homepage` package, `homepage/out`, the project `archilyzer`,
- and the same code as `archilyzer build|deploy homepage`. Its group, **Homepage build**, is
- `HubBuildButtons`' shape: **Build homepage**, **Deploy after build** (unticked), **Deploy
- homepage**, one `JobLane` at a time (**Build homepage** / **Build & deploy homepage** /
- **Deploy homepage**).
-- **A preview branch box** (textbox "preview branch", empty = production). It is judged by
- `previewBranchProblem`, the function the action and the route refuse with. A bad name greys out
- Deploy homepage, and Build homepage when Deploy after build is ticked, and shows the sentence
- (`role="status"`, "preview problem").
-- **One line saying what a deploy ships:** "Deploy homepage ships `homepage/out`, built <when>, to
- `archilyzer` (production): https://archilyzer.pages.dev." (`PROJECT_URL`). With no build it says
- "`homepage/out` holds no build yet …". With a preview it gives the alias and says "the live site
- is left alone". Under it: the homepage reads the index as it stands, so run Build index first.
-- **Three job kinds,** via `runManagedFunction` in `editor/app/sites/lib/homepageDeployActions.ts`:
- - `build-homepage` on queue `build`;
- - `deploy-homepage` and `build-deploy-homepage` on queue `deploy`;
- - the bodies are `buildHomepage` / `deployHomepage`, unchanged. The build-deploy deploys only
- on exit 0.
-- **Refusals before any job:** a bad preview name, and for a deploy-only,
- `builtHomepageProblem(homepageOutDir(paths))` ("homepage/out holds no build — build the homepage
- first"). `deployHomepage` re-checks both inside the job with its own sentences, untouched.
-- **Ops:**
- - `/api/ops/build-homepage` `{deploy?, preview?}`: a preview without deploy is a 400.
- - `/api/ops/deploy-homepage` `{preview?}` answers `previewUrl` =
- `previewAliasUrl(HOMEPAGE_PAGES_PROJECT, preview)`.
- - `pnpm ops build-homepage` / `deploy-homepage`, in the verb list, the header examples and the
- usage.
-- **common:** `builtHomepageProblem` and `builtHomepageAt` (index.html's mtime) beside
- `builtHubProblem` in `builtExport.ts`. `homepageOutDir(paths)` exported from `publish/build.ts`,
- so the editor does not re-derive the path.
-- **Found and fixed: `JobLane` under Strict Mode.** The launch effect gated its updates on a flag
- local to it, set by its cleanup. `next dev`'s mount → cleanup → mount set that flag, and the
- second run returned early on `startedRef`, so the job ran while the lane sat on "Starting…"
- forever. Liveness is now a ref kept by its own effect. Production mounts once and is unchanged.
- No spec had ever clicked a lane button (batch, specific sites, hub), which is how it went unseen.
-
-**Corrections to the plan** (also in its "As shipped" note):
-- The ops preview is `--json '{"preview":"<b>"}'`, not a `--preview` flag.
-- No `jobKinds.ts` entries: the hub's kinds have none, and neither does any publish kind.
-- `homepageOutDir` had to be exported.
-
-**How nothing in e2e builds or deploys.** There is no fake wrangler, `homepage/out` is the
-checkout's own directory (the primary's holds the live homepage's build), and the hub's buttons have
-no spec to copy. So:
-- **No spec clicks Deploy homepage.** None ticks Deploy after build and then clicks Build.
-- **Build homepage is clicked only with the `build` and `deploy` queues both held** by
- `/api/test/stuck-job`, which is never released in the spec. The `build-homepage` job only
- queues, and so would a `build-deploy-homepage` if the click regressed into one. The spec cancels
- it from its lane. Its `start()` never runs: no log file, no child, nothing written under
- `homepage/`.
-- **If that spec fails before its Cancel,** the next `resetData` cancels live jobs newest first
- (`registry.list()` sorts by `queuedAt` descending). The queued build is removed before the
- holder's slot is freed, so nothing is ever promoted.
-- **The deploy-homepage refusals run with both queues held the same way** (`holdBuildAndDeployQueues`
- in `ops-api.spec`). A build or deploy that a refusal failed to stop would only queue, and the
- spec's job-list check would fail.
-- **The missing-build refusal is asked only when the checkout has no `homepage/out/index.html`,** as
- `deploy-hub`'s is (`211d4666`), and it is asked as a preview.
-- **Checked after every run:** the worktree has no `homepage/out`, and `homepage/public` holds only
- its tracked `_headers`. Its gitignored data was not copied, because nothing here builds the
- homepage.
-
-| sha | what |
-|---|---|
-| `b047b1be` | `common:` `builtHomepageProblem` + `builtHomepageAt` (`builtExport.ts`), `homepageOutDir` (`publish/build.ts`); +3 unit tests |
-| `7ba41164` | `sites:` `homepageDeployActions.ts`, `HomepageBuildButtons.tsx`, the Homepage section; the Hub paragraph loses its homepage sentence |
-| `54021099` | `ops:` `/api/ops/build-homepage`, `/api/ops/deploy-homepage`; `archilyzer-ops.mjs` verbs + usage (+1 test) |
-| `ba4ff0bb` | `e2e:` `ops-api.spec` +1 (the refusals), `sites-homepage.spec` (3) |
-| `d52d017d` | `sites:` `JobLane` survives Strict Mode |
-| `d9218cb7` | `sites:` the group stamps `data-hydrated`; the specs wait for it |
-| `40b6a0d7` | `changelog:` `[Unreleased]` above `[0.9.4]` in `editor/CHANGELOG.md` |
-| `ff8b9382` | `plans:` this record; the plan's "As shipped" note |
-| `72175134` | `e2e:` review fix — the homepage refusal test, the Build homepage test and the hub's refusal test hold both the `build` and the `deploy` queue |
-| `275c0fa6` | `common:` review fix — `deployHomepage` ships `homepageOutDir(paths)` (no behaviour change) |
-| _this_ | `plans:` the review fixes in this record and the plan's note |
-
-**Gates** (logs `o4-*.log`):
-- **tsc** clean before every code commit (the last run on `d9218cb7`'s tree).
-- **common 2,041/2,041** (2,038 + 3), editor unit **85/85**, `test:scripts` **175 + 1 skipped**
- (174 + 1, +1), mcp **269/269**.
-- **Editor build** ok (59 s); `/api/ops/build-homepage` and `/api/ops/deploy-homepage` are in the
- route list.
-- **e2e:**
- - Run 1 on `ba4ff0bb` (`ops-api`, `sites-homepage`, `sites-crud`, `site-publish-preview`,
- `deploy-page`, `build`, `settings`): **63 passed, 1 failed** (2.8 min). The failure was
- `sites-homepage`'s Build homepage test: the lane stayed on "Starting…", which is the `JobLane`
- bug above.
- - `sites-homepage` ×3 with the old `JobLane`: **6 passed, 3 failed**.
- - The same ×3 on `d9218cb7`: **9 passed** (27 s).
- - The final list on `d9218cb7` (the same seven specs): **64 passed** (1.8 min).
- - After the review fixes, on `275c0fa6`: `ops-api` + `sites-homepage` **26 passed** (40.5 s).
- tsc was clean, common 2,041/2,041 and `build.test.ts` 10/10. The worktree still has no
- `homepage/out`.
- - No spec here greps `deploy-hub|build-hub|HubBuild` except `ops-api`, which is in the list.
-- **Numbers tool:** none.
-
-**They bite:**
-- **Unit, against `2162db92`'s source:**
- - `builtExport.test.ts` and `build.test.ts` fail to load (no `builtHomepageAt` /
- `homepageOutDir` export).
- - A mutation, `builtHomepageProblem` checking the directory instead of `index.html`, fails 1 of 8.
- - `archilyzer-ops.test.mjs` against the old script: 1 of 33 fails, the new test.
-- **e2e, against `2162db92`'s `page.tsx`, `builtExport.ts` and `build.ts`,** with the new action,
- component and routes moved out: **4 of 4 new tests fail.** `ops-api` hits a 404 page ("Unexpected
- token '<'"), and `sites-homepage` finds no Homepage group. The tree was restored by a trap
- afterwards.
-- **The `JobLane` fix:** the Build homepage test fails 3 of 3 with the old lane and passes 3 of 3
- with the fix.
-
-**Review fixes** (review: SHIP AFTER FIXES, `o4-review.md`):
-- **Should-fix 1, one queue held where a regression could reach the other.** The deploy-homepage
- refusal test held only `deploy`. A regressed "preview needs deploy" guard would have run a real
- `build-homepage` there: in the primary checkout, compose writes fixture numbers into
- `homepage/public`, then `next build` runs. The Build homepage test held only `build`, so a click
- turned into build-and-deploy would have reached `deploy`. Both tests now hold both queues. So does
- the hub's `deploy-hub` / `build-hub` refusal test (the review's low 4). That test **predates this
- slice** (release 7) and held nothing. In `ops-api.spec` the holds sit in one helper,
- `holdBuildAndDeployQueues`, and `before` is taken after them.
-- **Low 2:** `deployHomepage` now takes its directory from `homepageOutDir(paths)`. This is a pure
- refactor, and what it ships is exactly the directory the editor judged "built".
-- **Low 3** (the "built <when>" line does not refresh after an in-page build) is left as recorded
- below.
-
-**Found and left**
-- **A job cancelled while still queued keeps `"status":"queued"` in its `.meta.json`.** The
- `onCancel` path never rewrites the sidecar. The registry says cancelled, and the boot pass settles
- the sidecar. This is pre-existing and was not touched.
-- **The "built <when>" line is read when `/sites` renders,** so a lane that finishes a build does
- not refresh it. The Hub's lanes do not refresh the page either.
-- **`/jobs` shows the three kinds by their raw names,** as it does the hub's.
-- **Nothing has been built or deployed through the new jobs:** no build and no deploy tonight, by
- rule. The proof is the rollout below.
-
-**Rollout (owed):** the section and the routes exist only on an editor built from this code, so it
-waits on the :3001 restart. After it:
-1. **Build homepage** with Deploy after build unticked, or `pnpm ops build-homepage --wait`.
-2. **Deploy homepage**, or `pnpm ops deploy-homepage --wait`. The job's log ends with
- `[deployed] https://<hash>.archilyzer.pages.dev`.
-
-### Slice O3, as shipped — runner lows (2026-09-28)
-
-Branch `r11/runner-lows` off `main` `2162db92`, worktree `/home/user/Projects/r11-runner-lows`, one
-Opus implementer, beside O4 and O6. Four lows left by release 10: one from L2 ("New low"), one from
-slice N's review (L2) and its knock-ons, the `cookies-mode.spec:241` intermittent N's full suite
-found, and slice P's review lows L3 + L4. No settings, site or channel key; nothing on disk moves.
-`CutReleaseResult.written` and an always-set `CutReleasesOutcome.untouched` are additive.
-
-**1 — a failed confirm probe no longer clears "Missing?"** (`common/lib/availability-server.ts`).
-- `resolveMaybeMissingState` decides the published state of a video that fell out of its
- channel's listing. A probe made after the scan that came back `public` clears the flag; so did
- one that came back `error`, through `stateFromAvailability`'s `error` → `available` fold. An
- `error` probe (a 403, a network failure, the bot check, a blocked run's one rate-limited probe)
- never saw the video, so it is no evidence it is there. It now leaves the video `maybe_missing`,
- like one never probed. `needs_auth` after the scan still confirms: an age gate is the video
- answering.
-- **Display only, and the clean gate is untouched — proof.** `grep -rn resolveMaybeMissingState`
- over the whole repo (not `node_modules` or `.next`) finds one caller, `buildIndex.ts:1180` (the maybe-missing overlay →
- `stateByIndexKey` → a site's summaries pages and the `videoState` sub-DB the status chart
- reads), plus `videoState.test.ts`. The diff to `availability-server.ts` is the one line and its
- comment; `resolveEffectiveAvailability`, which `verifyBeforeClean` and the MtimeRecord read, is
- not in it.
-- **The export check** is `common/controller/maybeMissingBuild.test.ts` (new), which runs the REAL
- `buildIndex` over a temp corpus: one video per outcome of the overlay, and the `state` each gets
- on the site's `summaries/page-0000.json` — the field the export's badge and Availability filter
- read. `export/e2e/availability-state.spec.ts` was NOT extended: it fulfils the summaries with
- mocked `state`s, so a new case there could not see the fix; it was re-run (9/9) as the contract
- check that `state: "maybe_missing"` still draws "Missing?". The shared transcript pages carry no
- `state` (found while writing the test).
-- **The real count, read-only** (`o3-flip-count.ts` in the job scratch dir, `o3-flip-count.log`: reads
- `maybe-missing.json`, `availability.json`, `download-outcome.json`, `metadata.info.json`'s
- existence and `sites/*/site.json` through the build's own loaders; opens no LMDB, writes nothing):
- 1,827 maybe-missing ids in 31 channels; **5 videos across 2 channels move from available to
- maybe-missing at the next index build** — `rekietalaw-rumble/v7e07us` and
- `the-quartering-rumble/v4vriou v4x5o1l v4yqask v501kfc`. Per site: **jeralyzer 4** ("Missing?"
- 212 → 216), **rekietalyzer 1** (0 → 1), anilyzer, bonnellyzer, hasanalyzer and jasolyzer 0. All
- five are Rumble probes that got `HTTP Error 410: Gone` on 2026-09-25 and were stored as `error`,
- hours before `6d5cdbc3` taught the classifier that 410 is `deleted`; they are really deleted, and
- "Missing?" is closer than "available". A "Full-check unexpected" on those two channels would
- settle them as Deleted (the operator's call; nothing was run). *Done 2026-09-28 13:32Z, on the
- operator's word: all five read deleted — "Operator actions (2026-09-28 morning)", below.*
-
-**2 — a failed forced download keeps the subtitle pass's status** (`common/ytdlp/downloadOneManaged.ts`).
-- The attempt-3 `else` set `status = "failed"` and `lastSucceeded = false` for a `keepTranscript`
- pass too, so a "Persist source video", `fetch_clip` `full: true` or Persist kept now whose MEDIA
- failed put "Download failed" on a video whose transcript is fine. A `keepTranscript` failure now
- keeps the status (the subtitle pass's `ok` / `ok-with-cookies`) and `lastSucceeded`, so the
- archive line the subtitle pass printed is appended as on the success path; the failed n: 3
- attempt is recorded with its error (no `failureClass`: the download did not fail). One log line:
- `forceMedia: the source download failed (yt-dlp exit N); the transcript on disk is untouched and
- the download stays ok. Left for a retry to resume: source-media.f137.mp4.part (<size>).`
-- **Knock-on 1, fixed: the job reports it.** `sourceFetchFailure(record)` (exported) says whether a
- download asked for the source got it: the status for an outright failure, the last attempt for a
- failed forced pass. `archiveSourceVideo` (`videoActions.ts`, both "Persist source video" and
- `fetchFullSourceAction`) throws `The source video was not downloaded: <yt-dlp's line>` after its
- revalidate, so the job ends `failed` and the poll's `error` tail carries the line; the MCP renders
- "Editor job … failed" with it instead of "finished but named no file". A download that failed
- outright ends the job `failed` too (before: `done`).
-- **Knock-on 2, left on purpose: the `.part`.** yt-dlp resumes a partial container on a retry, and
- deleting one that is several GB makes a retry after a network blip start over — more requests
- against the source, which the pacing rules want fewer of. Nothing else surfaces a
- `source-media.*.part` (the Partial downloads bucket matches `audio.<ext>.part` only), so the log
- line names it and its size instead.
-
-**3 — the `cookies-mode.spec:241` intermittent** (`DownloadStage.tsx`, `RetryBucketControl.tsx`).
-- The mechanism is wider than the end-of-run refresh: `recordTaskDone` → `requestSnapshotOnFinish`
- regenerates the snapshot after EACH video a batch finishes, the pulse moves and `AutoRefresh`
- refreshes the page while the run still streams. The refreshed `NeedsCookiesList` got an empty
- bucket and returned null, and so did the `RetryBucketControl` in it — two unmounts, either
- enough to lose the log.
-- The FACTS shape, in both: `ranHere` set inside the trigger (`RetryBucketControl` also calls a new
- optional `onRun` so its card knows), null only while `ids.length === 0 && !ranHere`, and
- `disabled={ids.length === 0}` so the surviving panel is not a second Run button. Applied to all
- three bucket cards on the Download stage (`NoTranscriptList`, `PartialDownloadsList`,
- `NeedsCookiesList`, same hazard) and to `RetryBucketControl` itself. Beyond the Download stage
- it reaches one more control: the Transcribe stage's **Fetch audio** (its section stays mounted
- while `autoSubsCount > 0`, and a fetch moves videos from "Needs audio" to "Ready to transcribe").
- It does NOT reach Diagnostics: both of its grids drop an emptied bucket's whole card
- (`DiagnosticsStage.tsx:156` `populated`, `:694` `listed`), control and log with it (corrected in
- review; see Review fixes). A reload drops an empty card as before (the reload check at the end of
- the same test still passes); labels and test ids unchanged.
-- **Made deterministic.** The spec now waits for the refreshed, EMPTY card (`needs cookies empty`,
- which renders only inside a card that survived the refresh) and asserts the log's last line and a
- disabled `Download with cookies (0)` in it. On the old code this fails every time, at that line
- (below).
-
-**4 — cut-release review lows L3 + L4** (`common/controller/cutRelease.ts`, `api/ops/cut-release`).
-- **L3:** `applyCut`'s commit failure returns `{ok: false, workspace, error, written: true}` — the
- file on disk has its new heading. The route revalidates whenever anything was written.
-- **L4:** `cutReleases` sets `untouched` on EVERY outcome (true = no changelog written, every refusal
- included; false once one was, a `written` failure included); the type keeps it optional only so
- the CLI's hand-built display tests compile, and absent reads as false. `describeCutFailure`
- builds the route's 400 `error`: the failure (prefixed `<workspace>: ` for `all`), then `Before
- it, editor was already cut (## [0.9.5] - 2026-09-28, committed 1a2b3c4d).` Every 400 from the
- writer carries `untouched`. An `all` whose FIRST write fails wrote nothing and is `untouched: true`, so the CLI
- prints "not cut — all cuts both or neither, and nothing was written" for the export — true.
- The input refusals before the writer (a bad workspace, version, date or key) are the ops door's
- 400s and carry no `untouched`, as before.
-- The CLI (`common/bin/release.ts`) is unchanged: its per-line output already named the earlier cut
- and says "failed — Cut release X, but the commit failed" for L3.
-- **The `/sites` form** (`editor/app/sites/lib/cutReleaseAction.ts`) revalidates on `written: true`
- too. It is under `editor/app/sites/**`, which slice O4 owned tonight, so it landed after O4's
- merge (Review fixes).
-
-| sha | what |
-|---|---|
-| `877403db` | 1: `resolveMaybeMissingState` — `error` after the scan stays `maybe_missing`; `videoState.test.ts` +2, `maybeMissingBuild.test.ts` (new, 1) |
-| `8c72265c` | 2: the `keepTranscript` failure keeps the status; `sourceFetchFailure`; `archiveSourceVideo` fails the job; `forceMedia.test.ts` +2; the fake's `.fake-ytdlp-media-fail` knob; `fetch-window.spec.ts` +1, `persist-youtube-handling.spec.ts` +1 |
-| `86449b88` | 3: `ranHere` / `onRun` / disabled in `RetryBucketControl` and the three Download-stage bucket cards; `cookies-mode.spec.ts:241` made deterministic |
-| `edec55ca` | 4: `written`, always-set `untouched`, `describeCutFailure`, the route; `cutRelease.test.ts` +4 (1 changed); `ops-cut-release.spec.ts` pins `untouched` |
-| _this_ | `plans:` this record, FACTS (three amendments, one new section), the `[Unreleased]` bullets |
-
-**Gates**, from the worktree root; logs `o3-*.log` in `$T`.
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) clean before each code
- commit: `o3-tsc1` (item 1), `o3-tsc3` (items 2 + 3, item 4 stashed), `o3-tsc4` (item 4).
-- **common 2,047/2,047** (release 10's 2,038 + 9: videoState +2, maybeMissingBuild +1, forceMedia
- +2, cutRelease +4); **editor unit 85/85**; **`test:scripts` 174 + 1 skip of 175**; **mcp
- 269/269** (`o3-units1.log`, on `edec55ca`).
-- **Editor build** `pnpm --filter editor exec next build` ok, 55 s (`o3-build1.log`; the route table
- lists `ƒ /api/ops/cut-release`). **Export build not run**: nothing under `export/` changed but
- its CHANGELOG.
-- **e2e** (queued, detached, `export/public` linked per path from the primary with `sw.js` a plain
- copy, no dangling links; the lock was free each time):
-
- | run | specs | passed | failed | time |
- |---|---|---|---|---|
- | A | `cookies-mode maybe-missing persist-youtube-handling fetch-window saved-videos cut-release ops-cut-release retry-bucket partial-downloads-bucket auto-subs-replace bulk-actions no-subs-fallback storage-locations` (`o3-e2e-specs.txt`: the prompt's seven, the four that drive a retry-bucket control, and the two that drive the source-media branch) | **61** | **0** | 3.9 min |
- | B | `cookies-mode.spec.ts --repeat-each=3` | **18** | **0** | 1.8 min |
- | C | EXPORT `availability-state.spec.ts` | **9** | **0** | 30 s |
-
- `archives-off.spec.ts` draws no state badge, so it was not added. The primary's
- `export/public/sw.js` was not written (md5 `355d0d21…`, mtime 00:51:32, before and after).
-- **Numbers tool:** `o3-flip-count.ts` (item 1), above.
-
-**They bite.**
-- Unit, item 1 (`o3-bite1.log`): with the `error` line reverted, `maybeMissingBuild.test.ts` fails
- and `videoState.test.ts`'s "error, probed AFTER the scan" fails; 15 others pass.
-- Unit, items 2 + 4 (`o3-bite2.log`): with the `keepTranscript` branch removed, forceMedia's new
- behaviour test fails (the `sourceFetchFailure` table test is of a new function); with `written`
- and the always-set `untouched` reverted, 5 of 20 cutRelease tests fail (the four new and the
- changed half-way test).
-- **e2e** (`o3-e2e-bite.log`): the six source files at their `2162db92` versions, the new specs and
- fake kept; `fetch-window persist-youtube-handling cookies-mode ops-cut-release`: **16 passed, 4
- failed, 2.5 min**, and the four are exactly the new and changed tests —
- `cookies-mode.spec.ts:241` at `getByLabel("needs cookies empty")` (the card is gone),
- `fetch-window.spec.ts:465` (`done`, not `failed`), `ops-cut-release.spec.ts:73`
- (`untouched` undefined), `persist-youtube-handling.spec.ts:182` (no failure line; the old run
- marked the download failed). Restored with `git checkout HEAD --`.
-
-**Found and left.**
-- ~~`persistKept` still counts a returned download as persisted~~: done in the review fixes.
-- **L3/L4 have no HTTP e2e for the half-way cases.** The fixture server's changelogs are gitignored
- copies, so a commit there fails only after the dirty-tree guard has run git in the WORKTREE, and a
- failed write needs a read-only directory the server's path cannot be pointed at. The controller's
- tests drive both in temp repos (a refusing pre-commit hook; a `0555` directory); the spec pins
- `untouched: true` on a refusal.
-- **A Diagnostics card after its run.** A Diagnostics retry that empties its bucket still loses
- its card and its log: `DiagnosticsStage.tsx:156` / `:694` filter emptied buckets out before the
- control renders. The follow-up is to lift a ran-bucket set into both sections and keep those
- cards in `populated` / `listed`.
-- **The five 410 videos** are published as available today and will read "Missing?" after the next
- build; a Full-check unexpected would make them Deleted. *Ruled and done 2026-09-28 13:32Z: the
- full check read all five deleted, so they publish as Deleted, not "Missing?".*
-
-**Review fixes** (review SHIP AFTER FIXES, `o3-review.md` in the job scratch dir: one should-fix, wording only; three
-lows; one nit; the three questions ruled — keep `archiveSourceVideo`'s failure broad, staying
-mounted is fine as a rule, keep `untouched` optional tonight).
-- **Merge.** `export/.next/dev` removed first (run C's export dev server had left stale types there,
- so `tsc` failed in `export/` — low 3, environment only), then `git merge main` at `baaa4b47` (O4
- merged). Conflicts only in `editor/CHANGELOG.md` (one `[Unreleased]`: O4's two bullets, then
- O3's three) and this file's Record (O4's section, then O3's).
-- **The deferred `/sites` form change.** `cutReleaseAction` revalidates when the result is
- `written: true`, then returns the error as before. The reviewer read it as correct and complete;
- no e2e can make the fixture server's commit fail after the write, so tsc and the controller's
- tests cover it, and `cut-release.spec.ts` re-ran green.
-- **should-fix — the Diagnostics claim was false.** The record and the changelog said the Diagnostics
- buckets' retry controls keep their log; both Diagnostics grids drop an emptied bucket's card, so
- they do not. Item 3 above, the editor bullet ("The Transcribe stage's "Fetch audio" button does the
- same. (A Diagnostics card still disappears…)"), FACTS and found-and-left now say exactly what is
- covered: the Download stage's three cards and the Transcribe stage's Fetch audio.
-- **low 1 — `sourceFetchFailure`'s order.** A no-subs fallback that fetched and persisted the source
- and whose inline whisper then failed ends the download `failed`; reading the status first called
- that source "not downloaded". When the last attempt is the media pass, its exit code alone
- answers now; otherwise the status. Latent here (`inlineTranscribeOnFallback` is off on the
- primary).
-- **low 2 — `persistKept`.** It counted every returned download as `persisted`; it now reads
- `sourceFetchFailure` and counts a failed forced pass as `failed`, with the reason in its log.
-- **nit.** The inert `key="retry"` on the Download stage's three retry controls is gone.
-
-| sha | what |
-|---|---|
-| `0c770285` | merge `main` (`baaa4b47`, O4): the changelog and Record conflicts |
-| `f62d00f1` | the Cut release form revalidates on `written: true` |
-| `e9947421` | low 1: `sourceFetchFailure` reads a media-pass last attempt first; `forceMedia.test.ts`'s table +1 row |
-| `315c76e1` | low 2: `persistKept` counts a failed forced pass as failed; `persistKeptForceMedia.test.ts` +1 (setup made one helper with a process-wide settings file) |
-| `5c9987d2` | nit: the inert keys dropped |
-| _this_ | `plans:` these fixes, the corrected wording (record, changelog, FACTS) |
-
-**Gates on `5c9987d2`:**
-- tsc clean after the merge (`o3-tsc5.log`) and on the fixes (`o3-tsc6.log`); every fix commit is a
- disjoint set of files from that tree.
-- common **2,051/2,051** (2,041 on `main` after O4, + O3's 10), editor unit **85/85**,
- `test:scripts` **175 + 1 skip of 176**, mcp **269/269** (`o3-round2.log`).
-- e2e `cut-release ops-cut-release persist-youtube-handling fetch-window saved-videos cookies-mode`
- (`o3-e2e-specs2.txt`, `o3-e2e2-full.log`): **28 passed, 0 failed, 1.3 min**, no queue wait.
-- **They bite** (`o3-bite3.log`): with the old order in `sourceFetchFailure`, the table test fails on
- the new row; with `persistKept` counting every return, the new persistKept test fails; the other
- 8 in the two files pass.
-
-### Slice O6, as shipped — one-core Phase 4 slice 3 (2026-09-28) — checkpoint A
-
-Branch `r11/phase-4-s3` off `main` `2162db92` (no later `main` to merge before the first commit),
-worktree `/home/user/Projects/r11-phase-4-s3`, port block #6, one Opus implementer. The spec is
-[`one-core.md`](one-core.md) "Phase 4", items 2 (the rest) and 3. Checkpoint A is everything but
-the `E2E_` prefix cleanup, which is checkpoint B, after O1–O5 land.
-
-**The CLI's last subcommands.**
-- **`archilyzer doctor [--json]`** (`common/bin/doctor.ts`). One read-only report over what was
- spread across `paths.ts`, umtool's doctor and `scripts/worktree.mjs`:
- - workspace: node against next's `>=20.9.0`, the checkout, `node_modules`, the path overrides set;
- - corpus: channel count, each channel's media through `inspectChannelMedia`, the LMDB index by
- `stat` only;
- - settings: `settings.json` present, a JSON object, loads (`settingsFromFile`, new in
- `settings.ts`: getSettings' body for a named file);
- - tools: every binary `paths.ts` names, plus each enabled local worker's engine, `parakeet-cli`
- and model (looked up on PATH, not run);
- - umtool's report-pipeline table (read from `umtool/lib/tools.mjs` by a runtime import of the
- file; common does not depend on umtool);
- - the port block (asked of `scripts/worktree.mjs ports`), each port free or in use by a TCP
- connect.
- - A FAIL exits 1. It is something the machine is configured to do and cannot: a settings file
- that is not a JSON object (every process silently reads defaults), an enabled worker's engine or
- model missing BESIDE a corpus, yt-dlp/ffmpeg/ffprobe missing beside a corpus, a binary an env
- override names explicitly, node too old, no `node_modules`. Everything else warns or notes. A
- clone with no corpus is not broken, and an engine missing there is a warning.
- - Strictly read-only: no LMDB open, no mkdir, no settings write, no bind. The one process-state
- change is a `chdir` around umtool's table (it resolves `facecrop.py` from the cwd), restored
- at once.
-- **The probe exists once.** `common/lib/toolProbe.mjs` is umtool's `probeOne` lifted out (plain
- ESM, exported); `umtool/lib/tools.mjs` keeps its table and calls it. `probeTools()` output was
- byte-identical before and after (`o6-umtool-probe-{before,after}.json`, `cmp`).
-- **`archilyzer run <operation> <channel> [ids…] [--lane local|remote]`**
- (`common/bin/run-operation.ts`) calls `runOperationChannelJob`, the body the /channels
- buttons, the stage cards and the lane runners call. So a run is a real `backfill-channel` /
- `digest-channel-*` job: its record and log under `.jobs/`, the same summary line, the channel
- snapshot flushed at the end, and `runManagedFunction`'s media guard (a refusal before any record
- exists).
- - **Runs:** diarization, attribution-diarized, attribution-text, digest (the four registry
- operations).
- - **Refused with a sentence read off the descriptor:** sync, metadata-scan, download (the
- per-platform download queue paces every request to one source inside the editor), and
- transcription (the editor's worker pool).
- - **Refused up front:** an unknown operation (with both lists), an unknown channel, an
- operation switched off in settings, a paused lane (the batch would idle-wait for a resume
- only the editor can give), and `--lane` off digest. Ids with no data dir are named.
- - Ctrl-C cancels the job. Exit 0 done, 1 failed or refused, 2 usage, 130 cancelled.
- - Different from the editor's run, and said in the file's header: it does not see the editor's
- transcription activity, so the backfill lane's yield-to-transcription does not apply.
- - To carry ids, `runDigestChannelJob` gains `ids` (as the backfill job has; into
- `spec.params`), `runOperationChannelJob` passes `ids` to both runners, and the editor's
- digest replay forwards them through `digestChannelAction`, so a replayed scoped run cannot
- widen to the channel.
-- **`archilyzer mcp [args…]`** (`common/bin/mcp.ts`) starts the MCP server as `pnpm --filter
- yt-dlp-transcript-mcp exec tsx src/index.ts` does: mcp's tsx, cwd `mcp/`, env passed through. It
- is a child process, not an import. Nothing is printed on stdout.
-- **`pnpm archilyzer <command>`** is a new root script for the long form. pnpm prints its `$ …`
- line on stderr, so `-- pnpm -C "$PWD" archilyzer mcp` is a clean MCP registration (initialize
- handshake checked through it).
-- **Every bin is a subcommand.** `_cli.ts` gains PASSTHROUGH rows. They are matched on the leading
- words only, and everything after the path is handed on verbatim.
- - In-process: `build stats|templates|archives`, `docs env|files`, and `brand media` (with its
- argv).
- - As children with their own flags (`_spawnBin.ts`): `duplicates` (with the 8 GB heap its script
- had), `posts fetch|check`, `diarize backfill`, `digest plan|validate`, `reconcile video-dirs`,
- `verify transcripts`, `transcribe` (`transform.ts`; deleted with its row in the review
- round, `9424d357`) and `migrate channel-priority`.
- - A test fails when a file in `common/bin/` has no row.
-- **package.json.**
- - Kept: the scripts the publish pipeline runs by name: export's `build:index`, `build:stats`,
- `build:templates`, `build:archives`, `compose:site` and `compose:hub` (`build.ts`'s steps and
- docker Phase A), and homepage's `build:index` and `compose`. They keep their names and heaps
- and now call `archilyzer <row>`. Each was checked with `pnpm run <script> --help` (it prints
- its row), and `build:data` + `compose:site` + `compose:hub` were smoke-run on a scratch corpus
- (all exit 0).
- - Removed: export's `detect:duplicates` (no referrer; it is now `archilyzer duplicates`).
- - Kept, with the reason: root `build:index` / `sync:tick`. They are one-line CLI aliases, and
- `sync:tick` is the documented cron line (SCHEDULED_SYNC.md, the editor's sync console copy,
- SETTINGS.md), so removing it would silently break an operator's crontab.
- - `docker/build-site.sh` and `publish-site.sh` still parse (`sh -n`) and name `build site`,
- which exists.
-
-**Ports exist once.** `common/lib/ports.mjs` is the table (name, base, what for), with
-`OFFSET_STEP`, `portsForOffset` and `portFor`.
-- `scripts/worktree.mjs` imports it, and gains the three e2e ports it never offset: `HUB_PORT`,
- `ORIGIN_B_PORT`, `HUB_A_PORT`.
-- `sync tick`'s default URL and the doctor read it.
-- Two places cannot import a module, and `ports.test.ts` reads them as text and fails on a
- mismatch or an undeclared port:
- - a package.json script's `${NAME:-N}` (a shell line);
- - the `--ports NAME:N` list handed to queue-lock (its syntax is shared with older checkouts).
-- The playwright configs and e2e helpers still spell their fallbacks, held by the same test. B
- points them at the module, since it edits them anyway (homepage's is O2's tonight).
-- Not in the table: the client default URLs (`mcp/src/fetchClip.ts`, umtool's tag route,
- `archilyzer-ops.mjs`) and the container's ports.
-
-**Config and docs.**
-- **Env vars, declared once.** `common/lib/envVars.ts` lists every variable the apps' code
- reads, by audience:
- - `paths` (exactly what getPaths reads);
- - `runtime`;
- - `port` (generated from ports.mjs);
- - `internal` (set by the pipeline);
- - `docker` (the `ARCHILYZER_*` set);
- - `test`.
-- `ENVIRONMENT.md` is generated from it (`archilyzer docs env [--check]`). `envVars.test.ts`
- holds the list to the code in both directions: every `process.env.X` / `env.X` read under
- common/, editor/, export/, homepage/, mcp/src and scripts/ is declared, and every entry is
- still named somewhere outside the list (a mention, not a proven read). *(Review S1: as first
- shipped, that second test counted `envVars.ts` itself as a mention and could not fail; fixed in
- `8bea5844`, which also checks every `ARCHILYZER_*` name in docker/, the Dockerfiles and the
- compose files is declared.)* umtool's own knobs stay in umtool/docs until Phase 5.
-- **PUBLISH.md absorbs DEPLOY_CLOUDFLARE.md and DEPLOY_DOCKER.md.** It covers what gets
- published, the editor / `pnpm ops` / CLI table, Pages, previews, R2, the cost-abuse defenses,
- containers and the MCP registration. Both old files are removed. Every link to them now names
- PUBLISH.md, except in plans/ and the released changelog bullets: README, SETUP, AGENTS,
- RUNNING_IN_DOCKER, r2-proxy ×3, homepage/content/README.md, and build.ts's R2 refusal plus
- three comments.
-- **Stale claims corrected.**
- - README's and SETUP's hand-kept env tables are now a pointer to ENVIRONMENT.md and `doctor`.
- - SETUP said `pnpm e2e` runs on port 3001; it is 3011.
- - CONTRIBUTING's "CLI shims" named a `retry-failures.ts` that does not exist; the section is
- now "The archilyzer CLI".
- - RUNNING_IN_DOCKER named whisper.cpp as the only engine; it now names parakeet.cpp beside it.
- - **Settings → Build pipeline still called Docker "a follow-up" that "falls back to a basic
- build"**, and its option read "(follow-up)". So did `settingsSchema.ts`'s description
- (SETTINGS.md regenerated) and its BuildMode comment. *(Review S2: the first rewrite
- overstated the mode as a switch — no build reads `buildPipeline.mode`. In `366553eb` the
- Settings hints, the schema texts, /sites' toggle note, the Build all paragraph and lane
- subtitle and the per-site panel note all say the mode is a label and Build all uses
- containers whenever `docker version` answers; `deploy-page.spec.ts` in step.)*
- - "Transcode as a stage": no doc claims one any more. The remaining "transcode" rows are
- ffmpeg's audio extraction.
- - `PARALLEL_TRANSCRIBE_LIMIT` was already in no doc. The only mention is the released
- changelog bullet that records its removal.
-- **The two stale hub hints were already fixed.** `SettingsForm.tsx`'s `homepageUrl` hint and
- `homepage.ts`'s comments name `archilyzer-hub`, since release 7's review fix `bc2d9fb6`.
- STATE's note is stale; nothing to do.
-
-| sha | what |
-|---|---|
-| `eeeef338` | `common:` `lib/ports.mjs` (+ `ports.test.ts` 4), `worktree.mjs` and `sync-tick` read it; `lib/toolProbe.mjs`, umtool's `tools.mjs` calls it |
-| `9be897c6` | `common:` `lib/envVars.ts` (+ `envVars.test.ts` 6), `bin/env-docs.ts`, `ENVIRONMENT.md`, `docs env` row |
-| `5c16a75c` | `common:` `archilyzer doctor` (+ `doctor.test.ts` 8), `settingsFromFile` |
-| `5da3e9e1` | `common:` the digest channel job's `ids`; the dispatcher passes ids; the editor's digest replay forwards them |
-| `3bfe2ab2` | `common:` `run`, `mcp`, passthrough rows, `_spawnBin.ts`, every bin a row (+ `run-operation.test.ts` 6, `mcp.test.ts` 1, `_cli.test.ts` +3) |
-| `e7de1d96` | `export, homepage:` the pipeline's scripts call the CLI; `detect:duplicates` removed |
-| `a132c213` | `editor, common:` root `pnpm archilyzer`; the Docker build-mode copy (Settings, schema, SETTINGS.md); build.ts names PUBLISH.md |
-| `58fd7d72` | `docs:` PUBLISH.md; the two deploy docs removed; README/SETUP/CONTRIBUTING/AGENTS/RUNNING_IN_DOCKER/r2-proxy/homepage README |
-| `1a65926b` | `common:` the mcp test's exit race and the run tests' timeouts (found by the bite checks) |
-| _this_ | `plans:` this record; the `[Unreleased]` bullet in `editor/CHANGELOG.md` |
-
-**Gates**, all from the worktree root. The logs are `o6-*.log` in the job's scratch dir.
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) was clean four times:
- 91 s before `eeeef338`, 58 s before `5da3e9e1`, 66 s before `a132c213`, and 95 s on
- `1a65926b`. The three commit groups in between are prefix-closed subsets of a checked tree: no
- file in a commit imports one from a later commit. `58fd7d72` is docs only.
-- **common 2,066/2,066** (2,038 + 28: ports 4, envVars 6, doctor 8, run 6, mcp 1, `_cli` 3), 47 s.
-- **editor unit 85/85**, 4 s.
-- **`test:scripts` 174 + 1 skip**, 9 s.
-- **mcp 269/269**, 18 s.
-- **`next build`:**
- - editor ok, 36 s;
- - umtool ok, 17 s (`tools.mjs` now imports `yt-dlp-transcript-common/lib/toolProbe.mjs`);
- - export ok, 27 s (no dangling `export/public` links).
-- **e2e:**
- - **Editor** (`o6-specs.txt`: `digest.spec.ts backfill.spec.ts jobs-retry.spec.ts`, which
- also matches `availability-backfill.spec.ts`), no queue wait: **39 passed, 0 failed, 3.2
- min**.
- - **umtool** `dashboard.spec.ts` (`SONG_DIR=~/reports/quartering-uh-song/data`, through
- `wt run`): run 1 was **6 passed, 1 failed, 1.1 min**. The failure was "the projects panel
- says exactly what /browse's header says": `page.goto` aborted during the cold `next dev`
- compile (35 s). It does not touch the tool probe. The two probe tests (the tools panel, and
- `umtool doctor` exiting 1 on a bad path) passed. Rerun: **7 passed, 25.8 s**, after 19 s in
- the queue.
- - Nothing else an e2e exercises changed: the editor suite never runs the export build scripts
- to completion (`deploy-page.spec.ts:130` says so), hence the scratch smoke-run.
-- **The CLI by hand, on scratch corpora only:**
- - `run diarization chan` exited 0 in 2 s, with the summary line and two job records (the run
- and the snapshot).
- - `run sync chan` exited 2 with the sentence (1 since review L6: a refusal, not a usage error).
- - `mcp --local <dir>` answered initialize, both directly and via `pnpm -C … archilyzer mcp`.
- - `doctor` on the worktree: no failures. Parakeet workers ×3 (engine, cli, model), every
- binary, umtool's table (python absent: info), block #6 with every port free.
-- **Nothing ran against the primary's `transcripts/`.**
-
-**They bite** (each mutation in a scratch copy of the tip, `o6-bite.log`):
-- ports: an export dev default drifting to 3009, and an undeclared `NEW_STUB_PORT` in a
- playwright config, each fail 1.
-- envVars:
- - an undeclared read in `workerToken.ts` fails 1;
- - a declared var nothing reads: as first shipped this "failed 1" only because ENVIRONMENT.md
- went stale — the mention test itself passed (review S1). After `8bea5844`, with
- ENVIRONMENT.md regenerated, the mention test fails 1;
- - an undeclared `ARCHILYZER_NEW_KNOB` in `docker/entrypoint.sh` fails 1 (review L5);
- - a hand-edited ENVIRONMENT.md fails 1;
- - a new override in `paths.ts` fails 2.
-- doctor:
- - a `mkdirSync` before returning fails 3 (the tree snapshots);
- - a non-JSON settings file as a warning fails 1;
- - a corpus that does not need the media tools fails 1.
-- run:
- - the dispatcher dropping `ids` fails 1 ("ids scope the run");
- - external ops not refused fails 2;
- - ids none of which is on disk, not refused, fails 1 (review L6);
- - a paused lane not refused gives pass 2, cancelled 4, exit 1. The held job leaves only
- unref'd poll timers and node cancels the rest.
-- cli: `verify transcripts`' row removed fails 1 (every bin reachable); passthrough disabled
- fails 1.
-- mcp: the row renamed fails 1. It hung before `1a65926b`, which the bite found.
-
-**Found and left** (after the review round):
-- **For the operator: should Build all / Build & deploy all honour `buildPipeline.mode`?** Today
- they use containers whenever `docker version` answers and the mode is a label (review S2). The
- parent ruled copy-only tonight; honouring it (basic → serial host even when docker answers) is
- a behaviour change for its own slice.
- *Ruled 2026-09-28 (morning): dropped — follow-up O6c removed the mode, the toggle and the select.*
-- **`run` does not see the editor's lanes** (review L1). Beside the editor's lane on the same
- channel it does the same videos twice — wasted CPU, not damage (atomic writes). Said in the
- header and the usage line; a `.jobs/` check for a running job of the same kind and slug is not
- implemented.
-- **Until :3001 restarts, its digest replay predates `ids`** (review L2): Retry on an ids-scoped
- `archilyzer run digest` job from the old editor widens to the whole channel (money, on the
- metered lane). Morning runbook: restart before retrying a CLI digest job.
-- **The doctor's default engine binary comes from `app.defaultBin()`** (the global `getPaths()`),
- not the injected paths (review L7). The same in production; wrong only under injected test
- paths. Left: a fix would re-derive each app's default beside the registry.
-- **No spec replays a digest job**, so the replay forwarding `ids` is type-checked only.
-- `mcp/README.md`'s and AGENTS.md's `claude mcp add` examples were left alone (O1 owns the first;
- the prompt said leave both). The new form is in README and PUBLISH.md.
-- `homepage/content/docs/*` are hand-derived copies by design. Only the drift table in
- `homepage/content/README.md` was updated.
-- Resolved in the review round: AGENTS.md's, the entrypoint comment's and RUNNING_IN_DOCKER's
- "no workers → zero workers" claim (Q5); the two released changelog links (Q1, retargeted,
- words unchanged); `archilyzer transcribe` (Q2, deleted); PUBLISH.md's homepage row (Q4).
-- **Optional, not done:** SETUP.md absorbing SCHEDULED_SYNC.md and WORKTREES.md; PLAN.md's phase
- table becoming a pointer to STATE.md.
-- **Checkpoint B** (the `E2E_` prefix cleanup, and the playwright configs importing ports.mjs) is
- next, after O1–O5 land on `main`.
-
-**Review fixes (checkpoint A)** — the review (`o6-review.md`) was SHIP AFTER FIXES: no blocker,
-two should-fixes, seven lows; the parent ruled on the questions. First `main` `c1d4790a` (O4 + O3)
-was merged: conflicts only in `editor/CHANGELOG.md` (one `[Unreleased]`: O4's and O3's bullets,
-then O6's) and this file (O4's and O3's records, then this one).
-
-| sha | what |
-|---|---|
-| `fcdaea12` | merge `main` `c1d4790a` |
-| `8bea5844` | S1: the mention test leaves `envVars.ts` out and can fail; L5: docker/'s `ARCHILYZER_*` names must be declared (+1 test) |
-| `366553eb` | S2: the build-mode copy says the mode is a label (Settings, schema + SETTINGS.md, /sites toggle, Build all, per-site panel; `deploy-page.spec.ts`) |
-| `ef84f535` | Q1: the two released changelog links → PUBLISH.md anchors, words unchanged |
-| `9424d357` | Q2: `transform.ts` + the `transcribe` row deleted; L6: usage 2 / refusal 1, all-absent ids refused (+1 test); L1 in the header and usage |
-| `bec01bf9` | Q5: the seeded-worker claim (AGENTS.md, the entrypoint comment, RUNNING_IN_DOCKER); L4: WORKTREES.md → ENVIRONMENT.md#ports, `pnpm dev:*` in ports.mjs, umtool's config comment |
-| `36db91e2` | S2 / Q4 / L3 in PUBLISH.md |
-| _this_ | `plans:` this record |
-
-Gates on the merged tree, from the worktree root (`o6-gateR.log`, `o6-e2e-editorR.log`):
-- **tsc clean** before `8bea5844` (on the merge: 102 s; again with S1+S2: 76 s) and before
- `9424d357` (33 s, incremental). `ef84f535`, `bec01bf9` and `36db91e2` change no TypeScript
- but `ports.mjs`' description strings.
-- **common 2,081/2,081** (main's merged tests plus this round's 2), 45 s. **editor unit 85/85**.
- **`test:scripts` 175 + 1 skip** (O4's +1). **mcp 269/269**.
-- **`docs env --check`, `settings example --check`, `docs files --check`: all exit 0.**
-- `docker/entrypoint.sh` still parses (`sh -n`).
-- **Editor e2e** `deploy-page.spec.ts digest.spec.ts backfill.spec.ts jobs-retry.spec.ts`
- (`o6-specsR.txt`; `backfill.spec.ts` also matches `availability-backfill.spec.ts`), no queue wait: **43 passed, 0 failed, 2.9 min** (39 before + deploy-page.spec's 4, the build-mode sentence among them).
-- **They bite** (`o6-bite.log`, "review round"): a declared `ZZ_NOBODY_READS_ME` with
- ENVIRONMENT.md regenerated fails exactly the mention test (1); an undeclared
- `ARCHILYZER_NEW_KNOB` in the entrypoint fails 1; all-absent ids not refused fails 1.
-
-### Slice O1, as shipped — hub lows and the DRAFT copy (2026-09-28)
-
-Release 10's hub lows (`release-10.md`, "Slice L1, as shipped", both "Found and left" lists) and
-STATE's x.com icon low, with the three lines that need words shipped as DRAFT constants for a
-morning ruling. Branch `r11/hub-lows` off `main` `2162db92`, merged up to `baaa4b47` (O4) before
-the first commit; worktree `/home/user/Projects/r11-hub-lows` (port block #4). One Opus
-implementer. Scratch files `o1-*` in the job's `tmp/overnight`.
-
-**What shipped.**
-1. **A "built-ins loaded" flag** (`common/components/siteRegistry.ts`). `builtinsLoaded` turns true
- once `/hub-sites.json` has been answered — a list, `[]`, a 404, a 500, a network error, bad JSON
- or a non-list. It is set in the same update that adds the built-ins (one `emit`), so no reader
- sees "loaded" over a list that lacks them. `useRegistry()` returns it, and `getBuiltinsLoaded()`
- reads it outside React. `loadBuiltins` is exported, and so are the store's `getRegisteredSites` /
- `subscribeRegistry`. The one-shot guard is now its own `builtinsRequested`: before, a flag named
- `builtinsLoaded` was set at the START of the fetch. The file is still never retried.
-2. **`/ask` counts as ready only once the hub's list is in.** `useHubSites()` returns
- `listed = builtinsLoaded && summary settled`, and `useFederatedSites()` passes it through.
- `MultiSiteDataProvider` takes a `listed` prop (default `true`), and
- `allSettled = listed && …`. `federation` carries `listed`. `AskHub` passes it; the front page
- does not, so it is unchanged. The archives a browser added are read from storage at once, and
- `/hub-sites.json`'s arrive a moment later. Before this, a question sent in between grounded in
- the added archives alone. Their fetches still start at once; only readiness waits.
-3. **Three DRAFT copy lines** (`export/app/ask/hubScopeCopy.ts`), each marked
- `// DRAFT (release 11, 2026-09-28) — awaiting the operator's ruling`:
- - **`NO_ARCHIVES_ON_HUB`** (`:16`). On `/ask`, once the list is in and it is empty (a hub whose
- `hub-sites.json` is `[]` or failed, with none added here), the composer shows it in
- `data-testid="ask-blocked"` (`role="status"`), the box and Ask disabled. It replaces
- "Loading transcripts…" forever. Its [bracketed] words link to `/`, where the add form is.
- - **`LIVE_CHAT_MISSING`** (`:24`). The note on a scope chip (`data-testid="hub-scope-live-chat"`)
- for a READY archive whose subs manifest settled in error. Beside it is a Retry, accessible name
- `Retry live chat from <title>`: `federation.retryLiveChat(origin)` refetches
- `["subs-manifest", origin]` exactly, and nothing else. The Retry is disabled while it runs.
- - **`ASK_SCOPE_LINE`** (`:33`). A function of `(inScope, total)` so the plural and the words are
- one editable constant. `AskScope` renders it (`data-testid="ask-scope"`) between `/ask`'s
- header and the chat, once the list is in, whenever at least one archive is in scope. Returning
- `null` hides it: e.g. `inScope === total ? null : …` shows it only when some archives are off.
- Its [bracketed] words link to `/`.
- `NO_ARCHIVES_IN_SCOPE` (L1's draft, still unruled) also waits for the list now, so it no longer
- flashes while the built-ins arrive. `LinkedCopy` (`export/app/ask/LinkedCopy.tsx`) is the one
- renderer of a copy line with its link. It replaces AskChat's inline split.
-4. **The archive stays ready through a live-chat Retry.** TanStack puts an errored query that has
- no data back to `pending` while it refetches (`fetchState`, query-core 5.100.5). So
- `isError && !isFetching`, L1's rule, would have taken the archive and its videos out of the
- search for the length of the Retry. The subs rule now keys on `errorUpdateCount > 0` with no
- data: the count moves only once the query's own retry is spent, and it survives a refetch.
- `FederatedSiteState.liveChatMissing = {retrying, error?}` rides in `statusKey`.
-5. **`normalizeSocialSvg` themes every fill colour** (`common/lib/settingsSchema.ts`). *(Narrowed by
- review fix 1 below: only a single-colour icon is themed; a multi-colour one keeps its colours.)*
- - **What changes.** Every `fill` attribute, and every `fill:` in a `style`, becomes
- `currentColor`: the root's (a root colour too, not only an absent one) and every child tag's.
- The exceptions are `none`, `transparent`, `currentColor`, `inherit` and `url(…)` paint (with or
- without a fallback).
- - **What is kept.** The tags inside a `<mask>` (white and black there are coverage, not colour),
- `fill-rule` / `fill-opacity`, strokes and gradient stops.
- - **The operator's icons.** x.com: the root's `fill="none"` stays, and the path's `white` becomes
- `currentColor`. Kiwi Farms: the gradient drop and its stops are unchanged, and the `#414042`
- dot follows the footer's colour.
- - The function is idempotent.
-6. **`mcp/README.md`.** The `claude mcp add` and `mcp.json` examples carry
- `ARCHILYZER_EDITOR_URL=http://localhost:3001` and `WORKER_TOKEN=…`, marked optional for
- `fetch_clip` in AGENTS.md's words (the URL's default and the no-editor answer added). mcp has no
- changelog.
-
-| sha | what |
-|---|---|
-| `0a2ba7b9` | `common:` siteRegistry `builtinsLoaded` (+ `getBuiltinsLoaded`, exported `loadBuiltins`), set in the same update as the built-ins; +8 unit tests |
-| `615563d1` | `common: normalizeSocialSvg` themes every fill colour, children's too; `none` / `url()` / mask fills kept; +8 unit tests |
-| `2f9b5ab9` | `hub:` `listed` through `useHubSites` → `MultiSiteDataProvider` → `federation`; `liveChatMissing` + `retryLiveChat` (the `errorUpdateCount` rule); the three DRAFT constants; `AskScope`, `LinkedCopy`; the chip note; e2e `ask.spec` (+3), `federated-search.spec` (+2, and the scope line in the chips test) |
-| `2ef9e745` | `mcp:` README — the two `fetch_clip` env lines in both examples |
-| `db555285` | `export: [Unreleased]` above `[0.9.4]` (five bullets) |
-| _this_ | `plans:` this record |
-
-**Gates** (logs `o1-*.log`):
-- **tsc:** clean (`o1-tsc-2.log`, 34 s, on the committed tree). `0a2ba7b9` and `615563d1` are
- additive subsets of it, with no type dependency on the rest.
-- **Unit and script tests** (`o1-units-1.log`):
- - common **2,057/2,057** (2,041 + 16);
- - editor unit **85/85**;
- - `test:scripts` **175 + 1 skipped**;
- - mcp **269/269**.
-- **Builds** (`o1-run-1.log`), with `export/public` seeded per path (17 links, none dangling):
- - export site ok (24 s), `data-accent="signal"`;
- - export hub ok (24 s), `dark data-base="dark"`, `out/ask/index.html` present.
- - Editor and homepage builds were not run: neither app changed. The editor's two save paths call
- `normalizeSocialSvg`, and its output for their e2e inputs is byte-identical (unit test 4).
-- **e2e** on `db555285` (`o1-run-1.log`; no wait in the queue):
- - `e2e:hub` in full: **31 passed** (26 + 5 new), 1.3 min;
- - export `site-branding` + `ask-chat` + `ask-workspace`: **36 passed**, 1.9 min. The footer's
- social row is `site-branding`'s. No export spec reads the icons' colour, and the fixture's icon
- is already `currentColor`.
- - `e2e:2origin` (`TWO_ORIGIN_REBUILD=1`, the links in place, no swap): **3 passed**, 36.7 s.
-- **The primary's `export/public`:** all **380 files**' path, size, mtime and md5 were identical
- before and after the three runs (`o1-primary-before-1.txt` vs `-after-1.txt`, `diff` empty).
- After 2origin the worktree held its own `hub-sites.json`, `sw.js`, `robots.txt`, `_headers`,
- `corpus.json` and `llms.txt`. The seed relinked them.
-- **Screens** (`o1-shots/`, from a temporary spec, deleted after): the chip note and its Retry, the
- scope line under `/ask`'s header, and the zero-archive line under the composer.
-- **Numbers tool:** none. No `settings.json`, `site.json` or `config.json` key changed.
-
-**They bite:**
-- **Unit, against `baaa4b47`'s source** (a scratch copy of the old `common/`, `o1-bite-units.log`):
- - `siteRegistry.test.ts` fails to load (no `getBuiltinsLoaded`).
- - `normalizeSocialSvg.test.ts` **4 of 8 fail**: x.com, Kiwi Farms, the colour spellings and the
- mask.
- - The other four pin behaviour the old code already had: unchanged icons, the bare icon's exact
- output, idempotency and the refusals. They are guards and pass on it by design.
-- **Mutations of the new code:**
- - the flag set at the start of `loadBuiltins`: 7 of 8 fail;
- - the flag set only when the file listed something (the old early returns): 6 of 8;
- - the flag announced in its own update before the built-ins join: 7 of 8;
- - `none` themed too: the x.com and "unchanged" tests fail;
- - masks not skipped: the mask test fails.
-- **e2e, against `baaa4b47`'s seven source files,** with the new specs and `hubScopeCopy.ts` kept
- (`o1-bite-e2e.log`, restored by a trap, tree clean after): **6 failed, 10 passed.** The six are
- every new-behaviour test:
- - the three zero-archive tests: no `ask-blocked` line;
- - the chips test: no `ask-scope` line;
- - the listed test: `Loading transcripts…` gone, because the chat was ready over the added archive
- alone;
- - the live-chat test: no note.
-
-**Found and left**
-- **The icon fix applies on save.** `normalizeSocialSvg` runs when a link is saved, not when the
- footer renders. The stored x.com icon in `settings.json` keeps `fill="white"` until the Settings
- form is saved once. Any save re-normalizes every link, with no re-paste. Then every site and the
- hub need a rebuild. A render-side pass (as `sizeSocialSvg` does for sizes) would fix stored
- icons with no save, but `Footer.tsx` and `sizeSocialSvg` are outside this slice.
- *(Corrected by the review: "save" is ANY `settings.json` write, and the homepage needs the
- rebuild too. See the review fixes' rollout note below. The review judged a render-side pass
- unneeded: every stored icon is in the global `settings.json`.)*
-- **The Kiwi Farms dot changes colour.** It was a fixed `#414042`, barely visible on Dark, and now
- follows the footer's colour. The green gradient drop is unchanged.
-- **Strokes are not themed.** An icon drawn with `stroke="white"` would still vanish. Neither of the
- operator's icons is stroked.
-- **A failed `/hub-sites.json` reads as "no archives yet"**, the same as an empty one, and the
- registry still never retries: a reload asks again.
-- **The front page does not wait for the list.** It is progressive and does not take `listed`, so
- it still settles for the instant before `hub-sites.json` arrives. This is pre-existing, and its
- chips show the loading.
-- **A live-chat Retry that fails again brings the note back,** with its Retry enabled
- (`errorUpdateCount` moves, `isFetching` clears). No e2e covers that second failure. TanStack
- clears `error` during the refetch, so the Retry's title says only "Try again" while it runs. The
- button is disabled then.
-- **FACTS is stale after merge** (release 10 facts, "L1 — hub lows"): "nothing says so (a new low)"
- (the subs rule) and "A hub with zero archives therefore reads 'Loading transcripts…' forever"
- are both closed here, and the subs rule's anchor now keys on `errorUpdateCount`. Not edited here
- (a shared file). *(Done in the review round, `ac9c299b`.)*
-
-`[Unreleased]` bullets: `export/CHANGELOG.md` (five: `/ask` with no archives, its wait for the
-hub's list, its scope line, the chip's missing live chat, the social icon). `editor/CHANGELOG.md`
-and `homepage/CHANGELOG.md` are unchanged, because neither app changed.
-
-**DRAFT copy for the morning ruling** (`export/app/ask/hubScopeCopy.ts`). *(Ruled 2026-09-28: all four
-ship as written; the [bracket] link became `${link("…")}` in a `copy` template. See "Operator rulings
-and follow-up O1c" below.)*
-- `:16` `NO_ARCHIVES_ON_HUB` = "This hub has no archives yet. Add one on the [hub's front page] to ask."
-- `:24` `LIVE_CHAT_MISSING` = "live chat didn't load"
-- `:33` `ASK_SCOPE_LINE(n, m)` = "Searching {n} of {m} archive(s) — [change on the front page]." (shown
- whenever at least one archive is in scope, all included)
-- Still owed from release 10: `:7` `NO_ARCHIVES_IN_SCOPE` = "No archives selected. Choose some on the
- [hub's front page] to ask."
-
-**Review fixes** (review SHIP AFTER FIXES, `o1-review.md`; probes `o1-rv*`). First `git merge main`
-at `cb9d02b2` (O4, O3 and O6 checkpoint A), giving `c7b42f23`. The two expected joins: one
-`[Unreleased]` in `export/CHANGELOG.md` (O3's bullet, then O1's five) and the records O4, O3, O6,
-then O1. No code conflicts, no dependency change (script lines only). tsc was clean on the merge
-(`o1-tsc-3.log`).
-
-1. **Should-fix: `normalizeSocialSvg` flattened every multi-colour icon, and wrote the result back**
- (`69d08bf6`).
- - **The failure.** YouTube's official mark (a `#f00` rounded rectangle and a `#fff` triangle)
- came out as a blank rounded rectangle, and a dark disc with a white glyph as a plain disc.
- `writeSettings` re-normalizes every link on EVERY `settings.json` write (`common/lib/settings.ts:247`,
- `validatedSocialLinks`), not only the Settings form. So the pasted original would be destroyed
- by the first write of any kind.
- - **The rule now.** The solid colours of the root and every child outside a `<mask>` are counted
- together (`fill` attributes and style `fill:`; `none` / `transparent` / `inherit` / `url()` never
- count). Spellings of one colour count once: `paintKey` folds `#FFF`, `#ffffff`, `white` and
- `rgb(255, 255, 255)`. With at most ONE colour, every one becomes `currentColor`, as before.
- With two or more, every colour stays as pasted: the pre-O1 behaviour, and such an icon carries
- its own contrast. The root still gains `fill="currentColor"` when it has none, and `aria-hidden`.
- - **Unchanged output:** x.com (one colour, white) and Kiwi Farms (gradient + one grey) come out
- exactly as before, and all eight earlier tests stand (the spellings test now uses one colour
- in five spellings).
- - **Idempotent:** a themed icon has no solid colour left, and an untouched one counts the same
- colours again.
-2. **Edge cases** (`69d08bf6`, the same function).
- - **Animation tags are passed over.** `<animate…>`, `<animateTransform>`, `<animateMotion>` and
- `<set>` are never read or changed, because their `fill="freeze"` / `fill="remove"` is timing.
- Counted, `freeze` would also have made a one-colour icon "two colours".
- - **A self-closing `<mask … />` is matched first** (`<mask\b[^>]*\/>`). The lazy block form no
- longer swallows everything after it up to the next `</mask>`.
- - **Recorded as left:**
- - a `<pattern>`'s children are themed (a single-colour icon's pattern would flatten; a
- two-colour one is untouched);
- - class fills in a `<style>` block (`.st0{fill:#FFF}`, Illustrator exports) are neither counted
- nor themed;
- - an unquoted `fill=white`, and a `>` inside an attribute value, are skipped.
-3. **Low 1: `/ask` waits for a live-chat refetch in flight** (`a3e7c616`, the reviewer's one-liner):
- `subsSettled = data !== undefined || (subsErrored && (progressive || !subs.isFetching))`.
- - **What it changes.** `errorUpdateCount` lives in the shared query client, so it outlives the
- front page. It survives into refetches the front page never asked for: `/ask`'s own mount (an
- errored query with no data is refetched when a new observer mounts), a scope toggle off and
- on, and a whole-archive Retry.
- - **Before**, `/ask` counted such an archive ready during that refetch, and a question could miss
- live chat about to arrive.
- - **Now** `/ask`, which is not progressive, counts it loading until the refetch settles. The
- progressive front page is unchanged: it stays ready through its own live-chat Retry, which the
- earlier e2e pins.
- - **The new e2e** (`federated-search.spec`, "/ask is not ready while it refetches a live chat that
- failed on the front page"): subs fail on `/`, then a client-side move to `/ask` by the header's
- Ask AI link. The mount's refetch is held, and the page reads "Loading transcripts…". On release
- it is ready.
-4. **FACTS** (`ac9c299b`). Release 10's "L1 — hub lows" gets two dated amendments (2026-09-28,
- release 11 O1):
- - the subs rule on `errorUpdateCount` and the `/ask` wait, with its anchors and the
- `resetQueries` caveat;
- - the zero-archive low closed: `builtinsLoaded`, `listed`, the blocked lines, `AskScope` and the
- DRAFT constants anchored.
-5. **Changelog** (`5477b43f`):
- - the social icon bullet now says "a single-colour icon", and that a multi-colour one (YouTube's)
- keeps its colours;
- - the live-chat bullet adds that Ask AI waits while it asks for a missing live chat again.
-
-| sha | what |
-|---|---|
-| `c7b42f23` | merge `main` `cb9d02b2`: one `[Unreleased]`, the records O4, O3, O6, O1 |
-| `69d08bf6` | `common: normalizeSocialSvg` themes only a single-colour icon; animation tags passed over; self-closing `<mask/>`; +5 unit tests (13) |
-| `a3e7c616` | `hub:` `/ask` waits for a live-chat refetch in flight (`progressive \|\| !isFetching`); +1 e2e |
-| `5477b43f` | `export: [Unreleased]`: the single-colour icon; Ask AI's wait |
-| `ac9c299b` | `plans:` FACTS, release 10 "L1 — hub lows" amended |
-| _this_ | `plans:` these review fixes |
-
-**Gates on `ac9c299b`**
-- **tsc:** clean (`o1-tsc-4.log`, 62 s).
-- **Unit tests** (`o1-units-2.log`):
- - common **2,102/2,102** (main `cb9d02b2`'s, plus O1's 21: 8 registry + 13 SVG);
- - editor unit **85/85**;
- - `test:scripts` **175 + 1 skipped**;
- - mcp **269/269**.
-- **e2e** (`o1-run-2.log`):
- - `e2e:hub` in full: **32 passed** (31 + 1 new), 1.2 min;
- - export `site-branding` + `ask-chat` + `ask-workspace`: **36 passed**, 1.7 min (43 s in the
- queue).
- - The primary's `export/public` was unchanged: all 380 files' size, mtime and md5
- (`o1-primary-before-2.txt` vs `-after-2.txt`).
- - Builds and `e2e:2origin` were not re-run: they are outside this round's gate list, and tsc
- covers the two changed modules.
-
-**They bite:**
-- **Unit** (`o1-bite2-units.log`, a scratch copy of `HEAD`'s `common/`):
- - Against O1's first normalizer (`c7b42f23`'s `settingsSchema.ts`), **5 of 13 fail**: all five
- new tests (YouTube, the badge, root-vs-child colours, the animation tags, the self-closing mask).
- - Each one-line mutation of the new code fails exactly its own test:
- - no single-colour gate: YouTube, the badge and root-vs-child;
- - animation tags not passed over: the animation test;
- - no self-closing alternative: the mask test;
- - spellings not folded: the spellings test.
-- **e2e, one-line mutations of the subs rule** (`o1-bite2-e2e.log`, restored by a trap, tree clean
- after). This answers the review's nit: the first round's whole-source bite never reached the
- mid-Retry asserts.
- - **Release 10's `isSuccess || (isError && !isFetching)`:** the live-chat test fails mid-Retry.
- The Retry vanished (`toBeDisabled`: element not found) because the archive left `ready` while
- the subs were held.
- - **O1's first `data || errored` (no `/ask` wait):** the new `/ask` test fails. "Loading
- transcripts…" is not visible, because `/ask` was ready during its own refetch.
-
-**Rollout note (owed): the social icons.** A settings write re-normalizes every stored social link.
-That means ANY write through `writeSettings`, not only the Settings form's Save, so the first one
-after the :3001 restart rewrites the stored x.com icon. Then rebuild every site, the hub AND the
-homepage: the homepage's footer uses the same `settings.socialLinks`
-(`homepage/app/components/Footer.tsx:20`; no `homepage.json` or `site.json` overrides them).
-Whether `homepage/CHANGELOG.md` gets a bullet is the parent's call (O2 owns the homepage).
-
-### Slice O2, as shipped — homepage and brand lows (2026-09-28)
-
-Release 10 left four lows on the homepage and the mark: AC's "a custom hex is painted unfitted on
-every base" and "a sixth published site would nearly repeat Anilyzer's magenta", and MR's "the ring
-is a box-shadow, which forced-colours mode removes" and "a fresh worktree's homepage e2e skips 8
-specs". Branch `r11/homepage-lows` off `main` `2162db92`, `main` `c1d4790a` merged in (a fast-forward)
-before the first commit, worktree `/home/user/Projects/r11-homepage-lows` (block #3), one Opus
-implementer. Scratch files `o2-*` in the job's `tmp/overnight`.
-
-**What shipped**
-
-- **A custom hex is fitted per base, on the homepage cards and the hub's official cards.**
- - `siteColor` paints one through `resolveAccent`, the fit the site's own pages use: 4.5:1 on the
- ground and with its ink.
- - The three values travel as ONE CSS value, `perBaseColor` (`common/lib/siteColor.ts`): each
- channel is a `calc()` over new one-hot tokens `--base-light|sepia|dark`. They are 1 on their own
- base and 0 on the others, declared in each base block of `tokens.css`. The browser resolves the
- value to a plain `rgb()` and switches it with the base.
- - A single string was needed because `siteColor`'s result goes, as is, into every hub surface:
- card, chip, result stripe. So the fix is in the shared function, and no file under
- `export/app/components/hub/**` changed.
- - The fallbacks paint the light value on a page with no token sheet.
- - The e2e's pale `#f4c2d7` (1.43:1 on the light ground as published) paints `#846974` on light,
- `#7c636e` on sepia and `#f4c2d7` on dark.
-- **A sixth validated chart slot, `--chart-6`, a rust.** Light and sepia `#823c10`, dark `#a54a08`.
- - `seriesColor(5)` is `var(--chart-6)` (`CHART_SLOTS = 6`), no longer the golden angle's
- `hsl(328 64% 55%)`.
- - `ACCENT_CHART_SLOT.vermilion = 5`. The rust is Vermilion's hue family: 8–10° of OKLCH hue from
- its swatches, and 27–33° from the nearest other slot (amber). *(Ruled 2026-09-28: Vermilion keeps
- slot 6.)*
- - So Jasolyzer, once published, wears the rust at any rank, and any six sites wear the six
- validated slots. Signal, a custom hex and no accent still have no family; they take the lowest
- free slot, and the sixth when it is free.
- - `REQUIRED_TOKENS` is 50 and `--color-chart-6` is in `@theme`. The homepage `theme.spec` checks
- that every base declares it.
-- **Forced colours: a 1px `CanvasText` outline on the mark's tile, on every base.** It is two classes
- on `BRAND_MARK_RING_CLASS`:
- - `forced-colors:outline` and `forced-colors:outline-[color:CanvasText]`.
- - They compile to `@media (forced-colors:active){…outline-width:1px…outline-color:canvastext}`.
- - The outline has offset 0, so it sits where the dark ring does and follows the same corner.
- - Outside forced colours the two classes match nothing.
- - Every `BrandMark` has it: the export header and footer credit, the hub, the homepage and the
- editor sidebar.
-- **The homepage e2e reads a synthetic summary.**
- - `homepage/e2e/fixture-summary.ts` replaces `fixture-accents.ts`. It runs the real
- `buildHomepageSummary` over made-up recordings and is deterministic (`FIXTURE_NOW` 2026-09-15).
- - Its six public sites are, in order: Brass; the pale custom hex; three with no accent; Vermilion.
- - The first site has a 12,000-transcript week in May, so the All-time axis reaches 10K. Every site
- transcribes every day of the last 200.
- - `playwright.config.ts` writes it to `e2e/.e2e-summary.json` before the server starts. That path is
- gitignored, as is a killed run's temp copy, and is not linked. It always passes
- `HOMEPAGE_SUMMARY_FILE`.
- - Nothing is read from `public/` or from the primary.
- - `stats.spec` no longer skips, and its site count is the fixture's six. `marketing.spec` reads the
- fixture, the file the server reads. `instance-colours.spec` checks the fitted pale hex per base,
- Vermilion's card in its rust layer's hue, and the six legend swatches as the six validated slots.
-
-**The sixth slot, validated.** Slice AC's method (`ac-validate.sh` / `ac-layers.mts`): the dataviz
-skill's validator on each base's own values, read from `tokens.css`. It runs over all pairs, since
-the homepage order moves with transcript counts. Contrast is checked against `--chart-surface` AND
-the page ground. The command, from `common/`, is `pnpm exec tsx $T/o2-validate.mts`. For every run it
-calls `node $T/dataviz/scripts/validate_palette.js "<chart-1..6>" --mode light|dark --surface <chart
-surface | page ground> --pairs all|adjacent`. Log: `o2-validate.log`.
-
-| base | `--chart-1..6` | surface / ground | band | chroma | CVD, all pairs | normal, all pairs | contrast | exit |
-|---|---|---|---|---|---|---|---|---|
-| light | `#3a7de0 #2f8a57 #5e3aa8 #a8741a #c24a8a` **`#823c10`** | `#ffffff` / `#f3f6f7` | PASS | PASS | WARN 6.2 (amber↔green) | PASS 15.4 | PASS / PASS | 0 / 0 |
-| sepia | `#3574d6 #2a7d4f #5e3aa8 #a8741a #bb4585` **`#823c10`** | `#faf4e6` / `#f4ecd8` | PASS | PASS | WARN 6.1 (amber↔green) | PASS 15.3 | PASS / PASS | 0 / 0 |
-| dark | `#3561c8 #3fa577 #9a7ee6 #b98a2a #c24c8a` **`#a54a08`** | `#16110a` / `#0c0a08` | PASS | PASS | WARN 6.9 (magenta↔green) | PASS 15.4 | PASS / PASS | 0 / 0 |
-
-- **The WARN pairs are the five's own floor band, which release 10 recorded; none involves the
- sixth.** The sixth's own pairs, each run alone against `--chart-1..5`, are:
- - worst CVD 12.5 / 9.1 / 13.9 (light / sepia / dark; against green, green, magenta);
- - worst normal 16.6 / 16.6 / 16.3 (against amber);
- - all above the target of 8 and the floor of 15.
-- **Contrast:** 8.1 / 7.4 / 3.2 to 1 on the chart surface and 7.4 / 6.9 / 3.4 to 1 on the ground.
-- **The stack (adjacent), as `siteChartColors` resolves it** for the operator's mapping, with
- Jasolyzer (Vermilion) at each of the six places: PASS on every base. Worst CVD 12.5 / 9.1 / 11.0,
- normal 16.6 / 15.3 / 16.3. Before this slice the same run could not even resolve:
- `jasolyzer→hsl(328 64% 55%)` (`o2-validate-pre.log`).
-- **Why a rust.** A search over every OKLCH hue took each base's best L and C inside the band at
- ≥ 3:1 on both the surface and the ground (`o2-chart6-search.mjs`, `-hue`, `-margin`; logs of the
- same names). Only the red-browns, h ≈ 15–60, clear every pair with `--chart-1..5` on all three
- bases. With 0.01 of L margin and ≥ 3.2:1, the best is h 48. The other hues fail:
- - teal fails CVD against blue and green (4.0–6.4), and would sit on Signal;
- - olive fails the normal floor on light and sepia (11–14.9);
- - an electric blue or violet fails on dark, or reads as a second chart-1 or chart-3.
-- **A question for the operator: the rust sits near `--state-gone`.** *(Ruled 2026-09-28: accepted.)*
- The validator FAILs that pair, so it is information, not a gate:
- - normal ΔE 8.4 / 7.2 / 13.1, CVD 5.4 / 3.6 / 11.7;
- - release 10 (S2's review) accepted amber and magenta at 11.8–14.5, because gone is only ever
- labelled text, never a chart mark; the rust is closer;
- - no sixth hue clears both `--chart-1..5` and gone ≥ 15 on every base; the gone-constrained
- search's best, an electric violet, fails the palette's own normal floor (14.4 on light and
- sepia; `o2-chart6-hue-gone.log`);
- - on the homepage, gone shows only as the FamilyStats figure (`RecentAdditions` would badge it, but is rendered nowhere).
-
-**Forced colours, as rendered** (`o2-shots.mjs`, `o2-shots.log`, `o2-forced.png`).
-- **Normal modes are unchanged.** Each mark was shot as built and again with the two new classes
- removed, which is `main`'s class string, then compared by pixel (`magick compare -metric AE`).
- All 15 pairs differ by **0 px**: the homepage header, the site header and footer, and the hub header
- and footer, on light, sepia and dark.
-- **The same pairs under forced colours differ,** on a light (white Canvas) and a dark (black Canvas)
- forced palette: all 18.
-- **The worst case before, row 2 of `o2-forced.png`.** A site's ink tile on light or sepia under a
- black Canvas had no edge at all. Now it has a white outline.
-- **Found: Chromium keeps the svg's box-shadow in forced colours.** Its UA sheet gives `svg`
- `forced-color-adjust: preserve-parent-color`, so MR's premise ("which forced-colours mode removes")
- does not hold there. The dark ring stays, and the outline is painted over the same pixel ring. What
- the mode does do is put the reader's Canvas under the tile on every base, which is why the outline
- is on every base.
-- **Playwright applies the forced palette** (`page.emulateMedia({ forcedColors: "active" })`). This
- version's `test.use` has no `forcedColors`.
-
-| sha | what |
-|---|---|
-| `fbd6318a` | `common:` `--chart-6` + the base flags (`tokens.css`), `seriesColor` six, `ACCENT_CHART_SLOT.vermilion`, `perBaseColor`, `siteColor` fits a custom hex; `REQUIRED_TOKENS` 50; unit tests (siteColor, hubSummary, themeTokens); the homepage chart and card headers' notes |
-| `e253e244` | `common:` the forced-colours outline on `BRAND_MARK_RING_CLASS`; `BrandMark.test.ts` +1; the homepage `brand.spec` forced-colours test + outline none in the normal-mode test |
-| `c37d620e` | `homepage(e2e):` `fixture-summary.ts` (replaces `fixture-accents.ts`), `playwright.config.ts`, `stats`/`marketing`/`instance-colours` specs, `.gitignore` |
-| `7685e701` | `changelogs:` export and editor `[Unreleased]` bullets (the existing sections), the homepage's four |
-| _this_ | `plans:` this record; `FACTS.md`'s official-instance colour entry; dated notes in `brand-and-themes.md` (mark, charts) |
-
-**Gates** (logs `o2-*.log`):
-- **tsc** clean before each code commit (33–71 s; `o2-tsc{1..4}.log`). The one failure along the way
- was `forcedColors` in `test.use`; the spec now uses `emulateMedia`.
-- **Units:**
- - common **2,056/2,056** (2,051 on `main` + 5);
- - editor unit **85/85**, `test:scripts` **175 + 1 skipped**, mcp **269/269**, homepage unit **2/2**.
-- **Builds:**
- - Timings: editor ok (38 s), export site ok (23 s), export hub ok (25 s; `out/ask` present),
- homepage ok (12 s; no `public/` data, so the no-data page and the header mark).
- - Each stylesheet carries the `forced-colors:active` outline rule, `--chart-6` (×2 `#823c10`,
- ×1 `#a54a08`) and the three flags per base.
- - The primary's `export/public` is byte-identical before and after the builds and the e2e: 392
- entries, 380 files, tree md5 `5c90d8e63753`, content md5 `4a0c46b39eeb`.
-- **e2e** (queued behind O1 for about a minute; nothing failed, so no re-runs):
- - homepage FULL, from this worktree with NO `homepage/public` data (only its tracked `_headers`):
- **30 passed, 0 skipped** (42 s). Release 10's fresh-worktree run was 21 passed / 8 skipped, and
- 29 passed with the primary's data copied in; 30 is those 29 plus the forced-colours test.
- - export `brand` + `site-branding` + `theme` + `theme-accent`: **20 passed** (50 s).
- - `e2e:hub`: **26 passed** (1.0 min).
- - editor `branding.spec`: **4 passed** (25 s).
-
-**They bite** (`o2-bite.sh`, `o2-bite*.log`). Each item was reverted to the old code on its own,
-with the new tests kept:
-1. **Custom hex as published.** Unit: 4 fail (the two `officialInstances` custom-hex cases, the fitted
- test, and the unrecognised-id fall-through). e2e `instance-colours`: expected `rgb(132, 105, 116)`,
- received `rgb(244, 194, 215)`.
-2. **Five slots, no vermilion family, no `--chart-6`.** Unit: 6 fail (the required tokens, the
- charts test, the family slots, `seriesColor` six, the seventh-site case, and any-six-wear-six).
- e2e: expected `var(--chart-6)`, received `hsl(328 64% 55%)`.
-3. **No outline.** Unit: 1 fails. e2e forced-colours test: `isCanvasText: false`.
-4. **`main`'s e2e setup** (its specs, config and `fixture-accents.ts`) in this worktree: **21 passed,
- 8 skipped**. The skips are `stats.spec` ×7 and `instance-colours.spec`.
-
-**Found and left**
-- **The hub's ADDED archives still paint a custom hex as set.** This is `ArchiveShelf`'s
- `site.accent || FALLBACK_ACCENT`, and the chips and stripes that read the registry's raw `accent`.
- It is `export/app/components/hub/**`, O1's, so it was not touched here. The fix is one call where
- it parses: `perBaseColor(resolveAccent(hex))`. For O1 or the parent.
-- **The rust near `--state-gone`:** the operator question above (ruled 2026-09-28: accepted).
-- **Two things do not reach the sixth slot:**
- - `ChartView.tsx` (export and editor charts) cycles `var(--chart-${(i % 5) + 1})`, so it never
- wears `--chart-6`; its sixth series repeats chart-1, as before. Not a homepage surface.
- - Past six, `seriesColor`'s golden angle still gives hue 105 (7th) and 243 (8th, near chart-1's
- blue). Only `/stats`' by-channel views reach them (up to 8 channels plus Other).
-- **The no-data paths have no spec now.** The e2e server always has the fixture, so `/` and `/stats`
- without a summary go untested; `marketing.spec` keeps its absent branches. Before, those paths ran
- only in a fresh worktree, where the data specs skipped instead. A second web server without the
- fixture would cover them.
-- **O6's `E2E_` rename will meet `HOMEPAGE_SUMMARY_FILE`,** which `app/lib/summary.ts` reads and
- `playwright.config.ts` sets.
-- **The live sites carry none of this until rebuilt:** every export site and the hub (the outline,
- and the hub's fitted hex), the homepage (all four), and the editor on its next restart (the
- sidebar outline).
-
-### Slice O5, as shipped — umtool brand fonts (2026-09-28)
-
-Branch `r11/umtool-fonts` off `main` `2162db92`, fast-forwarded to `main` `cb9d02b2` (O4, O3, O6
-checkpoint A) before any change; worktree `/home/user/Projects/r11-umtool-fonts`, port block #8
-(umtool e2e 3851, stub 3852). One Opus implementer; scratch files `o5-*` in the job's
-`tmp/overnight`. Everything is under `umtool/report-to-video/**`; nothing in `umtool/app/**`.
-
-**Why.** S4 left two things for later ([`brand-and-themes.md`](brand-and-themes.md), "Slice S4, as
-shipped"): the rail, `ledger`, `scroll` and `chart` SVG text stayed Fira Sans under the brand,
-because `fit()` truncates against Fira's 0.50 em average; and `render.fontBold` stayed whatever the
-manifest said, because no bold Plex Mono was vendored. O5 does both, and an unbranded render stays
-byte-identical.
-
-**The measurement, and why the brand's metric is a table rather than an average.** Nothing
-recorded how 0.50 was measured, so O5 fixed a method and checked that it gives Fira's own number:
-the mean advance per character (fontTools hmtx; Fira from the system files fontconfig resolves, Plex
-Sans from the vendored variable font instanced at wdth 100) over the text these assets draw. The
-`fit()` corpus is the five S4 manifests' track labels, log and scroll labels, roster lines, column
-heads and quotes, read and never written (`o5-corpus.json`, 144 strings, all from
-`quartering-employee-count`, the only one with a rail).
-
-| face | weight | `fit()` strings | p95 of a string's own mean | every SVG text run | capitals |
-|---|---|---|---|---|---|
-| Fira Sans | 400 | 0.457 em | 0.492 | 0.463 | 0.549 |
-| Fira Sans | 700 | 0.462 | 0.497 | 0.525 | 0.550 |
-| IBM Plex Sans | 400 | 0.456 | 0.497 | 0.469 | 0.590 |
-| IBM Plex Sans | 700 | 0.479 | 0.521 | 0.577 | 0.613 |
-
-So 0.50 is Fira's mean plus the "hair" its comment describes, just over its p95. By the same method
-Plex Sans Regular gets 0.50 too, and Bold 0.53. **But an average cannot keep the promise the slice
-makes, that a branded column never overruns** (`o5-stress.log`). Every real string (87, 77 over 20
-characters) was pushed through every call site's size, budget, weight and letter-spacing:
-- **Fira's own 0.50 overruns** the scroll's bold, letter-spaced column head in 40 of 87 runs (up
- to 11 %) and the rail's track label once;
-- Plex at 0.50 / 0.53 overruns the head in 35 of 87 runs;
-- uppercased, every site overruns in both faces at every average tried (0.50 to 0.55).
-
-None of the manifests' labels comes near a budget as written (the tightest is a wrapped quote line
-at 95 %), which is why this never showed. So the preset's metric is **the face's own advances**:
-- `face-metrics.mjs` is generated by `fonts/gen-face-metrics.py` (fontTools 4.65.0, instancer)
- from the vendored `IBMPlexSans[wdth,wght].ttf`. It holds the advance of all 891 characters the
- font maps at wght 400 and 700, wdth 100 (11.5 kB, do-not-edit header, the font's sha256).
-- `fit()` keeps the longest prefix whose width, ellipsis, weight and letter-spacing included, is
- inside the budget.
-- Fira keeps its 0.50 average and its exact character counts. It is the system's font, so a table
- of its advances could not be pinned anyway.
-- Kerning is ignored. Over the proof's 24 Plex runs, the plain sum was at or above the rendered ink
- width of every one (by 0.19 px at the least), so the sum is the conservative side.
-- A character Plex does not map (emoji, CJK) counts 1.3 em.
-
-**What shipped.**
-- **`svg-faces.mjs`:** `FIRA_SANS` (`{family, em: 0.5}`), `IBM_PLEX_SANS` (`{family, advances:
- {regular, bold}}`, built from the table), `textWidth(text, size, face, {weight, ls})`, and
- `FALLBACK_EM`. `brand.mjs` gains `brandSvgFace(render)`: null without a brand, the preset's face
- with one.
-- **`render-cards.mjs`:**
- - `fit(text, size, maxPx, face = FIRA_SANS, run)` and `wrapPx(…, face)` are exported. An
- average face runs the old code path verbatim. A measured face fits by width, and `wrapPx`
- wraps by width and fits every line, so a lone overlong word is cut too.
- - `svgTextIn(face)` sets each asset's family. The rail (chrome, log, tally, roster, the QR
- tile), the ledger card, the scroll and the chart take `svgFaceOf(render)`.
- - The scroll head fits with `{weight: "bold", ls: 0.6}`, and the ledger's scope pill is the
- label's measured width + 22 (Fira: `length × 7.6 + 22`, unchanged).
- - `rasterize()` hands rsvg-convert `childOpts(render, …)`, which passes the options through
- unchanged without a brand. Without it a branded SVG found no Plex (it is not a system font)
- and fell back to another sans, silently.
-- **IBM Plex Mono Bold, vendored:**
-
- | | |
- |---|---|
- | file | `fonts/IBMPlexMono-Bold.ttf`, unmodified (Reserved Font Name "Plex") |
- | source | google/fonts `ofl/ibmplexmono` at `0b58fb37` (`0b58fb370093f9a9f4ff785d94405710b79de67c`), the commit S4 took Regular from; Regular there is byte-identical to the vendored one |
- | bytes | 137,784 |
- | sha256 | `ac27abd6450a64dd94467580a02fe6235156d5b92f2926ebbc8e7489df64e0be` (git blob `17b406d2`, as upstream lists it) |
- | licence | `OFL.txt` already holds Plex's OFL verbatim; unchanged |
-
- `fonts.conf`'s relative `<dir>` picks it up: under `FONTCONFIG_FILE`, `IBM Plex Mono:bold` now
- resolves to it (it resolved to Regular, emboldened, before), and without it the system still
- answers Noto. `resolveBrandRender` sets `fontBold` to it beside `fontRegular`, so compose-chrome's
- HyperFrames band sets its bold in the brand's mono. The fonts are about 1.5 MB in all.
-- **README:** the preset's "owns" list; the "Not branded yet" paragraph goes; the fonts paragraph;
- "Why a table, not an average".
-
-**Shown.**
-- **`o5-fit-proof.png`** (+ `.tsv`): every `fit()` call site, three cases each (the site's longest
- real label; the longest real string anywhere, a 143-character quote; and the site's label in
- capitals), fitted in both faces inside a box exactly its budget wide. Each fitted run is then rendered
- **alone** through rsvg-convert and its ink measured:
- - **Plex: 24 runs, 9 truncated, 0 over budget, widest 98.9 %.**
- - Fira (the unchanged path): 1 over, the scroll head at 152 px in 140.
-- **`o5-overrun.py`** computes every `<text>` run's extent from its face's real advances (anchor,
- weight and letter-spacing aware) over the SVG sources the renderers write. It flags a run that
- leaves its canvas or tally lane, or overlaps another run on its line. **0 problems** in all 27
- SVGs of each set: unbranded, branded before, branded after (1,552–1,554 runs). It catches a
- synthetic collision.
-- **Branded before/after** (`o5-brandshots.mjs`: the five manifests with `render.brand` and
- `endCard: false` set in memory, 19 render calls). Every asset differs, as it should. Two ledger
- quotes that Fira wrapped onto a stranded last word (L03 "employees", L06 "now") are one line in
- Plex, and the pills hug their labels.
- - Looked at: the ledger cards, the rail chrome, the log, the tally strip, the QR tile, the scroll
- and the chart. No clipped glyph and no overrun.
- - "IMPLIED" clears its delta triangle by 21.4 px (Fira 28), and "≈" and "→" are in Plex.
- - `o5-compare.png`: a ledger row, the scroll heads and the chart's end labels, before and after.
-- **The branded chapter kicker** (Pango, the `label` face in bold) now draws the real Plex Mono Bold,
- where it drew an emboldened Regular before. It is the only change on that card: 276 px inside the
- kicker's 189 × 24 box, and it looks the same at 24 px.
-
-**The byte-identity proof** (S4's harness, copied as `o5-identity.mjs` / `o5-idiff.mjs`, paths
-adapted; S4's fixture copied to `o5-fixture`):
-- **BEFORE** was rendered on `cb9d02b2` before any change, into `o5-before/`. It covers every card,
- footer, rail, ledger, scroll and chart asset of the five manifests in both variants (70 render
- calls, the resolved `render` blocks included), plus a full offline fixture build.
-- **Control** (the same code twice, `o5-before` vs `o5-before2`): 334 files, 201 raw identical, 133
- identical but for ImageMagick's `tEXt date:*` chunks, 0 different.
-- **AFTER, on the final code tip `216533ea`** (`o5-after-2`): **334 files, 201 raw identical, 133
- identical but for the date chunks, 0 different, none missing or extra.** The fixture's cut is the
- same 3,380,693 bytes, and the mp4s are raw-identical. The same result on the pre-commit tree
- (`o5-after-1`).
-- The five manifests' sha256 were the same after every run (`o5-manifests-sha-before.txt`).
-
-| sha | what |
-|---|---|
-| `b9933d71` | `umtool:` vendor IBM Plex Mono Bold; `resolveBrandRender` sets `fontBold`; brand tests (the file, the value, fontconfig resolves it) |
-| `2223ba07` | `umtool:` Plex Sans for the rail / ledger / scroll / chart under the preset — `svg-faces.mjs`, `face-metrics.mjs` + `fonts/gen-face-metrics.py`, `fit()`/`wrapPx()` take the face, the pill, `rasterize()` gets `childOpts`, `brandSvgFace`; `svg-faces.test.mjs` (7) and a scroll-card render test |
-| `b555af1a` | `umtool:` test that the preset's rsvg-convert children get `FONTCONFIG_FILE` (an `RSVG_BIN` stub); fc-match's escaped paths unescaped |
-| `216533ea` | `umtool:` README — the preset's faces, "Why a table, not an average", Plex Mono Bold; `svg-faces.mjs`'s header says what was rendered |
-| _this_ | `plans:` this record |
-
-**Gates** (from the worktree root; logs `o5-*.log`):
-- **tsc clean** before every commit: 66 s, 32 s, 38 s and 30 s. The `.mjs` files are `allowJs`
- without `checkJs`, so it resolves them but does not check them.
-- **`test:scripts` 185 + 1 skip** (`main` `cb9d02b2`: 175 + 1; +10 = `svg-faces.test.mjs` 7 +
- `brand.test.mjs` 3). Common, editor unit and mcp not run: nothing outside umtool changed.
-- **umtool build** (`pnpm --filter umtool run build`): ok, 17 s.
-- **umtool e2e, full** (`SONG_DIR=~/reports/quartering-uh-song/data node scripts/worktree.mjs run --
- pnpm --filter umtool run e2e`, on `2223ba07`, no queue wait): **175 passed, 2 failed, 45 skipped,
- 4.4 min**, which is release 10's count. The two failures are `mix.spec.ts:166` and `:201`, the
- known order-dependent pair; the skips are the song-data capabilities this machine lacks.
- **`mix.spec.ts` alone: 12 passed** (26 s), both included. The two later commits are a test, the
- README and a comment, so it was not re-run.
-- **Changelog:** umtool has none (`umtool/CHANGELOG.md` does not exist), so nothing was added.
-
-**They bite** (`o5-bite.py`: scratch copies of `report-to-video/`, the worktree untouched; `svg-faces`
-+ `brand` tests, 21):
-
-| variant | result |
-|---|---|
-| the tip, unmutated (control) | 21/21 |
-| `cb9d02b2` (the old code) | both files fail at import (`MONO_BOLD_FONT_FILE`, `fit` not exported) |
-| `b9933d71` (bold in, measured face not yet) | both fail at import (`brandSvgFace`) |
-| `fit()` counts for every face | 4 fail: Plex inside its budget, measured not counted, wrap, the scroll render |
-| the scroll head fitted without its face | 1 fails: the scroll render (`THE QUARTERING · MED…` in Plex) |
-| `wrapPx()` counts for every face | 1 fails: wrap |
-| `rasterize()` without `childOpts` | 1 fails: the rsvg env test |
-| `fontBold` not set | 1 fails: the preset's render |
-| `IBMPlexMono-Bold.ttf` removed | 2 fail: the vendored faces, `fonts.conf` resolution |
-
-**Found and left**
-- **Fira's unbranded path can overrun its own columns** given long enough text (the scroll head
- above; uppercased text at every site). None of the real manifests' labels comes near a budget,
- and the byte-identity rule forbids changing it. If it ever matters, the fix is a Fira table like
- Plex's, and that has to be pinned to one Fira build.
-- **The scroll's first column head** is fitted to the column pitch (140 px) and ignores the `DATE`
- head to its left. "THE QUARTERING" clears `DATE` by 8.4 px of advance in Plex (23 in Fira), and a
- head near 140 px would reach it in either face. Not hit by any manifest.
-- The 1.3 em fallback for unmapped characters is a bound, not a measurement: nothing rendered an
- emoji or CJK label through a fallback font.
-- **`plans/STATE.md`** ("New lows", l. 154–155) lists both of this slice's items as open. **S4's
- record** in `brand-and-themes.md` (l. 1451–1453, 1541) states them as they were. Neither file is
- this slice's to edit, so they are left for the integration pass.
-
-### Follow-ups O2b (2026-09-28)
-
-After O2's review (`o2-review.md`, SHIP) and the merge (`main` `139a648e`: O4, O3, O6-A, O1, O2), one
-small round on the same branch and worktree. `main` merged first (a fast-forward).
-
-**What changed**
-- **The hub's visitor-added archives are fitted per base** (O2's found-and-left, now safe: O1 is
- merged).
- - `useHubSites` maps every external archive's accent through `fittedHex`, which is
- `perBaseColor(resolveAccent(hex))` (`common/lib/siteColor.ts`; `siteColor` uses it too).
- - So the card stripe, the scope chip's dot, the search result edge and the channel group all get
- the fitted value from the one place.
- - A value that is not a `#rrggbb` is dropped, so it never reaches a style. Before, a remote
- `/site.json` could put any string there. The card then falls back to `var(--brand)`, as with no
- accent.
-- **R2's low 2, recorded here:** O2 also changed the hub's DEGRADED path.
- - This is an official archive with a named accent whose `hub-summary.json` is missing, or whose own
- hex disagrees with it.
- - It used to paint the on-dark hex on every base, and now paints that hex fitted per base (for
- example Brass `#e3b15c` → `#8a6c38` on light, against the swatch `#95661a`).
- - The export changelog now says so.
-- **`normalizeSocialSvg` passes over a `<clipPath>` exactly like a `<mask>`** (O1 review, re-read
- low).
- - It handles the block and the self-closing form, the self-closing one first.
- - So Figma's usual one-colour export counts as ONE colour and is themed: a black path in a group
- clipped by `<clipPath><rect fill="white"/></clipPath>`.
- - x.com and Kiwi Farms are byte-for-byte as before (their tests pin the whole output), and the
- rule is still idempotent (the Figma icon is in the idempotence loop).
-- **R2's nits:**
- - `tokens.css`: the chart-6 CVD pairs are "deutan", as the validator prints.
- - `homepage/app/lib/summary.ts`: the comment names the synthetic summary.
- - `ArchiveGrowthChart.tsx`: the today-order numbers are "today's mapping — release 10's slice MC,
- re-run in release 11".
- - This record: gone shows only as `FamilyStats`' figure (`RecentAdditions` is rendered nowhere).
- - `brand-and-themes.md`: 50 colour tokens (a dated note).
- - `perBaseColor` throws a `RangeError` on anything but a `#rrggbb` per base, rather than paint
- `rgb(NaN …)`.
- - FACTS: `perBaseColor`'s value is CSS only (never parse or compare it as a hex); a fourth base must
- add its flag; the added archives use the same fit.
-- **The no-data pages are specced again** (R2's low 4). `homepage/e2e/no-data.spec.ts` runs serially.
- - It renames `e2e/.e2e-summary.json` to `.e2e-summary.json.aside`, which is gitignored by the same
- pattern, and restores it in `finally`.
- - It asserts `/` shows "Every word a channel said, searchable to the second." with no growth
- chart, no Official Instances and no build date.
- - It asserts `/stats/` shows "This build shipped without dashboard data" and no chart.
- - It then checks the next `/stats/` draws the fixture again.
-- **Changelogs:**
- - export `[Unreleased]` gains one bullet: the added archives and the degraded path, fitted per
- base.
- - O1's single-colour bullet now says clip paths are left alone and do not count (the Figma case).
- - `homepage/CHANGELOG.md` gains the single-colour social icon (the homepage footer's links are the
- same normalized `socialLinks`), on the parent's ruling on O1's question.
-
-| sha | what |
-|---|---|
-| `c17ead28` | `common:` `normalizeSocialSvg` passes over `<clipPath>` (block + self-closing); the Figma-shape test |
-| `ee0a252e` | `hub:` the added archives' accent through `fittedHex` (`useHubSites`); `perBaseColor`'s input check; `ArchiveShelf` comments; unit tests; the hub e2e |
-| `ac8c4d2b` | `homepage(e2e):` `no-data.spec.ts` |
-| `36e4fabd` | `comments:` the three code-comment nits (`tokens.css`, `summary.ts`, `ArchiveGrowthChart.tsx`) |
-| `36fc74f8` | `changelogs:` export (the fitted hub archives; clip paths in O1's bullet), homepage (the single-colour icon) |
-| _this_ | `plans:` this section; the record's gone line; FACTS; `brand-and-themes.md`'s token count |
-
-**Gates** (logs `o2b-*.log`):
-- **tsc** clean before the code commits (89 s, `o2b-tsc1.log`).
-- **common 2,110/2,110:** `main` `139a648e`'s count + 3 (the Figma test, `fittedHex`, the input
- check).
-- **e2e** (queued behind nothing; nothing failed, so no re-runs):
- - `e2e:hub` full **33 passed** (1.2 min; 32 at O1 + the added-archive test);
- - export `site-branding` **7 passed** (12 s);
- - homepage full **31 passed, 0 skipped** (44 s; 30 + `no-data.spec`), from this worktree with no
- `homepage/public` data;
- - after the homepage run the fixture file is back in place and no `.aside` is left.
-- **The primary's `export/public`** is byte-identical before and after (392 entries, 380 files).
-
-**They bite:**
-- **Figma:** against the previous `settingsSchema.ts`, the Figma test fails with the fills
- `['none', 'black', 'white']`: two colours, so nothing is themed. The other 13 pass
- (`o2b-bite-svg.log`).
-- **The added archive:** with `useHubSites`' `.map(fittedHex)` removed, the hub test fails on light,
- expecting `rgb(132, 105, 116)` and receiving `rgb(244, 194, 215)` for both the stripe and the dot
- (`o2b-e2e-bite-hub.log`).
-- **The input check:** without it, `perBaseColor`'s throw test fails (1 of 15;
- `o2b-bite-unit-check.log`). Against `main`'s `siteColor.ts` the test file does not load at all
- (no `fittedHex`).
-- **No data:** with the loader's old bug (a zero-filled summary when there is none),
- `no-data.spec` fails: `/stats/` never says "This build shipped without dashboard data"
- (`o2b-e2e-bite-nodata.log`).
-
-**Found and left**
-- **A dev-console warning, not O2b's:** the homepage run logs `[browser] Received NaN for the width
- attribute` during `stats.spec`'s Customize test (ranked / small multiples). It is in O2's runs too,
- so it predates O2b.
-
-### Slice O6, as shipped — checkpoint B: the `E2E_` prefix cleanup (2026-09-28)
-
-After checkpoint A merged (`cb9d02b2`), the branch fast-forwarded to `main` `15d5d646` and then
-`59d2f877` (O2b in). No merge commit was needed. The plan was written first
-(`$T/o6-b-plan.md`): every variable, every reader, old → new, and which stay unprefixed and why.
-
-**The rule.** A variable only a harness reads gets the `E2E_` prefix and is declared in its
-package's playwright config. "A harness" means a playwright config, an e2e helper, a fixture, a
-fake binary, a stub server, the sharded runner, or a test-mode branch of app code. The config
-either sets the variable (webServer `env`) or lists it with where it is read. Two new
-`envVars.test.ts` tests hold the rule:
-- the `test` audience is `E2E_`-prefixed (`PLAYWRIGHT_BASE_URL` and `QUEUE_LOCK_HELD` are
- excepted, with the reason);
-- each test-audience variable is named in a playwright config (the queue's own variables in
- `queue-lock.mjs`).
-
-**Renamed**, every reader and writer:
-
-| old | new |
-|---|---|
-| `EDITOR_TEST_ROUTES` | `E2E_TEST_ROUTES` |
-| the five `AUDIO_CHECK_*_OVERRIDE` | `E2E_AUDIO_CHECK_*` (suffix dropped) |
-| `AUDIO_CHECK_DEBUG_PAUSE_MS` | `E2E_AUDIO_CHECK_DEBUG_PAUSE_MS` |
-| `FAKE_YTDLP_*` ×7, `FAKE_GALLERY_DL_AUTH_FAIL` | `E2E_FAKE_*` |
-| `FIXTURE_MAX_LIFETIME_MS`, `OLLAMA_STUB_MODEL`, `RACK_SHOTS`, `TWO_ORIGIN_REBUILD`, `HOMEPAGE_SUMMARY_FILE` | `E2E_…` |
-| `SHARDS`, `IMAGE`, `SKIP_BUILD` (sharded runner) | `E2E_SHARDS`, `E2E_IMAGE`, `E2E_SKIP_BUILD` |
-| umtool: `EDITOR_STUB_LOG`, `UMTOOL_CUT_DELAY_MS`, `UMTOOL_EXTRA_KINDS` | `E2E_…` |
-
-- **The editor's test-server values moved.** `E2E_TEST_ROUTES` and the audio-check knobs moved
- from `dev:test` / `start:test` into `editor/playwright.config.ts`'s `E2E_SERVER_ENV` (the
- webServer's env). A hand-started `dev:test` could already not be reused under the queue's port
- check, so nothing depended on it carrying them.
-- **Newly declared:** `E2E_RETRIES` (read dynamically, so the scan had missed it), and two runtime
- knobs the scan had also missed because they are read through helpers:
- `AUDIO_CHECK_RESUME_DURING_PROBE` and `AUDIO_CHECK_BACKOFF_FACTOR`. The scan now knows
- `env(Int|Float|Bool)Override` and `parseIntArg`.
-- **umtool's three** are declared in `umtool/playwright.config.ts`, not in `envVars.ts` (umtool is
- outside the list until Phase 5).
-
-**Unchanged, by design:**
-- the queue lock and port check: `E2E_QUEUE`, `E2E_PORT_CHECK`, `E2E_QUEUE_TIMEOUT`,
- `E2E_PORT_GRACE_MS`, `E2E_QUEUE_LOCK_FILE`, `QUEUE_LOCK_HELD`, and the lock file;
-- the port names (`ports.mjs`, the worktree injector, queue-lock's `--ports` lists);
-- `PLAYWRIGHT_BASE_URL`, `CI`, and the real overrides a harness points at fixtures;
-- the docker `ARCHILYZER_*` set;
-- two unit-test knobs, `KEEP_TAG_PREVIEW_FIXTURE` and `CUES_TEST_DIR`, which are read by node unit
- tests, not an e2e harness.
-
-**Ports.** Everything that used to spell a fallback now reads `common/lib/ports.mjs`
-(`portFor` / `PORT_BASES`), so `ports.test.ts` finds only the package.json shell defaults and
-the `--ports` lists, which cannot import a module:
-- the configs: editor, export, hub, 2origin, homepage, umtool;
-- the editor's `baseUrl.ts`, the two export specs, and the ollama stub;
-- the umtool editor stub and the 2origin spec.
-
-The umtool stub's port is now `EDITOR_STUB_PORT`'s base whatever `UMTOOL_E2E_PORT` is, which is
-what queue-lock's preflight already checked.
-
-**Folded in (the parent's asks):**
-- The Settings Build mode options read "Basic (a label for now)" / "Docker (a label for now)".
-- The per-site panel's note shows whatever the mode is (its `serial` prop is gone).
-- `/sites`' Build all sentence no longer says "(Docker mode)".
-- The public homepage's "Building several sites at once" page and its `/docs` blurb say Build all
- uses containers whenever an engine is available, and that the mode is a label; the homepage
- changelog has a bullet.
-- `E2E_SHARDS` is in CONTRIBUTING.md and SETUP.md.
-- One editor `[Unreleased]` bullet.
-
-| sha | what |
-|---|---|
-| `f4367aca` | `e2e:` the renames, the declarations, `E2E_SERVER_ENV`, the two guard tests, the harnesses on ports.mjs, ENVIRONMENT.md regenerated |
-| `43b2572b` | `editor:` the build-mode options, the per-site panel note, /sites' Build all sentence |
-| `b3f2ee86` | `docs:` `E2E_SHARDS`; the homepage's Docker page and blurb |
-| _this_ | `plans:` this section; the editor and homepage `[Unreleased]` bullets |
-
-**Gate B**, on `59d2f877` + these commits, from the worktree root. The logs are `o6-gateB*.log`
-and `o6-gB-*.log`.
-- tsc clean (66 s, then 31 s).
-- **common 2,112/2,112**, **editor unit 85/85**, **`test:scripts` 185 + 1 skip**, **mcp
- 269/269**, homepage unit 2/2.
-- `docs env --check`, `settings example --check` and `docs files --check`: all exit 0.
-- Every touched playwright config loads (`playwright test --list`): editor 665, export 206, hub
- 33, homepage 31, umtool 222.
-- **Editor subset** (`o6-specsB.txt`: ops-api, worker-unit, audio-check-classifier,
- audio-check-scenarios, social-channel, digest, export-search, export-player-platform-cache,
- deploy-page, settings, channels-rack-audit), with `E2E_RACK_SHOTS=1` so the audit actually runs
- (its shots landed in `editor/test-results/rack-shots/`): **115 passed, 0 failed, 5.3 min**.
-- **Export full:** **206 passed, 0 failed, 6.7 min**.
-- **`e2e:hub`:** **33 passed, 1.2 min**.
-- **Homepage full**, with the primary's `homepage/public` data copied: **31 passed, 0 skipped, 45 s**.
-- **umtool full** (`SONG_DIR=~/reports/quartering-uh-song/data`): **175 passed, 2 failed, 45
- skipped, 4.1 min**. That is exactly O5's recorded baseline. The two failures are the known
- order-dependent pair, `mix.spec.ts:166` and `:201`; the skips are the song-data capabilities.
- **`mix.spec.ts` alone: 12 passed** (22 s). The renamed umtool knobs are exercised in that run:
- deliver's Stop test passed (18.3 s, `E2E_UMTOOL_CUT_DELAY_MS`), and so did the
- unregistered-kind test in projects.spec (`E2E_UMTOOL_EXTRA_KINDS`).
-- **They bite** (`o6-bite.log`, "checkpoint B"):
- - a test-only var without the prefix fails 4, including the prefix test;
- - removing a name from the editor config's declaration fails the declared-in-a-config test (1);
- - an old name read again in a fixture fails "every variable the code reads is declared" (1);
- - a drifting port fallback in `baseUrl.ts` fails `ports.test` (1).
-
-**Found and left (checkpoint B):**
-- **`e2e:2origin` was run by the reviewer, not by me** *(corrected after review S1; the first
- version of this bullet was wrong)*. Its config's ports and declaration changed, and its setup
- reads the renamed `E2E_TWO_ORIGIN_REBUILD`.
- - The reviewer ran `E2E_TWO_ORIGIN_REBUILD=1 node scripts/worktree.mjs run -- pnpm --filter
- export run e2e:2origin` in this worktree: **3 passed** (34.3 s), the hub rebuilt.
- - The primary's `export/public` was byte-identical before and after: all 380 files matched on
- path, type, size, mtime and md5 (`$T/o6b-rv-{before,after}.{meta,md5}`).
- - Why: compose-hub writes through `writePublicFile`, which removes the path first and so never
- writes through a link, and `sw.js` / `hub-summary.json` are `rm`'d, which removes the link
- only. I had claimed the opposite.
- - The run leaves this worktree's `export/public` with real files where links were; they were
- re-linked afterwards (review L2).
- - Never run it from the primary checkout: there the entries are real files, and `build:hub`
- would overwrite the live hub files with an empty pool (the release-7 accident).
-- Old names survive only in `plans/` and released changelog text.
-
-**Review fixes (checkpoint B)** — the review (`o6b-review.md`) was SHIP AFTER FIXES, with no
-blocker. Docs and record only:
-- **S1:** the `e2e:2origin` bullet above is corrected with the reviewer's run and evidence. The
- "run it from the primary" advice is deleted here and in the report; it would have repeated the
- release-7 accident.
-- **L1** (the commit just before this record's): WORKTREES.md now says a server reused under
- `E2E_PORT_CHECK=0` must be started with the config's `E2E_SERVER_ENV` values.
-- **L2:** the reviewer's 2origin run left real files where this worktree's `export/public` links
- were: `corpus.json`, `_headers`, `hub-sites.json`, `llms.txt`, `robots.txt` and `sw.js`, and
- `hub-summary.json` was removed. All were re-linked from the primary with the implementer-rules
- loop, in the worktree only. `find export/public -xtype l` is empty.
-- **N1** (pre-existing, recorded only): with `E2E_TWO_ORIGIN_REBUILD=1`, playwright loads
- `playwright.2origin.config.ts` twice, so `stageTwoOrigins()` builds the hub twice per run.
-
-### Integration, as merged (2026-09-28)
-
-Every slice was reviewed to SHIP on its own branch and merged by the parent as it landed; this pass
-gated the combined tree once and wrote the records. Worktree `/home/user/Projects/r11-integration`,
-branch `r11/integration`, port block #5, fast-forwarded to `main` `eb28a341` (`pnpm install
---frozen-lockfile`: already up to date). **No code changed at integration**: every gate below ran on
-`eb28a341`, and the commits after it are `plans:` only. Scratch files `int-*` in the job's
-`tmp/overnight`.
-
-| merge | branch → tip | review | on `main` |
-|---|---|---|---|
-| **O4** homepage deploy from `/sites` | `r11/homepage-deploy-ui` → `83b786ca` | SHIP AFTER FIXES → re-read SHIP | `baaa4b47` |
-| **O3** runner lows | `r11/runner-lows` → `f4615403` | SHIP AFTER FIXES → re-read SHIP | `c1d4790a` |
-| **O6-A** Phase 4 slice 3, checkpoint A | `r11/phase-4-s3` → `11d0403c` | SHIP AFTER FIXES → re-read SHIP | `cb9d02b2` |
-| **O1** hub lows + DRAFT copy | `r11/hub-lows` → `8f5011c3` | SHIP AFTER FIXES → re-read SHIP (one new low, folded into O2b) | `6cd3a9fe` |
-| **O2** homepage and brand lows | `r11/homepage-lows` → `1b39f285` | SHIP | `139a648e` |
-| **O5** umtool brand fonts | `r11/umtool-fonts` → `8644e63f` | SHIP (four lows, two wording — see below) | `15d5d646` |
-| **O2b** follow-ups | `r11/homepage-lows` → `013efa35` | SHIP; the review's changelog nits as `59d2f877` on `main` | `69e7f59e` |
-| **O6-B** checkpoint B, the `E2E_` prefix | `r11/phase-4-s3` → `0ccd34f3` | SHIP AFTER FIXES → re-read SHIP | `eb28a341` |
-
-**What joined by hand** (`git show --remerge-diff` on each merge).
-- `baaa4b47`, `c1d4790a`, `cb9d02b2`, `6cd3a9fe` and `eb28a341` merged clean: each branch had merged
- `main` itself first (O3 `0c770285`, O6 `fcdaea12`, O1 `c7b42f23`; O6-B fast-forwarded), and
- resolved its joins there.
-- `139a648e` (O2): `editor/CHANGELOG.md` (O6's CLI bullet, then O2's forced-colours bullet),
- `export/CHANGELOG.md` (O1's five hub bullets, then O2's outline and fitted-hex bullets) and this
- file's Record (O6-A, O1, then O2). Every side kept.
-- `15d5d646` (O5) and `69e7f59e` (O2b): this file's Record only.
-- No code file conflicted in any merge.
-
-**Changelogs, checked as one set.** `editor/CHANGELOG.md` and `export/CHANGELOG.md` each have
-exactly one `[Unreleased]`, directly above `[0.9.4]`: editor **8** bullets (O4 2, O3 3, O6-A 1,
-O6-B 1, O2 1), export **9** (O3 1, O1 5, O2 2, O2b 1). Export's released part (`[0.9.4]` down) is
-byte-identical to the 0.9.4 cut `ee9d41fa`. The editor's differs by exactly two link targets in
-older released bullets (`DEPLOY_DOCKER.md` / `DEPLOY_CLOUDFLARE.md` → PUBLISH.md anchors, words
-unchanged: O6 review Q1, `ef84f535`). `homepage/CHANGELOG.md` keeps its own convention (one
-`[Unreleased]`, no cuts) and gained O2's four bullets, O2b's icon bullet and O6-B's Docker-page
-bullet; O6-B's rename also rewrote one release-10 bullet there (`HOMEPAGE_SUMMARY_FILE` →
-`E2E_HOMEPAGE_SUMMARY_FILE` beside `e2e/fixture-accents.ts`, a file that no longer exists — found
-and left, below). No bullet repeats or contradicts another or the code as merged.
-
-**Gates**, all from the worktree root on `eb28a341` (`$T/int-gates.log`, `$T/int-e2e.log`, per-run
-logs `int-g-*.log` / `int-e2e-*.log`).
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`): clean, 67 s.
-- **Unit and script tests:**
- - common **2,112/2,112**, 45 s (O6-B's recorded count: release 10's 2,038 + O4 3 + O3 10 + O6 30 +
- O1 21 + O2 5 + O2b 3 + O6-B 2);
- - editor unit **85/85**;
- - `test:scripts` **185 passed + 1 skip of 186** (the report-to-video tests included, O5's +10; the
- skip is the `LIVE=1` network test);
- - mcp **269/269**; homepage unit **2/2**.
- - `archilyzer docs env --check`, `settings example --check`, `docs files --check`: all exit 0.
-- **Builds**, all ok, with `export/public` linked per path from the primary (17 links, none dangling)
- and `homepage/public` holding only its tracked `_headers` (no data copied):
- - editor 35 s (`BUILD_ID` `dcjZIUK_AhSRInyprrQny`); the route table lists
- `/api/ops/build-homepage`, `/api/ops/deploy-homepage` and `/api/ops/cut-release`;
- - export site 23 s: `<html … data-accent="signal">`;
- - export hub (`INSTANCE_MODE=hub`) 23 s: `… dark" data-base="dark" data-accent="signal"`,
- `out/ask/index.html` present (48,656 B);
- - homepage (`pnpm --filter homepage exec next build`, NOT `run build`, whose `prebuild` indexes the
- corpus) 12 s: the no-data page; its stylesheet carries the `forced-colors` rule and `--chart-6`
- (×2 `#823c10`, ×1 `#a54a08`);
- - umtool 16 s (`BUILD_ID` `pikb-0UeTC_FTcwMV-Xml`).
-- **e2e**, one detached sequence (04:44 → 05:38), every run through the machine-wide queue (no
- wait: nothing else held it):
-
- | suite | passed | failed | skipped | time |
- |---|---|---|---|---|
- | export full | **206** | 0 | 0 | 6.9 min |
- | `e2e:hub` | **33** | 0 | 0 | 1.2 min |
- | `e2e:2origin` (`E2E_TWO_ORIGIN_REBUILD=1`, links in place) | **3** | 0 | 0 | 34.2 s (64 s with the two hub builds) |
- | homepage full (no `homepage/public` data) | **31** | 0 | **0** | 45.5 s |
- | umtool full (`SONG_DIR=~/reports/quartering-uh-song/data`) | **175** | 2 | 45 | 4.2 min |
- | **editor full** (`pnpm e2e`, 665 tests) | **652** | 1 | 12 | 39.5 min |
-
- The homepage's 31 with 0 skipped is O2's claim proved on a clean worktree: the suite reads its
- synthetic summary and nothing from `public/` or the primary (`e2e/.e2e-summary.json` written by the
- config; `homepage/public` still only `_headers` after). The 45 umtool skips are the song-data
- capabilities this machine lacks (O5's and O6-B's runs: the same 175 / 2 / 45). `e2e:2origin`'s log
- shows `compose hub` run twice (N1) into the WORKTREE's `export/public`.
-- **Failures, classified** (each re-run alone, `$T/int-rerun*.log`):
- - **umtool `mix.spec.ts:166` and `:201`: the known order-dependent pair, not the integration.**
- Failed exactly as FACTS records ("`mix.spec.ts` IS ORDER-DEPENDENT"): the row linked to the
- fixture's `channels/testchan/data/vid1/clips/0.00-14.00.mp4`, left by an earlier spec, instead of
- `/out/clips-raw/vid1_0.00-9.00.mp4`. O5's and O6-B's full runs failed on the same pair. Alone,
- `mix.spec.ts --repeat-each=3`: **36 passed**, 36.4 s (`int-rerun-umtool-mix.log`).
- - **editor `transcript-source.spec.ts:76` ("diagnostics list a video with only
- transcript.en-US.vtt"): a flake, not known before this pass.** The Diagnostics stage rendered
- "Channel health" with no populated bucket, so the snapshot the page read lacked the video in
- `nonStandardVtt`; the `Non-standard transcript VTT name (1)` heading never appeared (5 s
- expect, 17.5 s in all). Alone, `transcript-source.spec.ts --repeat-each=3`: **9 passed** (the
- spec's three tests ×3), 41.6 s (`int-rerun-editor-transcript-source.log`). Release 11 touched
- nothing on its path: not the spec, `e2e/helpers.ts`, `common/controller/channelSnapshot.ts`,
- `common/views/pipeline/stageStatus.ts`, `DiagnosticsStage.tsx` or the channel `page.tsx` (`git
- diff --stat 2162db92 eb28a341`). O3's `RetryBucketControl` change renders inside a bucket's card,
- below the heading that went missing, so it cannot hide it. The likeliest mechanism is
- `generateReport`'s early return when a `snapshot.json` already exists (`e2e/helpers.ts:193`):
- one written between `resetData` and the test's VTT swap (a debounced flush from the test before)
- would be stale and never refreshed. Recorded in FACTS; not fixed (no code at integration).
- - Nothing else failed. The 12 editor skips are `channels-rack-audit.spec.ts`, which runs only with
- `E2E_RACK_SHOTS=1`.
- - **Verdict: FLAKES-ONLY.** No regression.
-- **The primary's `export/public` was never written.** `$T/int-ptree.sh` lists every entry (391:
- 380 files, by path, type, size, mtime and md5; links by target — it has none) without following
- links. Taken before any build (`int-primary-before.tree`, md5 `0f4b1f66…`), after the builds,
- after the export suite, after `e2e:hub`, after `e2e:2origin` and after the editor suite:
- **identical every time** (`cmp`).
- - What the runs did in the worktree: the export suite replaced the `sw.js` LINK with its own plain
- file; `e2e:2origin`'s `compose hub` (which logged "hub-summary.json skipped") replaced the `sw.js`,
- `hub-sites.json`, `corpus.json`, `llms.txt`, `robots.txt` and `_headers` links with plain files.
- The seed (`$T/int-seed-public.sh`) relinked every entry before the next run, and
- `find export/public -xtype l` was empty before each.
-- **The live processes were never touched:** :3001 still serves `BUILD_ID` `S07zTu3MKTjHJa9eDM1GF`
- (2026-09-26 21:46); nothing was deployed, cut, pushed, restarted or written under `transcripts/`.
-- Numbers tools: none.
-
-**Records folded in at integration** (the `plans:` commits below).
-- **FACTS:** a new section, "Release 11 — slices O1–O6", anchored at `eb28a341`. Amended with dated
- notes: the `/api/test/*` guard's variable (`EDITOR_TEST_ROUTES` → `E2E_TEST_ROUTES`, now set by
- `editor/playwright.config.ts`' `E2E_SERVER_ENV`, not `dev:test`), `TWO_ORIGIN_REBUILD` →
- `E2E_TWO_ORIGIN_REBUILD` in the two worktree-link facts, and `DEPLOY_CLOUDFLARE.md` →
- `PUBLISH.md` in the preview-access fact. Release 10's "L1 — hub lows" was already amended by O1
- (`ac9c299b`); its colour entry gains one dated line (`fittedHex` is `perBaseColor`'s only
- production caller). A closing subsection, "What the integration gate found", records the
- `transcript-source.spec.ts:76` flake and what each suite writes into a worktree's
- `export/public`.
-- **O5 review's two wording lows (L1, L2) are recorded in FACTS, not fixed**: IBM Plex Sans has
- positive kerning pairs, so the sum of advances is not conservative in general (real text's worst
- net kerning +0.50 px); `FALLBACK_EM` 1.3 is exceeded by a few wide symbols (`⟹` 1.42 em). The
- comment at `umtool/report-to-video/svg-faces.mjs:32-35` and the README's "Why a table" still say
- otherwise — a comment-only fix for a later slice (no code changes at integration).
-- **STATE:** a new "Now (2026-09-28, morning)" block above the 0.9.4 one. The 2026-09-26 block's
- "New lows (not started)" (the x.com icon through umtool's fonts, formerly l.142–155) and the
- 2026-09-27 rollout's two new lows get a dated note: all closed, with the slice that closed each.
-- **`brand-and-themes.md`:** S4's record said the rail/ledger/chart text stays Fira and no bold Plex
- Mono is vendored (the "Not branded, on purpose" bullet, the found-and-left `fontBold` bullet and
- the review-rulings line); each gets a dated note that O5 closed it.
-
-**Found during the pass.**
-- **One `homepage/CHANGELOG.md` bullet is now wrong about its own past.** O6-B's rename rewrote the
- release-10 bullet "The e2e reads a copy of the summary with fixture accents (`HOMEPAGE_SUMMARY_FILE`,
- `e2e/fixture-accents.ts`)" to `E2E_HOMEPAGE_SUMMARY_FILE`; neither the new name nor the file
- existed at that time, and the newer O2 bullet already says the fixture file is gone. Harmless:
- `homepage/CHANGELOG.md` is not published (the homepage's `/changelog` renders export's,
- `homepage/app/changelog/page.tsx:25`). A wording fix at the next touch.
-- **The O1 review's new low (a `<clipPath>` counted as a colour) was folded into O2b** (`c17ead28`),
- so nothing from it is open.
-- **Merged code already runs where processes spawn scripts from disk.** The primary checkout is on
- `main` `eb28a341`, so the live :3050 already spawns O5's `umtool/report-to-video/*` (a branded
- render gets Plex and the bold mono; an unbranded one is byte-identical), and any build the live
- :3001 starts runs the new on-disk scripts (release 7's lesson). O6 kept every package-script name
- the publish pipeline calls (`build:index`, `compose:site`, …), so an old-editor build still
- resolves them; an unattended build-deploy would publish the merged code with its `[Unreleased]`
- notes, which the operator accepted for the night. Outside `report-to-video/` and its e2e, umtool
- changed only in `lib/tools.mjs` (O6's shared probe) and two test-only variable names
- (`bin/cut-from-cache.mjs`, `lib/projects/kinds.mjs`); nothing requires a rebuild.
-
-| sha | what |
-|---|---|
-| `eeff74c3` | `plans:` FACTS — release 11 section; dated amendments (the `E2E_` names, PUBLISH.md) |
-| `3643c974` | `plans:` `brand-and-themes.md` — O5 closed S4's Fira and bold-mono notes |
-| _this_ | `plans:` this record, STATE ("Now (2026-09-28, morning)"), the Rollout steps |
-
-### Operator rulings and follow-up O1c (2026-09-28 morning)
-
-**The operator's words:** "Accept the rust, Vermilion keeps slot 6, ship the drafts as written but I
-don't like this regex bracket link thing, just put it in the string or use a template literal or
-something."
-
-**The rulings:**
-- **The four copy lines ship as written.** The three DRAFT markers are removed, and the words are
- unchanged:
- - `NO_ARCHIVES_IN_SCOPE` (release 10's): "No archives selected. Choose some on the hub's front
- page to ask.";
- - `NO_ARCHIVES_ON_HUB`: "This hub has no archives yet. Add one on the hub's front page to ask.";
- - `LIVE_CHAT_MISSING`: "live chat didn't load";
- - `ASK_SCOPE_LINE`: "Searching N of M archive(s) — change on the front page." It is shown whenever
- at least one archive is in scope.
-- **`--chart-6`'s rust near `--state-gone` is accepted** (O2's question).
-- **Vermilion keeps slot 6** (`ACCENT_CHART_SLOT.vermilion = 5`, the runbook's question).
-- **Still open** at the time: O6's Build all vs `buildPipeline.mode`, and O3's full check of the
- five 410'd Rumble videos. *Both closed later that morning: the mode dropped (follow-up O6c) and
- the full check run ("Operator actions (2026-09-28 morning)").*
-
-**O1c: the link is written in the line** (`a4ffa959`). Branch `r11/hub-lows`, fast-forwarded to
-`main` `e1cedf3d` first.
-- **What replaced the regex.** Each line is a tagged template:
- `` copy`No archives selected. Choose some on the ${link("hub's front page")} to ask.` ``.
- - `copy` returns a `Copy`: `{before, link?, after, text}`.
- - Plain interpolations (numbers, strings, brackets) are text. Only a `link(…)` value (a
- `CopyLink`) becomes the link to `/`, so nothing is parsed out of the words.
- - Two links in one line throw where the line is built: at module load for the constants.
- `ASK_SCOPE_LINE` is evaluated once at load for the same reason.
-- **What was deleted:** `copyWithLink`, `copyText` and the regex.
-- **Where a `Copy` goes:**
- - `LinkedCopy` takes a `Copy`. `AskChat` and `AskScope` pass the values through unchanged, and
- `ASK_SCOPE_LINE` returns `Copy | null`.
- - The hub specs (`ask.spec.ts`, `federated-search.spec.ts`) read `.text` / `.link`.
-- **How to edit a line** is in `hubScopeCopy.ts`'s header: change the words; wrap the linked phrase
- in `${link("…")}`, or drop the wrapper for no link; `ASK_SCOPE_LINE` may return `null` to hide the
- line.
-- **Rendered output is unchanged, byte for byte.** `LinkedCopy` still renders `before`, one
- `<Link href="/">` with the same classes, then `after`. `o1c-same.log` compares the old regex
- split and the old `copyText` with the new values for both constants and `ASK_SCOPE_LINE` at
- (0,1), (1,1), (1,2), (2,5) and (5,5): all identical, and `LIVE_CHAT_MISSING` is the same string.
-- **Why:** the operator's ruling. A reader-facing line should not depend on a bracket convention and
- a regex, and any `[…]` pair in future copy would have been read as a link.
-- No changelog bullet: nothing a reader sees changed.
-
-| sha | what |
-|---|---|
-| `a4ffa959` | `hub:` `copy` / `link()` / `Copy` replace the [bracket] + regex; the four lines as ruled, DRAFT markers gone; `LinkedCopy` takes a `Copy`; the specs read `.text` / `.link`; +4 unit tests |
-| _this_ | `plans:` the rulings here, in O2's and O1's records, FACTS and STATE; Rollout step 1 |
-
-**Gates** (logs `o1c-*.log`; the e2e logs are `o1-e2e-{hub,export}-3.log`):
-- **tsc:** clean (`o1c-tsc-1.log`, 82 s).
-- **Unit and script tests** (`o1c-units.log`): common **2,112/2,112**, editor unit **85**, `test:scripts`
- **185 + 1 skipped**, mcp **269**.
-- **The new unit test:** `export/app/ask/hubScopeCopy.test.ts` **4/4** (run with export's tsx; no
- suite script runs `export/app/**/*.test.ts`).
-- **e2e** (`o1c-run.log`):
- - `e2e:hub` in full: **33 passed**, 1.8 min;
- - export `ask-chat` + `ask-workspace`: **29 passed**, 1.4 min.
- - The primary's `export/public` was unchanged: 380 files, size + mtime + md5.
-
-**It bites** (`o1c-bite.log`):
-- **Against the old `hubScopeCopy.ts`:** **4 of 4 fail**. There is no `copy`/`link`, and the
- shipped lines are strings with no `.text`.
-- **A mutation, a second link not throwing:** exactly the two-links test fails.
-
-### Follow-up O6c — the build-mode stub dropped (2026-09-28 morning)
-
-**The ruling.** The operator: "If docker build mode isn't ready yet, just drop it for now rather
-than keep the stub." `buildPipeline.mode` was a label nothing read (O6's review S2). Build all and
-Build & deploy all use containers whenever `docker version` answers, and build serially on the host
-otherwise. That is unchanged. Branch `r11/phase-4-s3`, fast-forwarded to `main` `27723d37` first.
-
-**What went:**
-- `common/lib/settingsSchema.ts`: the `mode` key, `BuildMode` and `isBuildMode`, and `mode`'s
- field doc. The buildPipeline description and the `maxParallelBuilds` doc no longer name a mode.
- `SETTINGS.md` and `settings.json.example` are regenerated.
-- The `/sites` Basic | Docker toggle: `BuildModeToggle.tsx`, `buildModeAction.ts`, and its use and
- `getSettings` import on `/sites`.
-- The Settings form's select (and "(Docker mode)" in the Max parallel builds label) and
- `settings/actions.ts`' handling of it.
-- The publish tab's "Build mode (Basic or Docker) is set on the Sites page" line.
-- The mode's mentions in:
- - `BuildAllSitesButton` (comment and paragraph) and `BuildSitesPanel` (comment and note);
- - the `buildAction.ts`, `publish/build.ts:378` and `Dockerfile.build:1` comments;
- - `PUBLISH.md`, `RUNNING_IN_DOCKER.md:~545` and the homepage's `deploy-docker.md`.
-- Specs:
- - `deploy-page.spec`'s toggle test is now "/sites has no build-mode toggle, and Build all says
- when it uses containers";
- - `settings.spec` saves the three real fields and asserts no Build mode control and no `mode`
- on disk.
-
-**What stays:** the container path, `maxParallelBuilds`, `dockerImage` and `dockerfile`.
-
-**An old file still loads.** The operator's `settings.json` says `"mode": "basic"`.
-`sanitizeBuildPipeline` builds its output from the three real fields only, so that file loads with
-no error, and the next save writes no `mode`.
-- `settingsSchema.test.ts`: the sanitizer and the whole-file parse drop `mode`, for `"basic"`,
- `"docker"`, junk and a number.
-- `settingsWrite.test.ts`: a file carrying `mode` loads through `getSettings()`, and
- `writeSettings` puts exactly `{maxParallelBuilds, dockerImage, dockerfile}` on disk.
-- `settings example --check` compares the committed `settings.json.example` and `SETTINGS.md`
- against what the schema generates. Both are regenerated without `mode`, so it exits 0.
-- It never reads the operator's file.
-
-**Changelogs.** The O6 editor `[Unreleased]` bullet that said "the mode is a label" is replaced,
-not stacked. It now says the toggle and setting are gone, an old file loads, and Build all uses
-containers when it can, as it always did. The O6-A bullet's build-mode sentence is removed. The
-homepage bullet for its Docker page says there is nothing to switch on.
-
-| sha | what |
-|---|---|
-| `5b6a66ec` | `editor, common:` the stub dropped (schema, toggle, select, copy, the two specs, two new settings tests) |
-| `7262256f` | `docs:` PUBLISH, RUNNING_IN_DOCKER, the homepage's Docker page |
-| _this_ | `plans:` this record, STATE, FACTS amendments; the editor and homepage changelog bullets replaced |
-
-**Gates**, from the worktree root on `27723d37` + these commits (`$T/o6c-*.log`):
-- tsc clean (70 s).
-- **common 2,114/2,114** (+2), **editor unit 85/85**, **`test:scripts` 185 + 1 skip**, **mcp
- 269/269**.
-- The three `--check`s: all exit 0.
-- `next build`: editor ok (39 s), homepage ok (15 s).
-- **e2e** (`o6c-specs.txt`: deploy-page, settings, sites-crud, sites-homepage, ops-api): **56 passed, 0
- failed, 2.2 min**.
-- **They bite:** with `27723d37`'s `settingsSchema.ts` under the new tests, both new tests fail
- (22 pass, 2 fail — `o6-bite.log`).
-
-**Operator actions (2026-09-28 morning).**
-- **The five 410'd Rumble videos are settled.** On the operator's word ("full check the rumble
- channels"), the parent ran **Full-check unexpected** on the live :3001 at **2026-09-28 13:32Z**,
- through the editor's `platform:rumble` queue at concurrency 1 (`$T/fc-run.log` has the job ids; the
- per-video verdicts are the job logs, `transcripts/.jobs/<id>*.log`):
- - `rekietalaw-rumble`, job `01M3M3EVM0M3EZH9ETK6KY1AH7`: `v7e07us` deleted. `v7emb9a` was NOT
- probed: "Skip v7emb9a: no webpage_url in metadata.info.json". Its dir holds only a failed
- download from 2026-08-26 (`availability.json` `error`, source `download`), so it stays "Missing?"
- as it already was: it was never one of O3's five, and no check can settle it without a URL;
- - `the-quartering-rumble`, job `01M3M3F55A7VESDMYTM5801YJK`: `v4vriou`, `v4x5o1l`, `v4yqask` and
- `v501kfc` deleted;
- - 0 errors.
-- So O3's five read **Deleted** at the next index build, not "Missing?". Jeralyzer's and
- Rekietalyzer's "Missing?" counts do not rise by 4 and 1.
-
-## Rollout
-
-Nothing is rolled out: no cut, no deploy and no restart happened overnight, by rule. `main` is the
-integration tip (above); the live :3001 editor still runs `BUILD_ID` `S07zTu3MKTjHJa9eDM1GF`
-(2026-09-26 21:46), and the live sites are 0.9.4. The operator owes, in order (the parent's runbook,
-`~/reports/overnight-2026-09-28/MORNING.html`, has the scripts):
-
-1. ~~**Rule on the copy lines**~~ **Ruled 2026-09-28: the four lines ship as written** ("Operator
- rulings and follow-up O1c", above). The drafts' markers are gone and each link is written in its
- line (`` copy`…${link("…")}…` ``); no commit is owed for them before the cut.
-2. **Answer the records' questions** (none blocks the rollout):
- - ~~O6: should Build all / Build & deploy all honour `buildPipeline.mode`?~~ **Ruled 2026-09-28:
- dropped.** Follow-up O6c removed the mode, the `/sites` toggle and the Settings select;
- containers are used whenever `docker version` answers, as before.
- - ~~O2: is `--chart-6`'s rust acceptable beside `--state-gone`?~~ **Ruled 2026-09-28: accepted;
- Vermilion keeps slot 6.**
- - ~~O3: settle the five Rumble videos that got HTTP 410 on 2026-09-25 with a "Full-check
- unexpected" on `rekietalaw-rumble` and `the-quartering-rumble`.~~ **Done 2026-09-28 13:32Z:**
- all five read deleted, 0 errors ("Operator actions (2026-09-28 morning)"); they publish as
- Deleted at the next build.
-3. **Cut the release:** `archilyzer release show`, then `archilyzer release cut all next --commit`
- (editor 8 pending bullets, export 9; export's are public on every site's `/changelog`). The
- homepage changelog keeps its own `[Unreleased]` convention and is not cut.
-4. **Restart :3001 on the new `main`** (one restart). It brings O4's Homepage section and the two ops
- routes, O3's retry-bucket, forced-download and Cut release form fixes, O6c's removal of the
- build-mode toggle and select, O6's digest replay that keeps `ids`, and O2's sidebar outline under forced colours. **Restart before
- retrying any `archilyzer run digest` job**: the old editor's replay widens it to the whole channel.
-5. **Write the settings once** (any Save on Settings, or any other settings write). `writeSettings`
- re-normalizes every stored social link, so the x.com icon's `fill="white"` becomes `currentColor`.
- Check `settings.json` afterwards.
-6. **Deploy.** First the five sites by name: the maybe-missing badge change, the forced-colours
- outline, the single-colour icon and the changelog. Then the hub: O1's `/ask` changes, the fitted
- hex for official and added archives, the outline. Then the homepage, **through the new `/sites` →
- Homepage section**: Build homepage with Deploy after build unticked, then Deploy homepage (or `pnpm
- ops build-homepage --wait`, then `pnpm ops deploy-homepage --wait`; the log ends `[deployed]
- https://<hash>.archilyzer.pages.dev`). That is O4's live proof. The homepage reads the index as it
- stands, so it goes after the sites' builds.
-7. **Re-upload the YouTube picture, watermark and banner** (`~/reports/archilyzer-media/brand/`),
- still owed since release 10.
-8. **Optional:** rebuild and restart umtool on :3050. Nothing in the app needs it; O5's render changes
- already reach the live :3050 from disk, and an unbranded render is byte-identical.
-9. **Afterwards:** remove the seven merged `r11-*` worktrees when nothing runs (it re-sorts the port
- blocks; `diet-series` stays).
-
-## Rollout, as done (2026-09-28, 12:11–14:05 local)
-
-Run by the parent from the primary checkout with the scripts in
-`~/reports/overnight-2026-09-28/scripts/`, on the operator's plan of 2026-09-28 (roll out release 11
-as 0.10.0 and launch Jasolyzer, exports off). Logs: `~/reports/overnight-2026-09-28/tmp/r11-*`.
-
-1. **Cut** (`archilyzer release cut all next-minor --commit`): editor **0.10.0** `24c8352e` (8
- bullets), export **0.10.0** `bf6904e8` (9). The homepage changelog keeps its own convention.
-2. **The external drive stalled first.** From 11:35 the auto-download lane's remux of a 10.3 GB
- `nuxanor-kick` VOD, reading and writing the same SMR disk (Seagate ST2000DM008 in a JMicron
- JMS578 UAS enclosure, `sdb`), drove it into 30 s command timeouts, UAS aborts and USB resets
- (`hostbyte=DID_ERROR cmd_age=30s`; the `I/O error` lines are failfast READAHEAD requests; no
- medium errors, no ext4 errors). All four of the live editor's libuv threadpool workers blocked in
- ext4 reads on it, so **:3001 answered nothing** (not even `/api/view/pulse`) from ~12:10 until
- the remux finished at 12:56:39. Every one of the six sites has a channel on that drive (11
- channels), so the rollout waited. The operator checked the cable and ran `smartctl` (the identify
- command failed: the drive was busy). Nothing was killed. Found and left, for a later slice: one
- stalled drive freezes the whole editor.
-3. **:3001 restart** on `main` `e6c5d2e3` (the cut + release 12's slice Q, whose editor-side changes
- are comments and an `[Unreleased]` bullet): `r11-build.sh` BUILD_OK 97 s, `BUILD_ID`
- `S07zTu3MKTjHJa9eDM1GF` → `vWCJb87ktCy5akih_pM9X`; `r11-restart.sh` `/` 200 after 3 s, `/sites`
- has the Homepage section, 0 ZodError, boot `re-queued 0, cancelled 29 (sync 26, stale 3)`. The
- md5 sweep (81 files: settings, every `site.json` and `config.json`, `homepage.json`) was identical
- before, before the restart and after boot. `smoke.sh`: 20 OK lines, `PULSE_OK` ×2,
- `DEFERRED_OK`, umtool OK; `SMOKE_FAIL=1` from one `PAIR_DIFF`
- (`/api/auto-queue/status` vs `/api/view/autoQueueStatus`, 10 bytes of 517 KB, the two calls 98 s
- apart) that is live drift — a `hasanabi` pick and a `HasanAbiVODs3` queue between the calls.
- The OOM killer fired at 13:01:11 on the OLD editor (already exiting under TERM, anon-rss 0) and a
- worktree e2e server; the new editor was unaffected.
-4. **One Settings save** (headless, no change): `buildPipeline.mode` is gone and the x.com icon's
- `fill="white"` is `currentColor`. Two saves ran — the first script's wait resolved on Next's
- empty route-announcer alert and closed early, but its save still landed (13:06:01); the second
- rewrote byte-identical JSON. md5: only `settings.json` changed.
-5. **Jasolyzer:** Pages project `jasolyzer` created (`wrangler pages project create jasolyzer
- --production-branch main`); `/sites/jasolyzer` saved headless with `cloudflareProject`
- `jasolyzer`, `siteUrl` `https://jasolyzer.pages.dev`, archives off, transcript downloads off and
- the draft `siteDescription` "Search through the streams of our favorite game dev, Jason 'Pirate
- Software' Hall" (the operator may reword it). md5: only `transcripts/sites/jasolyzer/site.json`.
-6. **Deploys** (`pnpm ops build-deploy --json '{"siteIds":[six],"skipArchives":true}'`, the host
- path, by name — `r11-sites6.sh`): SITES_OK in 2,872 s, no site skipped.
-
- | Site | Job | Deploy |
- |---|---|---|
- | jasolyzer (first deploy) | `01M3MFRJ9RVDYPERPY22C3MD49` | https://fa021d5b.jasolyzer.pages.dev |
- | jeralyzer | `01M3MFRJDSJV341S08JG0PV21E` | https://9bbd2c88.jeralyzer.pages.dev |
- | anilyzer | `01M3MFRJDZRQWW56APC4NQGVBC` | https://1a6a795d.anilyzer.pages.dev |
- | bonnellyzer | `01M3MFRJEF4K2GJSE0D06FBPYH` | https://bb5cb426.bonnellyzer.pages.dev |
- | hasanalyzer | `01M3MFRJEHZ53S9V6DDN9QVNX1` | https://2cd0d19f.hasanalyzer.pages.dev |
- | rekietalyzer | `01M3MFRJEVNHMNHKQ3KH8BEEZY` | https://1ca2acf8.rekietalyzer.pages.dev |
- | hub (`build-hub {"deploy":true}`) | `01M3MJG5DG0ZGH16VYWWKCT7QR` | https://c215ae89.archilyzer-hub.pages.dev (84 s) |
- | homepage (`build-homepage {"deploy":true}` — **O4's live proof**) | `01M3MJK8NV8N1M3PPGQC6F3V0X` | https://41bef909.archilyzer.pages.dev (73 s) |
-
-7. **Live checks, all pass:** every `/changelog` of the eight surfaces reads 0.10.0; the
- forced-colours rule is in every site and the hub; the x.com footer icon is `currentColor` (it
- follows the footer colour); Jasolyzer serves `data-accent="vermilion"`, a footer listing the
- five siblings and a `corpus.json` of 1 channel / 1,889 videos; `hub-summary.json` has 6
- instances; the homepage's summary has 6 sites and draws Jasolyzer on `var(--chart-6)` (legend and
- area); the five 410'd Rumble videos publish `isDeleted: true` (Jeralyzer `v4taj2f`, `v4uooni`,
- `v4we0zh`, `v4xpb46` — URL slugs `v4vriou`, `v4x5o1l`, `v4yqask`, `v501kfc`; Rekietalyzer
- `v7btopk` — slug `v7e07us`).
-8. **Closed as moot:** the Legal Mindset chat-only tier (its filter has `includeLivestreams: true`,
- so the tier never changes what is kept).
-9. **Still owed:** re-upload the YouTube picture, watermark and banner (since release 10); the
- seven `r11-*` worktrees stay until release 12's worktrees are gone (index-based ports).
diff --git a/plans/release-12.md b/plans/release-12.md
@@ -1,1007 +0,0 @@
-# Release 12 — the source mirror: a read-only git clone on the project site
-
-`main` at `90c7f776` (release 11 merged in full and NOT rolled out: the cut, the :3001 restart, a
-settings save and the deploys are still owed by the operator, `release-11.md` "Rollout"). Release
-12 is the operator's ask of 2026-09-27: the repo mirrored on the project site
-(https://archilyzer.pages.dev) as static, read-only files — `git clone
-https://archilyzer.pages.dev/source/archilyzer.git` over git's dumb-HTTP protocol, a raw tree at
-`/source/tree/`, the tarball regenerated per deploy, and a gate that refuses to publish a denied
-literal. Plan: [`source-mirror.md`](source-mirror.md) (written 2026-09-27 in plan mode, re-checked
-2026-09-28 against `90c7f776`; it entered the repo as slice Q's first commit, never as a direct
-commit to `main`). Rules: `plans/tools/implementer-rules.md`, with the commit trailer this release's
-prompts give.
-
-**The operator's standing choices** (`source-mirror.md`, "Decisions"; not re-opened):
-- **Mirror = `main` only.** `/home/user → /home/user` is scrubbed in file contents AND commit
- messages; the `Co-Authored-By` trailer stays; `plans/` ships as-is. (Superseded 2026-10-09: the
- `Claude-Session` trailer and every Claude session link are removed from the mirror's whole history
- by a built-in rule, and the audit refuses any left — AGENTS.md, first section.)
-- **The private repo's history is never rewritten.** The mirror is generated by `git-filter-repo`
- on a fresh bare clone at every homepage build; its commit ids differ from the private repo's.
-- **Operator-private inputs live outside the repo**, in `${ARCHILYZER_CONFIG_DIR ??
- ~/.config/archilyzer}/`. Nothing carrying the username is in code.
-- **Working alongside the parallel session:** nothing is edited in the primary checkout; each slice
- has its own worktree, and the parent merges with `git merge --no-ff` only on a clean tree.
-
-## The slices
-
-| Slice | Branch | What | Owns |
-|---|---|---|---|
-| Q | `r12/paths-fix` | Fix-forward the hardcoded paths: umtool's `CHANNELS_DIR` from the repo root, `VIDEO_ROOT` and `SONG_DATA` from the home dir (XDG for the song data), the 20 one-off `umtool/song/*.sh` run logs deleted, the machine paths stripped from three tracked umtool manifests, `/run/media/user` out of `common/` | `umtool/**`, `WORKTREES.md`, `common/controller/storageLocations{,.test}.ts`, `common/lib/storageVolumes{,.test}.ts`, `common/views/storage.test.ts`, `common/lib/envVars.ts` (umtool defaults only) + `ENVIRONMENT.md` |
-| R | `r12/source-mirror` | `archilyzer source publish` (filter-repo scrub, repack, dumb-HTTP files, the audit gate, the raw tree, the tarball) run by `buildHomepage`; the `/source/` page; doctor's source block; the docs; `create-archives.sh` deleted | `common/publish/{source,sourceAudit,sourceTree}.ts` + tests, `common/lib/sourceManifest.ts`, `buildHomepage`, `common/bin/{archilyzer,doctor}.ts` + tests, `common/lib/{paths,envVars}.ts` (new variables), `homepage/**`, `.gitignore`, the docs |
-
-**Order:** Q lands first; R branches from `main` after Q merges. The shared files are
-`editor/CHANGELOG.md` (`[Unreleased]`) and this record.
-
-## Record
-
-### Slice Q, as shipped — fix-forward the hardcoded paths (2026-09-28)
-
-Branch `r12/paths-fix` off `main` `90c7f776`, worktree `/home/user/Projects/r12-paths-fix` (ports
-3901/3911, umtool e2e 3951/3952), one Opus implementer. Plan: [`source-mirror.md`](source-mirror.md),
-"Slice Q", steps 1–9. Why: slice R publishes the repo, and its gate refuses any denied literal. The
-Unix username was in code as machine paths (umtool's defaults, 20 run-log scripts, three tracked
-manifests) and in path examples (`/run/media/user`). Scrubbing the published copy is R's job. Q
-fixes the source, so the code no longer depends on one machine's home directory. Scratch files
-`q-*` in the job's `tmp`.
-
-**What shipped.**
-- **Step 1: `CHANNELS_DIR` comes from the checkout.** `umtool/lib/paths.mjs` gains
- `findRepoRoot(start)` and `REPO_ROOT = findRepoRoot(process.cwd())`. The walk goes up to
- `pnpm-workspace.yaml` and falls back to the cwd's parent. It starts from the cwd, not
- `import.meta.url`, which is the `SONG_CODE` rule; the comment says why. `CHANNELS_DIR` is
- `CHANNELS_DIR ?? $TRANSCRIPTS_DIR/channels ?? <REPO_ROOT>/transcripts/channels`, resolved.
- `lib/projects/report.mjs`' `GLOBAL_CHANNELS_DIR` is `() => CHANNELS_DIR`, imported from
- `../paths.mjs`, so there is one definition. `cues.mjs` is untouched.
-- **Step 2: `VIDEO_ROOT`.** `song/spec.mjs` and `song/video-dir.mjs` use `process.env.VIDEO_ROOT ??
- path.join(os.homedir(), "reports", "quartering-uh-song", "videos")`, with `import os` added.
-- **Step 3: `SONG_DATA`.** `song/paths.mjs` resolves `SONG_DIR ?? ~/.local/share/archilyzer/song`
- through `realpathSync`. A path that does not exist has no realpath, so it is **used as given**:
- a missing default still gives a `SONG_DATA`, which every reader finds empty. The header comment
- says the symlink is the supported way to keep the data where it is. It also says why the
- realpath: `SONG_SCRATCH = dirname(SONG_DATA)` keeps pointing at the real job dir.
-- **Step 4: the 20 run logs are deleted** with `git rm`:
- - `backfill-build`, `mk-fatal-finish{,2,3}`, `mk-rebuild`;
- - `ms2-{bg3,drums,full,jerbg,play-rebuild,triangle}`;
- - `pk2`, `pk3`, `pk-v12`, `pkmn-{rebuild,video}`, `rpg-remake-v5`, `rpg-short`, `vshort`,
- `yoshi-rebuild`.
-
- That was every `.sh` in `umtool/song/`. Nothing enumerated or ran them. `lib/jobs.ts`' header
- and timeout doc, and `BuildChain.tsx`'s comment and on-screen note, now say it in the past tense:
- "one-off shell run logs that hardcoded their paths … not in the tree, and not runnable from
- here". No spec asserts that note's text.
-- **Step 5: `um-manifest.json` loses `vid`.** The one-off below stripped all 1,896 `vid` values
- from 3,609 items. `build-um.mjs` now writes `[...merged.values()].map(({ vid: _v, ...rest }) =>
- rest)`, with a comment. The page keeps `vid` in memory: `META` is `JSON.stringify(items)`. The
- item push at `:224` is unchanged.
-- **Step 6: relative paths in the thumb manifests.** The one-off below made `out` relative to
- `~/reports/quartering-uh-song` and `bg` relative to the song data dir: 18 paths in
- `thumb-manifest.json` and 8 in `thumb-accepted.json`. `make-thumb.mjs` writes
- `out: relTo(SONG_REPORTS, path.resolve(OUT))` and `bg: relTo(SONG_DATA, path.resolve(BG))`, with a
- comment naming the two roots. `path.resolve` is there because both are CLI arguments and could
- be cwd-relative.
-- **Step 7: path examples name no user.**
- - `WORKTREES.md:119` → `cwd /path/to/checkout/editor`.
- - `fit-hooks.mjs:93` → `home/<user>`.
- - `/run/media/<user>/` in the comments of `storageLocations.ts`, `storageLocations.test.ts` and
- `storageVolumes.ts`.
- - `/run/media/operator/` in the fixtures of `storageVolumes.test.ts` and `views/storage.test.ts`,
- on both sides of every assertion.
- - The one `editor/CHANGELOG.md` line (see "Changelog").
-- **Step 8 had nothing to do.** `common/lib/envVars.ts` declares none of `SONG_DIR`, `VIDEO_ROOT`
- or `CHANNELS_DIR`. Its header says "umtool's own knobs are NOT here", and `envVars.test.ts:17`
- keeps umtool out of the scan. `ENVIRONMENT.md` is unchanged, and `--check` exits 0. The new
- defaults are documented where umtool's knobs live: a table under "Environment" in
- `umtool/docs/cli.md`.
-
-**Beyond the plan (all in `umtool/**`):**
-- **`SONG_REPORTS` moved into `song/paths.mjs`, beside `relTo`, and `lib/paths.mjs` re-exports
- it.** `make-thumb.mjs` needs it, and the song scripts import only siblings. The e2e fixture copies
- `song/*.mjs` into `.e2e-song/code/` and runs them from there, where `../lib` does not exist. There
- is still one definition, and the default is unchanged.
-- **`relTo(root, p)`.** An absolute `p` inside `root` becomes relative to it. Anything else comes
- back unchanged. Both sides are compared as given and through the realpath of their deepest
- existing part, so a path spelled through the `~/.local/share` symlink counts as inside the
- realpath'd `SONG_DATA`, even for a file not written yet.
-- **`accept-thumb.mjs` records `out` through `relTo(SONG_REPORTS, …)`.** It is the other writer of
- `thumb-accepted.json`, and `/api/browse/thumbs` hands it an ABSOLUTE `file`. Without this, the
- first accept from the page would have written a machine path back into the tracked file. The
- route's comment is updated to match. A relative CLI argument is recorded as typed, as before.
-- **The e2e fixture and a new assertion.** The fixture's accepted `alpha-c` carries the relative
- `out`, while its run log keeps the absolute form, so the suite reads both. deck.spec's
- "serves the ACCEPTED cover" now resolves a relative `out`. The disjoint-accept test asserts the
- CLI recorded `alpha-b` as `thumbs/alpha-b.jpg` (see "They bite").
-- **Comments that described the old default:**
- - `song-capabilities.mjs` and `make-fixture.mjs` (twice) said "the job temp dir … which on most
- machines no longer exists";
- - `browse.ts` said "`out` is an ABSOLUTE path".
-
-**Corrections to the plan:**
-- **The common baseline is 2,114, not 2,112.** O6c added 2 after the plan's re-check
- (`release-11.md`, O6c gates).
-- **Step 8 was a no-op**, as above.
-- **Step 4's `video-dir.mjs:137` is now `:139`**, because step 2 added two lines above it.
-
-**The one-off commands** (the scripts are in the job's `tmp`; what each does is stated here so it
-can be redone):
-- **Step 5:** `node $T/q-strip-vid.mjs umtool/song/um-manifest.json`. It runs `doc.items =
- doc.items.map(({ vid, ...rest }) => rest)` and writes `JSON.stringify(doc, null, 1)` with no
- trailing newline, which is the writer's format; a parse and re-stringify of the old file was
- byte-identical. It printed `stripped vid from 1896 of 3609 items`.
- - `git diff --numstat`: **0 added, 1,896 deleted**.
- - Every deleted line is `"vid": "file://…"`.
-- **Step 6:** `node $T/q-rel-thumbs.mjs "$HOME/reports/quartering-uh-song"
- "$HOME/.claude/jobs/efbe67a7/tmp/song" umtool/song/thumb-manifest.json
- umtool/song/thumb-accepted.json`. For every entry, an absolute `out` becomes relative to the
- first root and an absolute `bg` relative to the second. A path outside its root is refused, not
- guessed. The output format is the same as step 5. It printed `18 paths made relative` and
- `8 paths made relative`.
- - `git diff --stat`: **26 insertions, 26 deletions**, the `out`/`bg` lines only.
-
-**Verified: the same files and the same labels.** Run from `umtool/` with
-`SONG_DIR=/home/user/.claude/jobs/efbe67a7/tmp/song`, before and after the rewrite:
-- **`q-thumbs-check.mjs`** prints `resolveInRoots(out)`, `labelFor` and `browse.thumbFor`'s
- `SONG_REPORTS`-relative path for all 13 entries, plus the absolute `bg`. The two outputs are
- identical except the `CHANNELS_DIR` line, which is step 1: the worktree's own
- `transcripts/channels` instead of the primary's. Every `out` still resolves to
- `/home/user/reports/quartering-uh-song/thumbs/<x>.jpg`, and all 13 exist.
-- **`q-thumbview.mts` runs the app's own readers** (`lib/thumbs.ts` `thumbView` and `lib/browse.ts`
- `thumbFor`) for yoshi, mario-rpg, metal-slug, mortal-kombat and pokemon. For "before", it pointed
- `SONG_CODE_DIR` at `90c7f776`'s two manifests. The output is **identical**: accepted names and
- labels, every candidate's label, the clash strings, `check` and the poster path.
-- **The one visible difference:** a candidate's `file` is now `thumbs/<x>.jpg` instead of the
- absolute path, which changes the bench's grey text. The accept route resolves it to the same
- absolute file.
-- **The `SONG_DATA` default:** no env gives `/home/user/.local/share/archilyzer/song`, used as
- given because the path is absent. `SONG_DIR=<a symlink in scratch to the job dir>` gives the job
- dir, and `SONG_SCRATCH` = `…/efbe67a7/tmp`.
-- **Nothing was created** under `~/.local/share` or `~/.config`.
-
-| sha | what |
-|---|---|
-| `c3177eeb` | `plans:` the source mirror plan (verbatim) and this record file |
-| `de1ead5d` | `umtool:` `REPO_ROOT` + `CHANNELS_DIR` from the checkout; `GLOBAL_CHANNELS_DIR` returns it |
-| `d4d549c7` | `umtool:` `SONG_DATA` (XDG default, realpath, missing → as given) and `VIDEO_ROOT` defaults; fixture comments; `docs/cli.md` defaults table |
-| `292f7a96` | `umtool:` the 20 run-log scripts deleted; `jobs.ts` / `BuildChain.tsx` in the past tense |
-| `4d12652e` | `umtool:` `um-manifest.json` without `vid` (one-off) and `build-um.mjs` strips it on write |
-| `73c39376` | `umtool:` thumb manifests relative (one-off); `relTo`; `make-thumb` / `accept-thumb` write relative; `SONG_REPORTS` into `song/paths.mjs`; the fixture's relative accepted cover |
-| `0b28a7a4` | `common, docs:` `/run/media/<user>` / `operator`, `WORKTREES.md`, `fit-hooks.mjs` |
-| `29dc507c` | `changelog:` one `[Unreleased]` bullet; the released line's path example |
-| `1059befb` | `e2e:` deck.spec pins the relative `out` an accept records |
-| `57ce980a` | `plans:` this record; `source-mirror.md`'s "As shipped" note under Slice Q |
-| `75327c6f` | `changelog:` review L1 — the bullet leads with the full `mkdir -p … && ln -s …` command |
-| `0416881f` | `umtool:` review L3 — `ThumbEntry` declares `bg` (relative to the song data dir; `dataFile()`, never `resolveInRoots`) |
-| _this_ | `plans:` the review, and the operator step corrected (review I1) |
-
-**Gates** (from the worktree root; logs `$T/q-*.log`):
-- **The grep gate** `git grep -c -i 'user' HEAD -- . ':!plans/'` is **empty** (exit 1) at
- `29dc507c` and at `1059befb`.
-- **tsc** was clean before every commit (34–48 s; `q-tsc-{0..7}.log`, all seven packages).
-- **`node --check`** passed on all 11 changed `.mjs`.
-- **Unit:**
- - common **2,114/2,114**, the same count, with tests edited and none added (the three edited
- files 39/39);
- - `test:scripts` **185 + 1 skipped**;
- - editor unit **85/85**;
- - mcp **269/269**.
-- `pnpm archilyzer docs env --check` exits **0**.
-- `pnpm --filter umtool exec next build` is **ok** (20 s).
-- **The `lib/paths.mjs` print** from `umtool/` gives `/home/user/Projects/r12-paths-fix/transcripts/channels
- /home/user/.local/share/archilyzer/song`: this checkout's corpus and the XDG path.
-- **umtool e2e** (`faces.spec.ts deck.spec.ts clip-bench.spec.ts`, with
- `SONG_DIR=~/reports/quartering-uh-song/data`; the queue was free each time):
- - On `29dc507c`: **67 passed, 8 skipped, 0 failed** (2.0 min).
- - deck.spec alone with the new assertion: **14 passed, 2 skipped** (20.5 s).
- - On `1059befb`: **67 passed, 8 skipped, 0 failed** (1.6 min).
- - The skips are the song-data specs. This machine's `data/` has `cand2/` but no `wav48/`, `asr/`
- or `media/`, and `make-fixture` says so.
- - The fixture sets `CHANNELS_DIR` and `SONG_DIR` on both servers, so the green run is also the
- proof that env still wins.
-- **Numbers tool:** none.
-
-**They bite:**
-- deck.spec's disjoint-accept test fails with `90c7f776`'s `accept-thumb.mjs` swapped in: **1
- failed**. It expected `thumbs/alpha-b.jpg` and received
- `…/umtool/.e2e-song/reports/thumbs/alpha-b.jpg`. A trap restored the file, and the tree was clean
- afterwards (`q-e2e-deck.log`).
-- The default changes have no unit tests; umtool has none for `lib/`. They are verified by the
- prints above.
-
-**Found and left:**
-- **Historical mentions of the deleted scripts stay, as the plan says:**
- - `debox-bg.mjs:24` (`pk3.sh`);
- - `hush-head.mjs:47` and `pick-take.mjs:26` (`mk-fatal-finish3.sh`);
- - `video-dir.mjs:5,139` (`pkmn-video.sh`).
-- **`cues.mjs`' `DEFAULT_CHANNELS_DIR` is evaluated inside the app bundle too.** `report.mjs`
- imports `build-video` and `resolve-windows`, which import `cues.mjs`, and there its
- `import.meta.url` walk points into `.next`. Only their CLI entry points read it, so nothing is
- wrong today. It is left alone by the plan.
-- **umtool now reads `TRANSCRIPTS_DIR`,** a declared core variable. `envVars.ts`' `readBy` for it
- does not name umtool, which is out of the registry's scope. I did not change it; it is not this
- slice's file.
-- **`REPO_ROOT` outside any checkout** falls back to the cwd's parent, as the plan says. Started
- from `/`, that is `/`.
-- **`bg` is now relative to the song data dir,** and nothing reads it yet. `ThumbEntry` declares
- it and says how to resolve it (review L3, below).
-
-**Changelog.**
-- **One `[Unreleased]` bullet** in `editor/CHANGELOG.md`. It leads with the change and the command
- a reader runs, `mkdir -p ~/.local/share/archilyzer && ln -s <where the data is>
- ~/.local/share/archilyzer/song`, before restarting umtool (review L1). Then: the corpus from
- `TRANSCRIPTS_DIR` or the checkout, the videos' default, relative manifests, and the run logs gone.
-- **The released `[0.9.0]` storage-locations entry now says `/run/media/<user>/<uuid>`.** A
- released entry is normally left as written. This one was changed because it is a path example,
- not a name a reader would search for.
-
-**For the operator** (the plan's Rollout 0, the slice Q step). Do this **before any umtool
-restart**:
-```
-mkdir -p ~/.local/share/archilyzer && ln -s /home/user/.claude/jobs/efbe67a7/tmp/song ~/.local/share/archilyzer/song
-```
-- **What the link keeps (review I1).** The link target is the live :3050's current default
- `SONG_DATA`, and it holds **only the rebuildable `.cache/umtool`**: 7.9 MB of project index and
- caches, "safe to delete at any time" (`lib/paths.mjs`). The song project's bulk data is under
- `~/reports/quartering-uh-song/data`, not there. The link keeps :3050's `SONG_DATA`,
- `SONG_SCRATCH`, `CACHE_DIR` and `INDEX_DIR` byte-identical to today's (the job dir's realpath is
- its path).
-- **What a missed link costs:** an index rebuild, and the nesting trap. It loses no data. A
- restarted :3050 with no link finds nothing at the new default and may create
- `~/.local/share/archilyzer/song/.cache/umtool` as a real directory. A later `ln -s` would then put
- the link *inside* it (`song/song`). If that happened, remove the directory first.
-- **Linking to `~/reports/quartering-uh-song/data` instead** is a separate choice for the operator.
- It moves `CACHE_DIR` there and makes `SONG_SCRATCH` equal `SONG_REPORTS`.
-- **Before the restart,** the live :3050 is a `next start` build and keeps its baked paths, but it
- runs song scripts from disk:
- - the song build chain passes `SONG_DIR` explicitly (`lib/trim.ts:226`);
- - `accept-thumb` needs only `SONG_REPORTS`, whose default is unchanged;
- - a script run by hand with no `SONG_DIR` looks at the new default.
-
-**Review** (verdict **SHIP**; a read-only Opus review of `90c7f776..57ce980a`, `$T/q-review.md`).
-No High or Medium findings. The coordinator asked for two of the Lows to be fixed:
-- **L1 — fixed, `75327c6f`.** The changelog's bare `ln -s` failed on a machine with no
- `~/.local/share/archilyzer`. The bullet now leads with the full command,
- `mkdir -p ~/.local/share/archilyzer && ln -s <where the data is> ~/.local/share/archilyzer/song`.
- It names no machine path.
-- **L3 — fixed, `0416881f`.** A future reader could resolve the relative `bg` through
- `resolveInRoots`, which binds it to `SONG_REPORTS`. `ThumbEntry` now declares `bg?` with the
- rule: relative to the song data dir, resolve with `dataFile()`, never `resolveInRoots`. This is
- a type and comment only; no behaviour changed.
-- **Left, on the coordinator's word:**
- - **L2.** Run from a cwd outside any checkout, umtool's `REPO_ROOT` falls back to the cwd's parent
- and reads a corpus that is not there. This is the plan's design, and every documented
- invocation runs inside the checkout. A walk from `import.meta.url` as a second try is the
- follow-up.
- - **L4.** `cues.mjs` (`build-video`, `resolve-windows`, `check-availability`) still ignores
- `TRANSCRIPTS_DIR`. The plan leaves `cues.mjs` alone, and this is not a regression.
- - **L5.** With no song data, `SONG_SCRATCH` widens to `~/.local/share/archilyzer` in the read and
- write roots. Nothing else lives there today, and it was noted only.
- - **L6.** Cosmetic: a stale "job temp dir" comment in `lib/paths.mjs`, ragged comment wraps, and
- `docs/folders.md`'s older roots list. Not worth a commit here.
-- **I2, for slice R.** `29dc507c`'s commit message and older blobs carry `/run/media/user`, which
- the built-in `${os.homedir()}` rule does not match. R's `source-scrub.txt` needs its own rule, or
- its denylist refuses the publish (it fails closed).
-- **After the fixes:** tsc is clean (41 s, all seven packages), and the grep gate is empty at the
- new tip. Per the coordinator, e2e was not re-run for a type comment and a changelog line.
-
-### Slice Q, found after rollout — the umtool build walked the corpus (2026-09-28)
-
-**What.** Slice Q's `umtool/lib/paths.mjs` set `CHANNELS_DIR` to
-`path.join(REPO_ROOT, "transcripts", "channels")`, with
-`REPO_ROOT = findRepoRoot(process.cwd())`.
-- **Turbopack evaluated that statically** as `[project]/transcripts/channels` and made it a
- directory asset reference. The walk's fallback, `path.resolve(start, "..")`, is the project
- root.
-- **In `<primary>`,** `pnpm --filter umtool exec next build` walked the real corpus (hundreds of GB,
- channel `data/` symlinked to another drive). It was OOM-killed twice, at about 3.7 GB RSS, so the
- live umtool on :3050 stayed down until this fix.
-- **Slice Q's gate built in a worktree,** which has no `transcripts/`, so the reference was empty
- and the build took 30 s. The hazard and the rule are in FACTS: "A path joined from
- `process.cwd()` is a directory of assets to Turbopack".
-
-**The repro.** Link the corpus into a worktree for the BUILD only, and cap memory:
-```
-ln -s <primary>/transcripts <worktree>/transcripts
-timeout -s KILL 240 systemd-run --user --scope -q -p MemoryMax=5G -p MemorySwapMax=0 pnpm --filter umtool exec next build
-rm <worktree>/transcripts
-```
-On `main` `10cefd15` it fails in 6.4 s (0.97 GB): `TurbopackInternalError: Failed to write app
-endpoint /page … [project]/umtool/lib/paths.mjs … <DirAssetReference as
-ModuleReference>::resolve_reference failed … Symlink [project]/transcripts/channels/<slug>/archive
-is invalid, it points out of the filesystem root`.
-
-**The fix** (branch `fix/umtool-build-trace` off `main` `10cefd15`). Every path or fs call on a
-value derived from `process.cwd()` or `import.meta.url`, in a umtool module the app imports, now
-opens with `/* turbopackIgnore: true */`. That is the per-expression opt-out Turbopack's own
-message documents. The calls are in:
-- `lib/paths.mjs` (`findRepoRoot`, `CHANNELS_DIR`);
-- `lib/paths.ts` (`SONG_CODE`, `stateFile`);
-- `lib/tools.mjs`, `lib/trim.ts`, `lib/report/driver.mjs`;
-- `report-to-video/brand.mjs` and `cues.mjs`.
-
-The values at run time are unchanged. From `umtool/`, `REPO_ROOT`, `CHANNELS_DIR` and `SONG_DATA`
-print the same as on `main`, and `CHANNELS_DIR` / `TRANSCRIPTS_DIR` / `SONG_DIR` still win.
-`os.homedir()` joins are left as they are. A build with `HOME` pointed at a synthetic home inside
-the project, holding out-of-root symlinks at every home-derived root, succeeded, so the tracer does
-not follow `os.homedir()`.
-
-| build (5 GB cap, `/usr/bin/time -v`) | result | wall | max RSS | `.next` |
-|---|---|---|---|---|
-| `main` `10cefd15`, corpus linked | **fails** (the error above) | 6.4 s | 0.97 GB | — |
-| fix, no corpus | ok | 42.2 s (a busy machine; 22.2 s on an earlier run) | 0.80 GB | 1,009 files, 25,417,403 B |
-| fix, corpus linked | ok | 24.2 s | 0.80 GB | 1,009 files, 25,417,285 B |
-
-- **The two outputs are the same file set,** differing only in the build-id directory.
-- **Nothing from the corpus is traced.** 0 `.nft.json` entries are under `transcripts/`. The 14
- files that contain the string `transcripts/channels` are all `.js.map` source maps of the code;
- none is a chunk or an asset.
-
-**The guard: `scripts/umtool-build-trace.test.mjs`** (in `test:scripts`, 3 tests). It is a static,
-per-module check of umtool's app, components, lib, `report-to-video/*.mjs` and `song/paths.mjs`. A
-path or fs call carrying a value derived in that file from `process.cwd()`,
-`import.meta.url|dirname|filename` or `__dirname` must open with the opt-out. It costs about 0.1 s.
-With `main`'s `lib/paths.mjs` swapped in, it fails and names the defect:
-`umtool/lib/paths.mjs:118 : path.join(REPO_ROOT, "transcripts", "channels")`.
-
-| sha | what |
-|---|---|
-| `8346f824` | `umtool:` cwd-derived paths opt out of Turbopack's asset tracing |
-| `55699a20` | `scripts:` the guard |
-| _this_ | `plans:` this note, FACTS, the implementer rules' umtool build gate; the `[Unreleased]` bullet |
-
-**Gates:**
-- tsc is clean (all seven packages).
-- `node --check` passes on the five changed `.mjs`.
-- `test:scripts` **188 + 1 skipped** (`main` 185 + 1, plus the guard's 3).
-- The capped builds are in the table above.
-- umtool e2e (`faces`, `deck`, `clip-bench`, with the corpus link removed): **67 passed, 8
- skipped, 0 failed** (1.9 min). The skips are the song-data specs, as in slice Q.
-
-**The other apps are safe by accident, not by rule.**
-- `common/lib/paths.ts`' `findMonorepoRoot()` falls back to `process.cwd()` (the app's own
- directory).
-- `homepage/app/lib/source.ts` joins `process.cwd()` + `public`.
-- Both build today, so there is no finding to fix, only a note in FACTS.
-
-**For the parent:** merge, then rebuild and restart :3050. That is the parent's step.
-
-### Slice R, as shipped — `archilyzer source publish` + `/source` (2026-09-28)
-
-Branch `r12/source-mirror` off `main` `e6c5d2e3` (slice Q merged), worktree
-`~/Projects/r12-source-mirror` (worktree #10: editor 4001, homepage e2e 4040), one Opus
-implementer. Plan: [`source-mirror.md`](source-mirror.md), "Slice R", R1–R7. Why: the operator
-asked for the repo on the project site, read-only, clonable from static files, with a gate that
-refuses to publish a denied literal. `main` did not move during the slice (`git merge main`:
-already up to date). Scratch files `r-m-*` in the job's `tmp`.
-
-**What shipped.**
-- **R1, `common/publish/source.ts`: `publishSource(opts)`** — 0 published / skipped / checked,
- 1 refused or cancelled; a `SourceRefusal` is logged as `[source] REFUSED: …`. The steps are the
- plan's 1–17:
- - `git rev-parse` of the git COMMON dir's `refs/heads/main`;
- - the two operator files, parsed; a missing one is a refusal naming it (`~/`-relative);
- - the skip;
- - `resolveFilterRepo()`: `git filter-repo`, else `pipx run --spec git-filter-repo==2.47.0`,
- else the install line;
- - `git clone --no-local --bare --single-branch --no-tags --branch main` into
- `mkdtemp(<ARCHILYZER_SOURCE_SCRATCH>/archilyzer-source-)`, origin removed;
- - filter-repo `--force --quiet --replace-refs delete-no-add --replace-text R --replace-message R`,
- then `filter-repo/` deleted;
- - `repack -a -d -q --max-pack-size=20m`, `prune-packed`, `pack-refs --all`, `update-server-info`.
- It refuses on loose objects, no `P` line, any ref but `refs/heads/main`, or a HEAD that is not
- main.
- - the object gate; the tree (`git archive` → `tar -x` → pages); the tarball (`--format=tar.gz
- -9 --prefix=archilyzer/`) and `snapshot.json` in the `Snapshot` shape;
- - the mirror staged from an allowlist; the manifest staged; the file gate; the limits;
- `--check` stops; the link-safe install (manifest removed first, written last); one summary line.
-
- Every child goes through `runChildIntoLog` with `AbortSignal.any([signal, timeout])`, in an
- environment with the `GIT_DIR`-family variables cleared. The one exception is the audit's
- binary `cat-file` stream (a `spawn`, with the signal). `clearPublishedSource` is what
- `--no-source` runs. `common/lib/sourceManifest.ts` is the leaf contract: `MIRROR_DIR`,
- `CLONE_URL`, `TREE_HREF`, `TARBALL_HREF`, `SourceManifest` and `parseSourceManifest`.
-- **R2, `sourceAudit.ts`.**
- - `parseDenylist` (`i:`, `#` comments, trimmed, deduped).
- - `scanBuffer`, and `redactHit`: ±24 bytes, every byte any hit covers masked, a half-shown
- occurrence included.
- - `maskLiterals` for every path or line quoted from the repo.
- - `auditObjects`: ONE `cat-file --batch-all-objects --unordered --batch` stream with a framing
- parser — blobs and commits/tags whole, trees by entry NAME (not their binary ids).
- - `auditFiles`: contents, paths, a `.gz` decompressed; a symlink is a refusal.
- - `runGitleaks`: cwd = scratch, so no checkout's ignore file applies. 0 is clean, 3 is parsed
- findings, anything else refuses; not on PATH is "skipped" with a WARNING.
- - `auditBare`: blob hits get their path in history, and gitleaks runs only when the literal
- audit is clean.
- - `formatAuditReport`: `#n (x…, len L)`, counts per literal and kind, the first 20 contexts,
- "… and N more", then the plan's closing line.
-- **R3, `sourceTree.ts`** (`hrefFor`, `escapeHtml`, `renderTreeIndex`, `writeTreeIndexes`, which
- refuses a tracked `index.html` or a symlink), and the `_headers` block — with the correction
- below.
-- **R4, the homepage.**
- - `app/lib/source.ts` `loadSourceManifest()` (also needs `info/refs` and the tarball).
- - Nav: Source after Docs.
- - `app/source/page.tsx`: the plan's copy verbatim; `source-clone`, `source-mirror-head`,
- `source-tree-link`, `source-tarball-link`, and `source-tarball-sha` for the spec; the empty
- state `source-empty`.
- - A shared `components/Fact.tsx`.
- - Downloads: one sentence linking "read-only git mirror", and the empty state names
- `archilyzer source publish`; every phrase `downloads.spec.ts` asserts is kept.
- - `marketing.spec.ts`' nav list gains Source.
-- **R5, the docs.** `create-archives.sh` is deleted. README and SETUP lead with the clone and keep
- the tarball as the no-git path. PUBLISH.md gains "The source mirror (homepage)". The homepage's
- *Install*, FAQ, *What is Archilyzer* and `content/README.md` stop saying "there is no public
- repository". `grep -rn 'create-archives' README.md SETUP.md homepage/` is empty.
-- **R6 and the rest.**
- - `getPaths()` gains `configDir`, `sourceScrubFile`, `sourceDenylistFile` and
- `sourceScratchDir`, from `ARCHILYZER_CONFIG_DIR`, `SOURCE_SCRUB_FILE`, `SOURCE_DENYLIST_FILE`
- and `ARCHILYZER_SOURCE_SCRATCH`, declared as `paths` in `envVars.ts`.
- - `HOMEPAGE_PUBLIC_DIR`'s `readBy` names `source.ts`, and `TRANSCRIPTS_DIR`'s doc says umtool
- reads `<it>/channels` too (review Q(c)). `ENVIRONMENT.md` is regenerated.
- - The CLI rows `build homepage [--no-source]`, `source publish [--force] [--check]
- [--keep-scratch]` and `source audit [<git dir>]`.
- - `buildHomepage`: compose, then the source step (a lazy import; `publishSource` and
- `clearSource` are seams), then `next build`.
- - doctor's "source publish" block. It is never a failure; it WARNs when the operator files exist
- but no filter-repo is installed, or a file is readable by others. It prints rule counts and
- modes, never contents.
-
-**Corrections to the plan** (each found by running it):
-- **`_headers`: later rules APPEND, they do not win** (`f218ed86`).
- - wrangler 4.88's `attachHeaders` (the Pages asset server's code, read in its `cli.js`) `set`s
- a header on the first matching rule and `append`s it on every later one. The plan's exact
- text served a directory page as `text/plain; charset=utf-8, text/html; charset=utf-8` and a
- font as `text/plain; charset=utf-8, font/ttf`.
- - Each override now starts with `! Content-Type`. A replica of wrangler's parse and attach
- (`$T/r-m-headers-sim.mjs`) gives single values for `/source/tree/`, `…/common/`, a `.ts`, the
- bracketed `.ttf` and `page.tsx`, the `.onnx` and `README.md`.
- - The preview deploy is still the live proof.
-- **The tsconfig must exclude `out` too** (`3fa5ff18`).
- - `next build` copies `public/` into `out/`. The SECOND build with a mirror failed its type check
- on `out/source/tree/common/jobs/registry.ts`, a second `declare global var __yttJobRegistry__`.
- - With `out` excluded, the homepage program is 871 files, none from the mirror; homepage tsc
- takes 11 s with a mirror in both dirs.
- - The homepage's `eslint.config.mjs` ignores `public/source/**` (it already ignored `out/**`).
- Lint itself was not run.
-- **The published manifest carries no `rulesHash`.**
- - `plans/` ships in the mirror, and so does the plan's description of the two files. What is
- left unknown is the hostname and the address, so a published hash of the rules would confirm
- a guess at them.
- - The skip key (`{sourceCommit, rulesHash}`) is `homepage/.source-publish.json`, beside
- `public/` and gitignored. A missing key rebuilds; the round trip asserts it is absent from the
- manifest.
-- **The mirror has a loose `refs/heads/main` beside `packed-refs`.** git treats a directory as a
- repository only with a `refs/` dir, so without it the `file://` clone and `source audit` of the
- published dir fail. An empty dir would not survive a deploy.
-- **filter-repo's `--replace-text` does not skip `#` lines** (it would replace a comment as a
- literal; `get_replace_text` in 2.47). The step writes `replace.txt` without comments or blank
- lines.
-- **The step adds three safety flags:** `--no-tags`, `--replace-refs delete-no-add` (2.47's
- default is `update-no-add`, stated for determinism), and a check that the mirror holds exactly
- `refs/heads/main`.
-- **`--no-source` removes the published source** (manifest first; a linked `downloads/` goes as a
- link, its target untouched). It does not leave the source there: a copy audited against older
- rules would ship ungated. That removal gives the empty state R7 expects.
-- **The header nav moves from `sm` to `md`:** five labels do not fit beside the wordmark at 640 px.
-- **The tree has 4 `.ttf`**, not 3 (IBM Plex Mono Bold, O5); `*.ttf` covers them.
-- **No `branch` option:** `SOURCE_BRANCH = "main"`, an operator decision. `now` is `() => Date`.
-- **The packs are 37.5 MB in two** (20,897,277 + 16,633,904 bytes), not the plan's 21.5 MB in one.
- The history grew by about 150 commits since the plan, and the 20 MB split costs deltas across
- the two packs. That is well inside the limits.
-
-**The operator's files, as created, refuse the publish** (an action for the rollout, not the
-slice):
-- **The run:** `pnpm archilyzer source publish --check` with `~/.config/archilyzer/*` as the
- parent created them, at `main` `e6c5d2e3`. It ended `AUDIT REFUSED: 8 hits in 21,441 objects
- (1,702 commits) against 6 denied literals`, with every hit `#1 (r…, len 5)` in a blob:
- - `plans/source-mirror.md`, two versions, 3 hits each: the plan's own grep gates (`git grep -c
- -i '<it>' …`, `git -C <clone> grep -c -i <it> …`) and the "a future transcript quote "<it>
- that"" risk line;
- - `plans/release-12.md`, two versions, 1 hit each: slice Q's grep-gate line.
-- **Why the scrub rules miss them.** They cover the backticked spelling and the `/run/media/` path
- (review I2: no hit came from there), not the bare, single-quoted or double-quoted name.
-- **The operator's step:** add a rule for the bare name (`<name>==>user` covers every spelling,
- the backticked one included) or one per spelling. Then `archilyzer source publish --check`
- (about 25 s) must end `check passed`.
-- **How R7 ran anyway,** with the operator files untouched and the gate not weakened:
- - `SOURCE_SCRUB_FILE` = a scratch file of ONE rule, `<name>==>user`, written with `$(id -un)`,
- with the REAL denylist. The check was clean: 4 literals, gitleaks clean.
- - `source audit` of both clones and of the published dir with the REAL files (6 literals) is
- clean, below.
-
-**Gates** (from the worktree root; logs `$T/r-m-*.log`). Every log of a run over the real files was
-first scanned by `$T/r-m-leakcheck.mts` (counts per literal label, any ASCII case) and read through
-`$T/r-m-maskview.mts`. The step's own lines carried 0 literals; the only hits were pnpm's and
-doctor's home-directory paths.
-- **tsc** was clean before every commit (`r-m-tsc-{0..3}.log`):
- - 215 s at the first run, 168 s, 59 s, and 73 s with a mirror in `public/` AND `out/`. Another
- session's tsc was running during the first and the last.
- - The homepage alone: 11 s, 871 files, none from the mirror.
-- **Unit:**
- - common **2,138/2,138** (2,114 + 24: sourceAudit 7, sourceTree 5, source 7, build +1, `_cli`
- +3, doctor +1). The two filter-repo tests RAN (`ok 1832` round trip, `ok 1833` planted-literal
- refusal); 0 skipped.
- - `test:scripts` **185 + 1 skipped**; editor unit **85/85**; mcp **269/269**; homepage unit
- **2/2**.
-- `pnpm archilyzer docs env --check` exits **0**. The editor's `next build` is **ok** (43 s); it
- bundles `buildHomepage`'s lazy import.
-- **`archilyzer build homepage`** (from `common/`, `SOURCE_SCRUB_FILE` as above):
- - **ok in 38 s**, against 19 s for `--no-source`. The source step took **19 s**: filter-repo
- 5.3 s, gitleaks 7.3 s, `[source] published main e6c5d2e322b3 as 78dc0126382b: 2459 files,
- 69.5 MB (mirror 2 packs, tree 412 dirs), tarball 6.9 MB sha256 c4ceb6d110ee`.
- - A rebuild with nothing changed logged `[source] up to date at e6c5d2e322b3; skipping`.
- - **Deterministic:** two runs gave the same `mirrorHead` and tarball sha; the real files' two
- runs gave `9b880270c49d` both times.
-- **What it published** (`homepage/out`):
- - **2,640 files, 78.1 MB** in all; `source/` 2,465 files, 65.8 MB;
- - the mirror: 9 files, 38.1 MB, 2 packs;
- - the tree: 2,035 files + 412 pages, 27.5 MB;
- - the tarball: 7,246,992 bytes.
- - **Against the limits:** 2,459 staged of the step's 15,000 (2,640 of Pages' 20,000); the
- largest file is 19.93 MiB, against 24 MiB (25 MiB).
-- **Two clones, both HEAD = `manifest.mirrorHead` `78dc0126382b…`:**
- - `git clone file://$WT/homepage/out/source/archilyzer.git`: 2 s.
- - `git clone http://127.0.0.1:8765/source/archilyzer.git` from `python3 -m http.server 8765
- --bind 127.0.0.1` in `homepage/out`: 1 s. The protocol was dumb: `info/refs?service=…` 200,
- then `HEAD`, `objects/info/packs`, both `.idx` and both `.pack`; the loose-object probes 404.
- - `:8765` was free before, the server was killed, and it was free after.
-- **The user name:** `git grep -c -i -F "$(id -un)" $(git rev-list --all) | wc -l` is **0** in both
- clones (1,702 revisions). It is 0 in the identities and messages and 0 in the paths too; the
- hostname is 0.
-- **`archilyzer source audit`** with the real files (6 literals) is **clean** on the file clone
- (13 s), the http clone (11 s) and the published dir (10 s): 21,441 objects, 1,702 commits,
- gitleaks "1530 commits scanned … no leaks found".
-- **The gate, exercised:** `SOURCE_DENYLIST_FILE` = a scratch file of `Co-Authored-By`, then
- `source publish --check`:
- - exit **1** in 14 s, `AUDIT REFUSED: 1476 hits … #1 (C…, len 14): 8 in blobs, 1468 in
- commits`, 20 context lines and "… and 1456 more";
- - the log holds the literal **0** times;
- - `public/source/manifest.json`'s mtime and size are unchanged (`1790616152 1057`).
-- **`build homepage --no-source`:** `out/source/index.html` holds `data-testid="source-empty"`
- and "No source published in this build."; `/downloads/` says "no source snapshot attached".
-- **No filter-repo:** with PATH = a scratch dir of two symlinks (`git`, `node`; nothing
- uninstalled), `git filter-repo` is "not a git command", and `source publish --check` exits 1 with
- `REFUSED: git-filter-repo is not installed and pipx is not on PATH — install it once: \`pipx
- install git-filter-repo\` …`.
-- **The resolved filter-repo** is `git filter-repo` (`~/.local/bin/git-filter-repo`, pipx-installed
- 2.47.0), whose `--version` prints `a40bce548d2c`; git is 2.55.0. The `pipx run` fallback was not
- run (it needs the network).
-- **`archilyzer doctor`** prints the block:
- ```
- source publish
- ok filter-repo git filter-repo a40bce548d2c
- ok gitleaks gitleaks version is set by build process
- ok scrub rules ~/.config/archilyzer/source-scrub.txt (2 rules, mode 600)
- ok denylist ~/.config/archilyzer/source-denylist.txt (3 literals, mode 600)
- -- published main e6c5d2e322b3 as 78dc0126382b, 2026-09-28T17:22:29.301Z (2458 files)
- ```
- The real output prints the absolute paths. `2458` is the manifest's `files`, which does not
- count the manifest itself.
-- **homepage e2e** (`node scripts/worktree.mjs run -- pnpm --filter homepage run e2e`; the queue
- was free):
- - **36 passed, 0 skipped, 0 failed, 1.1 min**, WITH the manifest present:
- `loadSourceManifest()` from `homepage/` gave mirror head `78dc0126382b`, so the published
- branch of every `source.spec` test ran.
- - The empty state too: with `public/source` and `public/downloads` moved aside and restored
- after, `source.spec` + `downloads.spec` + `marketing.spec` gave **16 passed** (30 s).
- - `downloads.spec.ts` is unchanged.
-- **Numbers tool:** none.
-
-**They bite:**
-- The planted-literal test fails if the object walk misses the blob.
-- The redaction test pins a half-shown second occurrence.
-- `build.test.ts`' fake refusal proves `next build` never runs.
-- The restricted-PATH run proves the install line.
-- The `Co-Authored-By` run proves the gate refuses a literal the scrub does not touch, in commits
- AND blobs.
-
-| sha | what |
-|---|---|
-| `25f5e241` | `homepage:` `/homepage/public/source` gitignored (the Tailwind note), tsconfig excludes `public` — first, before any mirror |
-| `7fdbe2dc` | `common:` `sourceAudit.ts`, `sourceTree.ts`, `sourceManifest.ts` + tests |
-| `fc31aab5` | `common:` `publishSource` (`source.ts`) + tests; `getPaths()` / `envVars.ts` / `ENVIRONMENT.md` |
-| `2f08cb47` | `common:` `buildHomepage` runs the step; the CLI rows; doctor's block + tests |
-| `1a11a2bb` | `homepage:` `/source/`, nav, `Fact`, Downloads, `_headers`, docs content, `source.spec.ts`, marketing nav |
-| `2cd189f3` | `docs:` README, SETUP, PUBLISH "The source mirror (homepage)"; `create-archives.sh` deleted |
-| `c448b392` | `changelog:` the editor and homepage `[Unreleased]` bullets |
-| `f218ed86` | `homepage:` `_headers` overrides detach `Content-Type` first (correction) |
-| `3fa5ff18` | `homepage:` tsconfig excludes `out`; eslint ignores `public/source/**` (correction) |
-| _this_ | `plans:` this record |
-
-**Found and left** (not this slice's files):
-- **`.dockerignore:20-22`** still names `create-archives.sh`, and it does not exclude
- `homepage/public/source/`. A `docker build` from a checkout that has published would send about
- 66 MB of mirror and tree in the build context.
-- **`common/lib/project.ts:37-38`** (`PROJECT_DOWNLOADS_URL`'s comment) says "there is no public git repository".
-- **The editor's /sites Homepage section** (`HomepageBuildButtons.tsx:170`) does not say that the
- build publishes the source, or that it can refuse.
-- **`export/CHANGELOG.md`'s released entry** names `create-archives.sh`. It is history, and is left.
-- **The label `#n (x…, len L)`** shows a literal's first character and length in the logs. This is
- the plan's format; nothing of it is published.
-- **gitleaks** scans 1,530 of 1,702 commits: its `git log -p` skips merges. The literal audit reads
- every object.
-
-**Changelog.**
-- **`editor/CHANGELOG.md`:** one `[Unreleased]` bullet. The build step and the gate; the operator
- files, and that the build refuses without them; `pipx install git-filter-repo`; the skip, the
- CLI rows and doctor; `create-archives.sh` gone.
-- **`homepage/CHANGELOG.md`:** one `[Unreleased]` bullet. `/source/` and its nav entry, the empty
- state, the tarball regenerated per build, the docs, the nav at `md`, and `_headers`.
-
-**For the parent and the operator:**
-1. Add the scrub rule above, then run `archilyzer source publish --check`.
-2. The editor's /sites homepage job finds `git filter-repo` only if the editor's PATH includes
- `~/.local/bin`. Otherwise it falls back to `pipx run`, which needs the network on first use.
-3. The worktree's `homepage/public/source`, `homepage/out` and `homepage/.source-publish.json` were
- made with the scratch rule. They are disposable, and nothing here deployed them.
-
-**Review** (verdict **SHIP AFTER FIXES**; a read-only Opus review of `e6c5d2e3..6ddfd498`,
-`$T/r-review.md`). The parent then added the missing scrub rule to the operator file:
-`source publish --check` with the real files exits 0. The coordinator ruled that M1 and the
-listed Lows be fixed on the branch. `main` had moved by one `plans:` commit (the release 11
-rollout record), merged at `439eb106` with no conflict.
-- **M1 — fixed** (`7d64054c`, and `78b32636` below). **A refusal left the previous publish in
- place**, in `homepage/public` and in the last build's `homepage/out`, for a deploy-only or a
- raw `next build` to ship under rules it was never audited against. Now it is withdrawn at three
- points:
- 1. **`publishSource`:** once the rules are loaded, any outcome but success — an audit hit, a
- limit, a missing tool, a cancel, a crash — runs `removePublishedSource`. That removes the
- manifest first, then the mirror, the tree, the tarball, `snapshot.json` and the skip key.
- `--check` still writes nothing, this included: it is a dry run, and the deploy check below
- covers what it cannot.
- 2. **`buildHomepage`:** a non-zero source result also removes `out/source` and the two download
- files from `homepage/out`.
- 3. **`deployHomepage` asks `publishedSourceProblem` before every deploy**, preview included.
- - An `out/` with source artefacts ships only when the skip key says the publish was made
- under TODAY's rules and step (`rulesHash`), of TODAY's `main`, and is the publish in `out/`:
- the same mirror head, and a tarball whose sha256 matches.
- - It keys on the artefacts and the `/source` page, not on `out/source` existing (`78b32636`).
- A `--no-source` build still renders the page into `out/source/index.html`, and the first
- version refused exactly that build; I found it by running one.
- - The page with no artefacts beside it is a `--no-source` build, and deploys as before.
- - No page at all is a refused build (or one from before the page), and it refuses.
- - **Tests:** the round trip denies a literal the mirror holds, and the publish then exits 1 with
- `public/source`, the tarball, `snapshot.json` and the key gone. The skip test covers a changed
- rule. `build.test` covers the `out/` removal and the deploy refusals. `publishedSourceProblem`
- is covered on a real publish: ok, tampered tarball, newer `main`, other rules, no record.
-- **Q3/L5 — fixed** (`6936f6e2`). A label says where the literal was written: `denylist line 3
- (len 5)`, `scrub line 2 lhs (len 11)`, `built-in home rule (len 11)`. No character of the
- literal appears.
-- **L4 — fixed** (`6936f6e2`).
- - A hit is listed by kind, object id (with the blob's path in history), byte offset, and for a
- commit or tag the header field (`author`, `committer`, `tagger`, …) or `message`; a tree hit
- by entry number. `redactHit` is deleted: no byte of an object is printed.
- - The test asserts the report carries none of the planted text's neighbours (`/srv/`,
- `example.invalid`, `Planted <`, the message).
- - PUBLISH.md and the editor changelog show the new format.
-- **L1 — fixed** (`6936f6e2`): a tracked `404.html` anywhere in the tree is refused, with a test.
-- **L2 — fixed** (`7d64054c`).
- - A UTF-8 BOM and CRLF are dropped from both operator files (`operatorLines`), and a trailing
- `/` from the home dir.
- - An empty left side (`==>x`, `literal:==>x`, `regex:==>x`, `glob:`) is a refusal naming its
- line.
- - The reviewer's reproduction is a test: a BOM + CRLF scrub file still scrubs, and still
- denies its left side. The round trip now runs with a BOM + CRLF scrub file and denylist.
-- **L3 — fixed** (`7d64054c`): the published manifest (and `SourceManifest`) no longer carries
- `audit.literals`. The log still gives the count.
-- **L6 — left, as ruled:** compressed content is opaque to the byte search. The reviewer
- decompressed every compressed or binary blob in the history (a zip, PNGs, icons) and found 0
- hits. PUBLISH.md records it as a known limit, and says a binary is audited, never scrubbed.
-- **L7 — fixed** (`d3c680ea`). `.dockerignore` excludes `homepage/public/source/` and
- `homepage/.source-publish.json`, and no longer names `create-archives.sh`.
-- **L8 — fixed** (`7d64054c`), for a checkout with no git repository.
- - `buildHomepage` passes `noRepository: "empty"`. The step logs `[source] no git repository
- here; nothing to mirror — the /source page will show its empty state`, removes an old publish,
- and returns 0.
- - `archilyzer source publish` exits 1 with the same sentence, and no raw git error.
- - A test runs both over a temp dir with no operator files.
-- **L9 — fixed** (`7d64054c`, `91728a21`).
- - The round trip reads EVERY object in the published packs from a plain file copy (`cat-file
- --batch-all-objects`), and asserts `objects/pack` holds only `pack-*.{pack,idx}`.
- - `homepage/app/lib/headers.test.ts` pins `_headers` with a replica of wrangler's parse and
- attach:
- - each `/source/tree` override says `! Content-Type` first;
- - each path gets ONE value;
- - the file stays inside wrangler's limits.
- - `E2E_EXPECT_SOURCE=1` makes the empty state FAIL `source.spec.ts`' three data tests. It is
- declared in the homepage playwright config and the env registry. It bites: in the empty state
- with the flag set, **3 failed, 2 passed**.
-- **L10 — fixed** (`7d64054c`, `91728a21`). `parseSourceManifest` checks every number the page
- reads, and `loadSourceManifest` takes the public dir as a seam. Unit tests cover common (2) and
- homepage (2): a malformed, wrong-version or orphaned manifest is null, never a throw.
-- **L11 — fixed** (`7d64054c`).
- - `SOURCE_STEP_VERSION` (now 2, with a comment to bump it whenever the scrub or the audit
- changes) is in the rules hash.
- - The skip key also holds the filter-repo label and version, and the mirror head.
- - A test shows another filter-repo version does not skip.
-- **L12 — fixed** (`7d64054c`).
- - A scratch root that lands (through symlinks) inside the checkout or the public dir is refused.
- - `--keep-scratch` deletes `replace.txt` (written mode 600) and says so.
- - Tests cover both.
-- **L13 — fixed** (`d3c680ea`).
- - The `project.ts` comment names the mirror.
- - PUBLISH.md's tsconfig line says `public` and `out`. The "new spelling" line now says the
- implied denial is the exact bytes, and a new spelling is caught only by the denylist.
- - The editor's /sites Homepage section gains one `<p>`: Build also publishes the source and can
- refuse; a refusal removes it from `homepage/out` too; Deploy refuses an unaudited source.
- I did not run the editor e2e for it:
- - `sites-homepage.spec.ts`' assertions on that group are `toContainText` substrings of the
- existing paragraph, role-and-name lookups for buttons, and `getByText(/^Queued/)` and
- `"Cancelled"` (exact). A new sibling paragraph cannot break any of them.
- - Its build job is held on the queue and cancelled, so the source step never runs there.
-- **The runbook point (PUBLISH.md, `d3c680ea`):**
- - a Pages preview is public, and every deployment stays reachable at its hash URL until it is
- deleted;
- - the private literals go in the denylist before ANY deploy;
- - if something private ships, delete that deployment, because a newer deploy does not remove it;
- - the editor's process needs `~/.local/bin` on its PATH.
-- **The five questions, as ruled:**
- 1. The rules hash in the gitignored `.source-publish.json` is **acceptable**. The step version
- has been added (L11).
- 2. `--no-source` removing the previous publish is **right**.
- 3. The first character is **dropped** (above).
- 4. The loose `refs/heads/main` is **acceptable**.
- 5. `.dockerignore` is **fixed here** (L7).
-
-| sha | what |
-|---|---|
-| `439eb106` | merge `main` (the release 11 rollout record) |
-| `6936f6e2` | `common:` labels by provenance, no object bytes in the report, `404.html` refused (Q3, L4, L1) |
-| `7d64054c` | `common:` a refusal withdraws; the build's `out/` copy; the deploy check; L2, L3, L8, L10, L11, L12 |
-| `91728a21` | `homepage:` `E2E_EXPECT_SOURCE`; the loader and `_headers` unit tests (L9, L10) |
-| `d3c680ea` | `docs:` PUBLISH.md (withdrawal, previews, no-repo, report format, L6); `.dockerignore`; `project.ts`; the /sites copy; the changelog bullet |
-| `78b32636` | `common:` the deploy check keys on the artefacts and the `/source` page (found by running `--no-source` against it) |
-| _this_ | `plans:` this review record and `source-mirror.md`'s "As shipped" note for R |
-
-**Gates after the fixes** (logs `$T/r-m-*.log`):
-- **tsc:** clean before every commit (36–55 s).
-- **Unit:**
- - common **2,146/2,146** (+8: sourceAudit +2, source +3, build +1, sourceManifest +2). The
- filter-repo tests ran, 0 skipped.
- - homepage unit **7/7** (+5); editor unit **85/85**; `test:scripts` **185 + 1 skip**.
- - `docs env --check` exits **0**.
-- **`source publish --check` with the REAL files** exits **0** in 19 s:
- - `audit clean: 21,447 objects (1,703 commits), 2,459 staged files against 6 denied literals;
- gitleaks clean`;
- - it would publish main `e56101fdee5d` as `20c367613f75`;
- - a count-only grep of the log for `$(id -un)` gives **0**.
-- **A real `build homepage` in the worktree, with the real files:**
- - **ok in 38 s** (the source step 19 s); `homepage/out` holds **2,640 files, 77.9 MB**;
- - the mirror is 37.9 MB in 2 packs, the largest 20,966,235 bytes (19.99 MiB, against the 24 MiB
- limit); the tree is 2,035 files and 412 dirs; the tarball 7,249,703 bytes.
-- **Dumb-HTTP clone** from `python3 -m http.server 8765 --bind 127.0.0.1` in `homepage/out`:
- - HEAD `20c367613f75…` = `manifest.mirrorHead`;
- - the user-name grep over its 1,703 revisions gives **0**;
- - `:8765` was free before, the server was killed, and it was free after.
-- **The refusal, exercised through `build homepage`** (`SOURCE_DENYLIST_FILE` = a scratch file of
- `Co-Authored-By`):
- - exit **1** in 13 s: `1477 hits … denylist line 1 (len 14): 8 in blobs, 1469 in commits`, with
- each listed as `commit <id> (message, byte N)`;
- - the log holds the literal **0** times, and the source step's lines hold 0 of the 6 real
- literals;
- - afterwards `public/source`, the public tarball, the skip key, `out/source` and the out
- tarball are **all gone**, and `out/downloads/index.html` stays;
- - a good rebuild restored them all, and the deploy check then says "ok".
- - Before the refusal, the deploy check over the real `out/` said ok under the real rules, and
- "audited under other rules" with the scratch denylist.
-- **`build homepage --no-source`:** `out/source` holds only the page. The tarball is gone, and the
- deploy check says ok.
-- **homepage e2e with `E2E_EXPECT_SOURCE=1`:** **36 passed**, 0 skipped, 51 s, with the manifest
- present. The bite run is above: 3 failed and 2 passed in the empty state.
-
-**Re-review** (verdict **SHIP**; `$T/r-review.md`, "Re-review"). M1 is confirmed closed, and every
-deploy path goes through the check. The coordinator ruled that `--check` not withdrawing is
-accepted as built, and that the four new Lows be closed before the merge:
-- **R2-L1 — fixed** (`831763da`). A refusal that names a tree path (the symlink, `index.html` and
- `404.html` refusals) printed a literal that spans path components (`a/b`) in full. The object
- walk reads entry names one at a time, so it cannot see such a literal.
- - `[source] REFUSED: …` now goes through `maskLiterals` with the loaded literals, in both
- `publishSource` and `auditSource`.
- - The kept-scratch path, the report's scrub-file path and the audit's "auditing <dir>" line are
- masked too.
- - Child stderr was already masked wherever it is quoted or echoed: git's refusal tails,
- filter-repo's echo, gitleaks' lines. `subject` comes from the scrubbed mirror.
- - The test plants `plant/secret` as a denied literal above a tracked symlink, then above a
- tracked `index.html`. Both refusals print `[REDACTED]/…`.
-- **R2-L2 — fixed** (`831763da`). The state carries `contentDigest`, from `sourceDigest()`:
- - it covers every published file: `source/archilyzer.git/**`, `source/tree/**`,
- `source/manifest.json`, the tarball and `snapshot.json`;
- - it hashes the sorted path, the size and a streamed sha256 of each; a symlink or a missing
- piece only makes it differ;
- - the skip recomputes it over `public/`, and the deploy check over `out/`.
-
- A swapped tree file and a flipped pack byte are refused. On the real `out/` (2,640 files) the
- whole check takes **0.58–0.76 s**, of which the digest is **0.48–0.54 s** (three runs).
-- **R2-L3 — fixed** (`831763da`).
- - **The skip:** each part of the key (filter-repo, gitleaks, content digest, rules) and an edited
- `public/` file is changed alone, through a publish that REACHES the skip. The filter-repo is
- `false`, so a skip returns 0 and a miss returns 1.
- - **The step version:** `rulesHashOf` is shown to move with it, and `loadSourceRules` uses
- `SOURCE_STEP_VERSION`.
- - **The deploy check's mirror-head and gitleaks comparisons** each refuse with their own
- sentence.
- - **Proved by reverting each fix** (`$T/r-m-mutate.py` against `source.ts`, restored after):
- every revert fails its test. The eight reverts are:
- - the deploy check's mirror-head comparison;
- - the step version in the hash;
- - filter-repo, gitleaks and the digest in the skip key (three reverts);
- - gitleaks and the digest in the deploy check (two reverts);
- - the refusal masking.
-- **R2-L4 — fixed** (`831763da`).
- - The state carries `gitleaksIdentity()`: "skipped", "absent", or the version line plus the
- binary's sha256. The sha is there because this machine's gitleaks prints "version is set by
- build process" for every release.
- - The skip and the deploy check compare it.
- - `SOURCE_STEP_VERSION` is 3.
-- **The rollout note** (PUBLISH.md, `7940cb0c`, and here): **after the merge, rebuild and restart
- the live editor (:3001) before any /sites Homepage job.** It runs its built bundle, so until then
- its Build homepage job has no source step and its Deploy homepage job no source check.
-- **The reviewer's "minor" is left:** a real checkout that unexpectedly reads as "not a git
- repository" (a worktree whose primary moved) builds with the empty state, withdrawing the
- source. It is safe for privacy, and it is logged.
-
-| sha | what |
-|---|---|
-| `831763da` | `common:` refusals masked; `contentDigest` and `gitleaksIdentity` in the key; step version 3; the key's tests bite (R2-L1…L4) |
-| `7940cb0c` | `docs:` PUBLISH.md — the deploy key, masking, and rebuilding the editor after the merge |
-| _this_ | `plans:` this re-review record |
-
-**Gates after the re-review fixes:**
-- **tsc:** clean, 35 s.
-- **Unit:** common **2,149/2,149** (+3); the three filter-repo tests ran, 0 skipped. Homepage unit
- **7/7**. `docs env --check` exits 0.
-- **`source publish --check` with the real files** exits **0** (19 s, would publish mirror head
- `20c367613f75`). The count-only user-name grep of its log gives **0**.
-- **A real `build homepage`** is ok in 38 s (18 s for the source step). The source step's lines
- hold 0 user-name occurrences.
-- **The deploy check, called read-only** on that `out/`, says **ok (would deploy)**.
-- **A rebuild with nothing changed** logs `up to date … skipping` (20 s), and the check still says
- ok.
-- Nothing was deployed. `main` had not moved.
-
-## Rollout
-
-**Merged** (by the parent, in the primary, `git merge --no-ff` on a clean tree):
-- **Slice Q** merged as `4855f70b`, then the changelog fix `e6c5d2e3`. The 0.10.0 cut landed between
- Q's branch point and its merge. A clean textual merge filed Q's bullet inside the released
- `[0.10.0]` section, and `e6c5d2e3` moved it back under `[Unreleased]`.
-- **Slice R** merged as `ffdeb2cd`. The tree is identical to R's tip `484952ed`.
-- **The parent then prepared the operator's side:**
- - it created `~/.config/archilyzer/` (mode 700) with the two files (mode 600): the scrub file
- holds **3 rules**, the denylist **3 literals** — the Unix user name, the host name and one email
- address. The contents are never printed;
- - it installed `git-filter-repo` 2.47.0 with pipx (`~/.local/bin`);
- - it ran `pnpm archilyzer source publish --check`: **exit 0**, it would publish main
- `e56101fdee5d` as `20c367613f75`, with 2,459 files, 69.3 MB, 2 packs, 412 tree dirs and a
- 6.9 MB tarball.
- - The runbook's `r12-check.sh`, run in the primary while this record was written with `main` at
- `ffdeb2cd`, also exits **0**. It would publish `ffdeb2cd770e` as `8188e02a7d04`, with 2,473
- files, 69.8 MB, 2 packs, 413 tree dirs and a 7.0 MB tarball; its log holds 0 user-name and 0
- host-name occurrences.
-- **Nothing is rolled out.** Nothing was deployed. The live :3001 editor runs 0.10.0 (`BUILD_ID`
- `vWCJb87ktCy5akih_pM9X`, built on `e6c5d2e3`): it has no source step, no withdrawal and no deploy
- check. The primary's `homepage/out` predates release 12 (it has no `/source` page), so the deploy
- check refuses it until it is rebuilt.
-- **A side effect of the scrub, cosmetic and in the mirror only:** the bare user name is scrubbed to
- `user`. The `plans/` text in the mirror (the grep gates, one risk sentence) therefore reads
- differently from the private repository.
-
-**What is OWED, in order.** The operator's runbook is `~/reports/release-12/RUNBOOK.html`, rendered
-by `~/reports/release-12/make-runbook.py`. Its scripts are in `~/reports/release-12/scripts/` and
-log to `~/reports/release-12/tmp/`. Every script refuses unless the primary's `HEAD` contains
-`ffdeb2cd`.
-
-**Before ANY deploy, a preview included, the denylist must hold everything private.** A Pages
-preview is public, and every deployment stays reachable at its own `<hash>.archilyzer.pages.dev`
-until it is deleted.
-
-0. **The operator completes the denylist**, then runs the check. Add your real name, other handles
- and anything else that must never appear to `~/.config/archilyzer/source-denylist.txt`: one per
- line, `i:` for any case. Then:
- ```
- cd ~/Projects/yt-dlp-transcript-browser && pnpm archilyzer source publish --check
- ```
- (or `sh ~/reports/release-12/scripts/r12-check.sh`, which also counts user-name occurrences in its
- log: expect 0).
- - **Expect:** `[source] audit clean: …` and `[source] check passed — would publish main <12 hex>
- as <12 hex>: 2459 files …; nothing written`.
- - **If it refuses:** the report names the source only by position (`denylist line N (len L)`) and
- each hit only by object, field and byte offset. Add a scrub rule to
- `~/.config/archilyzer/source-scrub.txt` (`<text>==>user`), or drop the file from history. Then
- re-run.
-1. **The song link, before any umtool restart** (slice Q's operator step, with the review's I1
- correction):
- ```
- mkdir -p ~/.local/share/archilyzer && ln -s ~/.claude/jobs/efbe67a7/tmp/song ~/.local/share/archilyzer/song
- ```
- - The target holds only umtool's rebuildable `.cache/umtool`. The song project's bulk data is in
- `~/reports/quartering-uh-song/data`; pointing the link there instead is a separate choice.
- - `~/.local/share/archilyzer` did not exist on 2026-09-28. If a restarted :3050 created
- `…/song/.cache` as a real directory first, remove that directory before linking, or the link
- lands inside it.
-2. **Rebuild and restart the live editor, with `~/.local/bin` on its PATH.** The precedent is
- release 11's `r11-build.sh` + `r11-restart.sh` in `~/reports/overnight-2026-09-28/scripts/`.
- Release 12's copies are `r12-build.sh` and `r12-restart.sh`:
- - `r12-build.sh` builds into the live `.next`. Run the restart right after it.
- - `r12-restart.sh` refuses while `BUILD_ID` is still `vWCJb87ktCy5akih_pM9X`. It starts the
- editor with `PATH=$HOME/.local/bin:$PATH` and checks that the new server's environment has it.
- Without it, `/sites` Build homepage falls back to `pipx run`, which needs the network.
- - Run the md5 sweep around the restart, and the smoke after it. `r12-md5.sh` and `r12-smoke.sh`
- wrap `plans/tools/rollout/md5.sh` and `smoke.sh` with `CLAUDE_JOB_DIR=~/reports/release-12
- REL=r12`:
- ```
- sh ~/reports/release-12/scripts/r12-md5.sh before
- sh ~/reports/release-12/scripts/r12-build.sh
- sh ~/reports/release-12/scripts/r12-md5.sh pre-restart
- sh ~/reports/release-12/scripts/r12-restart.sh
- sh ~/reports/release-12/scripts/r12-md5.sh after-boot
- sh ~/reports/release-12/scripts/r12-smoke.sh
- cd ~/Projects/yt-dlp-transcript-browser && pnpm archilyzer doctor
- ```
- - **Expect:** `BUILD_OK`, then `RESTART_DONE editor / 200`, `/sites` carries release 12's
- sentence ("also publishes the source mirror") and the editor's PATH has `.local/bin`. `r12-md5.sh after-boot` ends `MD5_SAME`, and
- the smoke ends `SMOKE_FAIL=0`. A `PAIR_DIFF` on a pair that moves live (auto-queue status) is
- drift, as it was at release 11.
- - **Doctor** has a **source publish** block:
- - `filter-repo git filter-repo a40bce548d2c`;
- - `gitleaks` ok;
- - `scrub rules … (3 rules, mode 600)` and `denylist … (N literals, mode 600)`;
- - `published` says nothing is published in the primary yet.
-3. **A FRESH homepage build in the primary.** The deploy check refuses any `out/` built before
- release 12, because it has no `/source` page.
- ```
- sh ~/reports/release-12/scripts/r12-home-build.sh
- ```
- - It runs `pnpm archilyzer build homepage`, then checks
- `homepage/out/source/archilyzer.git/info/refs`, the file count and the deploy check, read-only.
- - **Expect:** `[source] published main … as …: 2459 files` (about 19 s for the step), `out: ~2,640
- files`, `info/refs: <40 hex>\trefs/heads/main`, and `deploy check: ok (would deploy)`.
- - **If the build refuses:** it has already WITHDRAWN the source from `public/` and `out/`. Fix the
- rule (step 0) and rebuild.
-4. **The preview** (`source.archilyzer.pages.dev`; public):
- ```
- sh ~/reports/release-12/scripts/r12-preview.sh
- sh ~/reports/release-12/scripts/r12-live-check.sh https://source.archilyzer.pages.dev
- ```
- - The first script runs `pnpm archilyzer deploy homepage --preview source`, which asks the deploy
- check first. Its log ends `[preview] https://source.archilyzer.pages.dev (this deployment:
- https://<hash>.archilyzer.pages.dev)`.
- - The live check is `source-mirror.md` Rollout step 2, as commands. Each line prints OK or FAIL:
- - `git clone https://source.archilyzer.pages.dev/source/archilyzer.git` works;
- - the clone's HEAD = `manifest.json`'s `mirrorHead`;
- - `…/source/tree/common/lib/paths.ts` is `content-type: text/plain; charset=utf-8`, ONE value,
- with `x-content-type-options: nosniff`;
- - `…/source/tree/common/` is `text/html; charset=utf-8`, ONE value. The appended form
- `text/plain…, text/html…` is the bug `f218ed86` fixed;
- - `…/source/tree/umtool/report-to-video/fonts/Archivo%5Bwdth%2Cwght%5D.ttf` is 200 `font/ttf`;
- - `…/source/tree/homepage/app/docs/%5Bslug%5D/page.tsx` is 200 `text/plain; charset=utf-8`;
- - the tarball's sha256 = `snapshot.json` = `manifest.json` = the one on `/source/`;
- - `pnpm archilyzer source audit <clone>/.git` is clean;
- - user-name and host-name counts in the clone's history are 0.
-5. **Production:**
- ```
- sh ~/reports/release-12/scripts/r12-prod.sh
- sh ~/reports/release-12/scripts/r12-live-check.sh https://archilyzer.pages.dev
- ```
- - The first script runs `pnpm archilyzer deploy homepage`: branch `main`, the log ends
- `[deployed] https://<hash>.archilyzer.pages.dev`.
- - Or use the editor's path, which also proves the step inside its job: `pnpm ops build-homepage
- --json '{"deploy":true}' --wait` with `WORKER_TOKEN` from `editor/.env`.
- - The same checks must pass on `archilyzer.pages.dev`.
-6. **If the edge refuses the dumb clone** (`source-mirror.md` Rollout step 4): the tree and the
- tarball still stand. The mirror would need another host (R2 behind a custom domain, out of scope).
- Record it, do not improvise.
-7. **If something private ever ships:**
- - DELETE THAT DEPLOYMENT in the Cloudflare dashboard (Workers & Pages → `archilyzer` →
- Deployments). A newer deploy does not remove it; for a preview, delete every deployment on
- that branch.
- - Then add the literal (and a scrub rule) and run `pnpm archilyzer build homepage`, which refuses
- and withdraws. Rebuild clean, and deploy again.
-8. **Housekeeping:**
- - `pnpm archilyzer release show` has 2 editor bullets pending; export has none, so `all` would
- refuse. When the operator chooses: `pnpm archilyzer release cut editor next --commit` (0.10.1)
- or `next-minor` (0.11.0).
- - Remove the worktrees when done: `pnpm wt rm r12-paths-fix` and `pnpm wt rm r12-source-mirror`,
- from the primary. Removing them re-sorts the index-based port blocks, so do it only when no
- dev server or e2e runs in any worktree; the parallel session's `r13-*` worktrees are active.
- The seven `r11-*` wait on these.
- - Optional: `git branch -d r12/paths-fix r12/source-mirror`.
-
diff --git a/plans/release-13.md b/plans/release-13.md
@@ -8,8 +8,8 @@ left by release 11, the `Dockerfile.build` image refreshed and proved, and one-c
`plans/tools/implementer-rules.md`, with the commit trailer this release's prompts give.
**Why 13, not 12:** a parallel session owns **release 12** — the source mirror
-(`plans/release-12.md` on `r12/paths-fix`; slices Q then R; plan
-[`source-mirror.md`](source-mirror.md)). The two releases share `editor/CHANGELOG.md`'s
+(`plans/archive/releases.md` (entry `release-12.md`) on `r12/paths-fix`; slices Q then R; plan
+[`source-mirror.md`](archive/sites-and-publishing.md)). The two releases share `editor/CHANGELOG.md`'s
`[Unreleased]` and a few files (`common/bin/doctor.ts`, `common/lib/envVars.ts`,
`common/lib/paths.ts`, umtool's path defaults, the docs); whichever merges second resolves the
join, and a code conflict goes back to its slice.
@@ -1100,7 +1100,7 @@ in the homepage's docs content or in scripts; what it found and left is under "F
- **Comments that still describe the long form**, all true (the two forms run the same thing):
`common/bin/archilyzer.ts:249` (the `mcp` row's usage), `common/bin/mcp.ts:2`, and
`mcp/bench/{bench,smoke}.ts`, which say the bench spawns "the command line the client is
- registered with". Records (`plans/mcp-fetch-clip.md:216`, `release-1x.md`) keep what was run.
+ registered with". Records (`plans/archive/acquisition-and-pipeline.md` entry `mcp-fetch-clip.md`, line 216 of the archived text; `release-1x.md`) keep what was run.
- **From the seventh series on,** ChartView's colours are the golden-angle hues the hub chart
already uses, not a per-base validated palette (before: a repeat of 1–5).
- **`homepageChart.ts`' header** names the hub chart and the site cards as `seriesColor`'s users;
diff --git a/plans/release-14.md b/plans/release-14.md
@@ -1,7 +1,7 @@
# Release 14 — the social icons within reach, and a clear screen until the first Search
`main` at `ac438bbc` (release 12 merged and not rolled out; release 13 is a parallel session's).
-Plan: [`export-header-first-search.md`](export-header-first-search.md), written 2026-09-28, with
+Plan: [`export-header-first-search.md`](archive/sites-and-publishing.md), written 2026-09-28, with
slice HP added to it on the operator's ruling of the same day. Rules:
`plans/tools/implementer-rules.md`, with the commit trailer this release's prompts give.
@@ -21,7 +21,7 @@ slice HP added to it on the operator's ruling of the same day. Rules:
| HP | `homepage/social-visible` | The homepage's social row and one theme toggle in the header at every width, the wordmark's text dropped first on a very small screen and the row scrolling only as the last resort, one shared `SocialLinks` component, larger keys with a focus ring; Changelog in the footer only; the instance cards' names as the site's wordmark; the social icon checked by an allowlist on save and at render; a sized SVG with no viewBox gets one; `featured` ("Show in header") on a social link | `common/components/{SocialLinks,SocialScroll,ThemeRadios,ThemeToggle,ThemeScript,ThemeProvider,Wordmark}.tsx` + `themeConfig.ts`, `common/bin/doctor.ts`, the growth chart, `common/lib/{socialSvg,socialLinks}.ts` + tests, `common/lib/settingsSchema.ts` (the social-link type, parser, docs; the normalizer moved to `socialSvg.ts`), `common/lib/normalizeSocialSvg.test.ts`, `common/lib/{settings,site,homepage}.ts` (the save errors), `common/lib/{homepageSummary,siteColor}.ts`, `homepage/app/components/{Header,Footer,ArchiveCards}.tsx`, `homepage/app/lib/{nav,summary}.ts`, `homepage/app/not-found.tsx`, `homepage/e2e/**` (the fixtures, `helpers.ts`, the new and the rewritten specs), `homepage/playwright.config.ts`, `export/app/components/{MobileMenu,Footer}.tsx` (the `ThemeRadios` swap; the footer's read path), `editor/app/components/SocialLinksField.tsx` + `socialLinksJson{,.test}.ts`, `editor/app/{settings,sites}/actions.ts` (the save errors), `editor/e2e/settings.spec.ts`, `SETTINGS.md`, `SITE.md` |
| Lows, chart gap, T1, H1 (H3 folded in), H2 | `r14/two-grounds-headers` | The final review's Lows; the charts' surface gap; two grounds and each site in its own accent; the export and hub headers carry the social row and the toggle as one group, with an Archilyzer link to the homepage's `#instances` in place of the sites dropdown and the hub link; Changelog to the footer; after its review, the narrow header keeps the name and shows only the marked links (every header) | `common/components/{ThemeProvider,ThemeScript,ThemeToggle,SocialScroll}.tsx` + `themeConfig.ts` (and the deleted `ThemeMenu`, `ThemeRadios`), `common/components/charts/{ChartView,CrossSiteChart,surfaceGap}`, `common/styles/tokens.css`, `common/lib/{brand,accent,siteColor,paths,project,socialSvg,siteSchema,settingsSchema}.ts` + tests, `scripts/next-build-trace.test.mjs`, `export/app/components/{Header,MobileMenu,Footer}.tsx` (and the deleted `SiblingSwitcher`), `export/app/{layout.tsx,globals.css,changelog/page.tsx,lib/brand.ts}`, `export/e2e{,-hub}/**` (the theme, header and branding specs), `export/playwright.config.ts`, `editor/app/{layout.tsx,globals.css,sites/components/SiteForm.tsx}`, `editor/e2e/theme.spec.ts`, `homepage/app/{page.tsx,layout.tsx,globals.css,lib/*,changelog/page.tsx,components/{Header,ArchiveGrowthChart,ArchiveCards}.tsx}`, `homepage/e2e/**`, `homepage/content/docs/operate.md`, `SETTINGS.md`, `SITE.md` |
| HS | `r14/hidden-sites` | Hidden sites: `site.json` `listed` (absent = listed). An unlisted site builds and deploys as before, and is left off the homepage (cards, chart, `/stats`), the hub (members, federated search, `corpus.json`, `llms.txt`), every other site's footer and the published id lists (`channel-sites.json`, the pooled `stats/`); the channels only it exposes count in no public total. One checkbox in the site form | `common/lib/{siteSchema,site,homepageSummary}.ts` + tests, `common/controller/{poolSummary,buildStats}.ts` + tests, `common/bin/{compose-homepage,compose-hub}.ts` + `compose-hub.test.ts`, `editor/app/sites/{actions.ts,components/SiteForm.tsx}`, `editor/e2e/{helpers.ts,sites-crud.spec.ts}`, `homepage/e2e/{fixture-summary.ts,unlisted-site.spec.ts}`, `SITE.md`, `plans/FACTS.md` (Naming hazards) |
-| S1 | `r14/first-search` | A clear screen until the first Search, on every site's search page and the hub's: no results area until the visitor asks (a Search, a profile load, or a link that carries a query or a filter), with the bar's "Press Enter or click Search to apply" line meanwhile; two page-life flags, the hold of release 8 unchanged and the gate new | `common/components/{SearchSessionContext,SearchResults,SearchBar}.tsx`, `export/e2e/first-search.spec.ts` (new), `export/e2e/{browse-all,workspace-shell,charts,restore-no-refire,responsive,tag-chips}.spec.ts`, `export/e2e/helpers.ts` (`showAll`), `export/e2e-hub/federated-search.spec.ts`, `export/CHANGELOG.md`, `plans/export-header-first-search.md` |
+| S1 | `r14/first-search` | A clear screen until the first Search, on every site's search page and the hub's: no results area until the visitor asks (a Search, a profile load, or a link that carries a query or a filter), with the bar's "Press Enter or click Search to apply" line meanwhile; two page-life flags, the hold of release 8 unchanged and the gate new | `common/components/{SearchSessionContext,SearchResults,SearchBar}.tsx`, `export/e2e/first-search.spec.ts` (new), `export/e2e/{browse-all,workspace-shell,charts,restore-no-refire,responsive,tag-chips}.spec.ts`, `export/e2e/helpers.ts` (`showAll`), `export/e2e-hub/federated-search.spec.ts`, `export/CHANGELOG.md`, `plans/archive/sites-and-publishing.md` (entry `export-header-first-search.md`) |
| CF | `r14/chart-fold` | The homepage's growth chart folds two or more sites each under 5 % of its total into one Other band on top, in its own near-neutral grey (`--chart-other`); the kept sites keep their colours; the legend shows them and Other, the hover titles and the table every site | `homepage/app/lib/growthGaps.ts` + test, `homepage/app/components/ArchiveGrowthChart.tsx`, `common/styles/tokens.css` (`--chart-other`), `homepage/e2e/{fixture-summary.ts,growth-chart.spec.ts,instance-colours.spec.ts,marketing.spec.ts}`, `homepage/CHANGELOG.md`, `plans/FACTS.md` |
**Order:** HP → `r14/two-grounds-headers` → HS (`r14/hidden-sites`) and S1 (`r14/first-search`),
@@ -1657,7 +1657,7 @@ The caption and the image-label sentences are kept (the review: acceptable addit
Release 14 is slice HP (merged, `bfa1ff3c`), `r14/two-grounds-headers`, slice HS
(`r14/hidden-sites`), slice S1 (`r14/first-search`) and slice CF (`r14/chart-fold`), each after the
parent's merge. Every command below is typed **from the primary checkout's root**. There is no `archilyzer` on PATH, so it is `pnpm archilyzer …`. The
-command forms are the ones verified in `plans/stats-cache-key.md`'s rollout.
+command forms are the ones verified in `plans/archive/acquisition-and-pipeline.md` (entry `stats-cache-key.md`)'s rollout.
**Preconditions.**
1. `main` carries `r14/two-grounds-headers`.
diff --git a/plans/release-15.md b/plans/release-15.md
@@ -6,7 +6,7 @@ prompt carries its ruling, and this record carries what was built. Rules:
**The standing choices** (not re-opened):
- **An unmounted drive is not an empty channel,** for any build that walks the pool. The stats
- build already holds such a channel ([`stats-cache-key.md`](stats-cache-key.md)); the index
+ build already holds such a channel ([`stats-cache-key.md`](archive/acquisition-and-pipeline.md)); the index
build gets the same hold here.
- **A slice that needs another slice's file stops and says so**; it does not edit it.
- **Nothing is edited in the primary checkout**; each slice has its own worktree, and the parent
diff --git a/plans/release-16.md b/plans/release-16.md
@@ -1,1281 +0,0 @@
-# Release 16 — what a search reads
-
-`main` at `9a259787` (releases 14 and 15 merged and rolled out). No plan file of its own: each
-slice's prompt carries its ruling, and this record carries what was built. Rules:
-`plans/tools/implementer-rules.md`, with the commit trailer this release's prompts give.
-
-**The standing choices** (not re-opened):
-- **A search reads transcripts and posts unless the visitor says otherwise; live chat is read only
- when asked.** On `main` before this release a plain query read the transcript cues only: posts
- only through a query-builder leaf whose scope is "Posts", live chat only through one whose scope
- is "Live chat". A plain query now reads transcripts and posts by default; the three become one
- row of toggles. (Corrected after slice CK found the first wording, "a plain query already reads
- … the posts corpus", untrue of the code.)
-- **The toggles say what a query reads, not which records list.** "Type: Videos, Livestreams"
- keeps saying which records are shown; an empty query with Transcripts off still lists videos.
-- **A slice that needs another slice's file stops and says so**; it does not edit it.
-- **Nothing is edited in the primary checkout**; each slice has its own worktree, and the parent
- merges with `git merge --no-ff` only on a clean tree.
-
-## The slices
-
-| Slice | Branch | What | Owns |
-|---|---|---|---|
-| CK | `r16/search-in` | A "Search in" row — Transcripts, Posts, Live chat — on the export and hub search, Transcripts and Posts on by default | `common/components/{FiltersPanel,SearchSessionContext,SearchResults,SearchBar,exportFilterStorage}.tsx/.ts`, `common/lib/searchQuery.ts` and `common/lib/search/*` as its prompt names, `export/e2e/search-in.spec.ts` (new) and the specs its prompt names, `export/e2e/helpers.ts`; records: `plans/FACTS.md` |
-| DX | `r16/research-setup` | The research-only setup (source → `pnpm install` → `claude mcp add archilyzer` → `/ask`) in one place, the homepage's AI and MCP doc; the sites' and the hub's Use-with-AI page removed and its links pointed at the doc; `README.md` §1/§4 and `mcp/README.md` their own copies (as amended) | `homepage/content/docs/ai-and-mcp.md`, `export/app/use-with-ai/` (removed), the Use with AI links (`export/app/components/{Header,MobileMenu,Footer}.tsx`, `export/app/(workspace)/ask/page.tsx`), `common/lib/{project,corpus}.ts` + `common/bin/compose-site.ts` (what named the page), `mcp/README.md`, `README.md` §1/§4 (wording only), `homepage/e2e/docs.spec.ts`, `export/e2e{,-hub}/use-with-ai-link.spec.ts` and the specs that visited the page |
-| FK | `r16/forms-keep-input` | Every editor form keeps what was typed when its action fails: actions return the submitted values with the error, the shared field helpers seed from them | new `editor/app/lib/formState.ts` + test; `editor/app/components/forms/Field.tsx` and the local `Field`s in `SiteForm.tsx`, `ChannelForm.tsx`; every action that returns `{ok:false,error}`/`{error}` (sites, settings, operations/settingsActions, scheduler, storage, homepageActions, cutReleaseAction, channels, videoActions); the 15 forms the ruling lists; e2e `forms-keep-input.spec.ts` (new) + the existing `sites-crud`, `settings`, `channels` specs; records: `plans/FACTS.md`. As shipped, also `editor/app/components/forms/Controlled.tsx` (new) and one tag swap each in `DurationField`, `SocialLinksField`, `SiteMembershipsSection`, `WorkersField` ("Slice FK, as shipped") |
-| RM | `r16/move-holds-writers` | A media move holds the channel's writers and mirrors its copy, so a transcription or download during the move cannot fail it | `common/controller/relocateChannelMedia.ts` (+ the saved-video mover if it shares the code) + tests; the lane runners' per-channel skip (`common/controller/autoRunner.ts`, the backfill/digest/normalize/clip-fetch entry points, `common/lib/channelMediaHold.ts`); `common/jobs/jobKinds.ts` (`needsMedia`); the channel page's Storage panel and the rack's reason text; `editor/e2e/relocate*.spec.ts`; records: `plans/FACTS.md`. As shipped, also `common/controller/{channelWriters,relocateDir}.ts` (+ tests), `common/jobs/streamCommand.ts`, `common/views/channelRow.ts`, `editor/app/channels/lib/{mediaBusy,relocationJob}.ts`, `editor/app/storage/lib/{storeBusy,savedVideosJob}.ts`, `editor/app/api/test/stuck-job/route.ts`; the relocate spec is `editor/e2e/channel-storage.spec.ts` ("Slice RM, as shipped") |
-| XL | `r16/x-login` | Connecting an X account works: the Connect window is the operator's own browser without automation signals, and the fetchers can use the operator's browser login directly (`cookiesFromBrowser`) with no window at all | `common/social/{xSessionBroker,xGalleryDlFetcher,fetchers,playwrightRuntime}.ts` + tests; `common/lib/settingsSchema.ts` (one key) + `SETTINGS.md`; `editor/app/settings/{xSessionActions.ts,components/XSessionSection.tsx}`; `editor/e2e/settings*.spec.ts`; records: `plans/FACTS.md`, `ENVIRONMENT.md` if an env var is added. As shipped, also `common/social/{xBrowser,xCookieSource,xBrowserLogin,nodeSqlite}.ts` and `__fixtures__/firefoxCookieStore.ts` (new), `xPlaywrightFetcher.ts`, `common/controller/fetchPosts.ts` (the source per channel), `common/lib/{settingsDocs,envVars}.ts`, `editor/app/settings/page.tsx`, and `editor/e2e/x-session.spec.ts` — the spec that covers the section ("Slice XL, as shipped") |
-
-## Slice CK — the ruling (2026-09-30)
-
-- One row, **"Search in"**, beside the Type row of the Filters panel: **Transcripts** (on),
- **Posts** (on; the Posts box moves here from the Type row, same storage key `nop`, same
- accessible name), **Live chat** (off; offered only when the site's subs manifest reports live
- chat, as Posts is offered only when the site ships posts).
-- The row governs every query leaf whose scope is "transcripts" (the default leaf): it reads the
- cues of the kinds ticked. A leaf whose scope is "Live chat" or "Posts" was asked for by name and
- is not changed by the row.
-- With all three off the Search button does nothing and the panel says which row to fix; the
- visitor cannot commit a query that reads nothing.
-- A live-chat hit inside a video's row wears the "live chat" track badge whenever the visitor could
- also be seeing transcript hits — the suppression at `SearchResults.tsx` for that one track ends.
-- Stored like the other toggles (the working snapshot and the profiles, `ytdlp-tb:export-filters`),
- only when off the default. Share links do not carry the row this release (they do not carry
- `nop` either); a `qt=` link a visitor opens reads with the visitor's own row.
-- The hub's search gets the row through the shared components; nothing hub-specific.
-
-## Slice DX — the ruling (2026-09-30, amended by the operator the same evening)
-
-- **The setup lives in ONE place: the homepage's AI and MCP doc** (`/docs/ai-and-mcp/`). It tells a
- visitor who only wants to run Claude Code against a public instance, in one block: get the source
- (the mirror clone or the tarball on `/downloads/`), `pnpm install`, register the MCP server **as
- `archilyzer`** against the instance of their choice (`TRANSCRIPT_SITE_URL`; `TRANSCRIPT_HUB_URL` to
- federate), start `claude`, try `/ask`. Windows → WSL2, one line. The optional editor lines for
- `fetch_clip`, one sentence. The reason for the name (the shipped `/ask` and `/sweep` call
- `mcp__archilyzer__…`) sits beside it. What that page already says about the published contract
- (`/corpus.json`, `/llms.txt`), the MCP server and the honesty features stays.
-- **The sites' `/use-with-ai` page is removed** (export and hub). Its footer entry, its header entry
- and the link on Ask AI point at the homepage doc instead (`PROJECT_URL` + `/docs/ai-and-mcp/`, same
- tab), keeping the label **Use with AI**. Nothing a site said there is lost: the contract lines are on
- the homepage doc, and a site's own `/llms.txt` still describes the site. Specs that used the page as
- "another page" (`first-search`, `restore-no-refire`, `responsive`) use `/changelog/` instead.
-- **The READMEs are their own copies**: `README.md` §1/§4 and `mcp/README.md` say the same steps in
- the same order and register `archilyzer`; the record notes that the homepage doc and the READMEs are
- two places to change together (there is no shared source between markdown in `homepage/content` and
- the repo's READMEs this release).
-- No code path other than the removed page and its links changes.
-
-## Slice FK — the ruling (2026-10-01)
-
-- **A form that fails keeps what was typed.** React resets a `<form>` when its action's transition
- commits, success or failure; an uncontrolled field (`defaultValue`, `defaultChecked`) is wiped and a
- controlled one survives. Every save action that can fail returns the submitted values beside the
- error — `{ ok: false, error, values }` (the `channels` flavour `{ error, values }`), `values` being
- the raw form entries captured once at the action's top — and every field helper seeds
- `defaultValue`/`defaultChecked` from `values` when present, else from the initial value. A checkbox
- absent from `values` is unchecked when `values` is present (an unticked box sends nothing).
-- One shared type and one helper (`editor/app/lib/formState.ts`); the three `Field` helpers take the
- live state; the structured widgets that already survive (`SocialLinksField`, `WorkersField`,
- `DigestAppsField`, `DurationField`, `SiteMembershipsSection`, `LocationForm`, `EditorTagsClient`) are
- the model and are not changed.
-- The forms, in order of the operator's pain: `SiteForm` (create and edit), `SettingsForm`,
- `ChannelForm` (create and edit), then `AttributionSettingsForm`, `DiarizationSettingsForm`,
- `DigestSettingsForm`, `LaneSettingsForm`, `SchedulerSettingsForm`, `HealthTimingForm`,
- `HomepageConfigForm`, `CutReleaseForm`, `RenameChannelForm`, `DeleteChannelForm`,
- `DeleteVideoDirSection`, `SavedVideosControls`' checkbox. All of them this slice.
-- A success path is unchanged: a form that redirects or re-renders fresh after `{ ok: true }` keeps
- doing so.
-- Labels and test ids are contracts; nothing on disk changes shape.
-
-## Slice RM — the ruling (2026-10-01)
-
-- **A move refuses to start while a job is running on the channel** (download, transcription,
- normalize, digest, clip fetch, metadata refresh, snapshot — anything that writes under its
- `data/`), naming the job; the operator waits or cancels it. A move never waits silently.
-- **While `.relocating.json` exists, the channel's writers are held:** every lane runner skips the
- channel (the hold's sentence says "its media is moving"), every `needsMedia` job refuses to start
- on it (it does today through `in-transition`; the slice proves which writer got past that on
- 2026-09-30 — the transcription of `v50t5yt` ran during the copy — and closes it), and the hold
- clears when the move completes or is abandoned. The rack and the channel page show the hold.
-- **The copy mirrors.** The last copy pass before verification is `rsync -a --delete` from source to
- the destination copy (the destination is the copy under construction; the source is never the
- target of `--delete`), and verification is an empty `--dry-run --itemize-changes --delete` plus
- equal counts. If a source change is seen between the pass and the check, one more pass runs; a
- second difference refuses and names the file. Resume takes the same path, so an interrupted move
- with stale files on the destination (the 2026-10-01 case: a transcriber's scratch dir copied, then
- deleted from the source) completes.
-- **Remediation, when a move still fails its verification:** the refusal lists the differing paths
- by kind — extra on the destination, missing on the destination, changed — and the Storage panel
- offers **Reconcile and resume**: one job that runs the mirror pass (`--delete` toward the
- destination copy), verifies, and finishes the move; the operator never deletes a file by hand.
- (2026-10-01 the operator and the session did exactly that by hand for `realcandaceo`: five files
- of a transcriber's scratch dir removed from the destination copy, then Resume.) A failure the
- reconcile cannot settle (a changed file that keeps changing) refuses once more and names it.
-- The on-disk marker's shape does not change; nothing else about where media lives changes.
-
-## Slice XL — the ruling (2026-10-01)
-
-- **Why it failed:** the Connect window is Playwright's bundled Chromium launched with its automation
- signals on (`--enable-automation`, `navigator.webdriver`, the "controlled by automated test
- software" bar). Google refuses such a browser ("this browser or app may not be secure"), and X's
- own login form stalls in it. The operator saw both on 2026-10-01.
-- **The Connect window is the operator's own browser:** the system Chromium/Chrome when one is
- installed (found on `PATH` or a configured path), else the bundled one — in both cases launched
- without the automation signals (`ignoreDefaultArgs` for `--enable-automation`,
- `--disable-blink-features=AutomationControlled`, no infobar), in the broker's persistent profile
- as today. The section says plainly that Google's sign-in may still refuse an embedded browser and
- that the X password login is the reliable path there.
-- **The fetchers can use the operator's browser login directly, with no window:** when
- `cookiesFromBrowser` is set (it is: `firefox`), the X fetchers pass `--cookies-from-browser` to
- gallery-dl (it supports it) and read the same cookies for the other X paths, fresh on every run —
- the operator stays logged in to X in their everyday browser and nothing expires. One setting
- chooses the source — `social.x.cookieSource: "browser" | "profile"` — defaulting to `browser`
- when `cookiesFromBrowser` is set and no profile is connected, else `profile`. The section shows
- which source is in use and whether an X login is visible in it (an `auth_token` cookie for
- `x.com`, read from the browser's cookie store read-only), with a "Check" button.
-- Nothing is automated against X's login; no credentials are stored; the cookie jar's format and
- path do not change.
-
-## Record
-
-### Slice CK, as shipped — a search reads what the visitor ticked (2026-09-30)
-
-Branch `r16/search-in` off `main` `6c6dcd04`, worktree `~/Projects/plans-export-header-first-search`
-(editor 3401, test 3411, export 3410; the export suite's server on 3420), one Opus implementer.
-Scratch files `ck-*` in the job's `tmp`. The ruling is above ("Slice CK — the ruling").
-
-**The ruling's "today" was not the code; the slice built the ruling.** On `main` a plain query — a
-leaf of scope "transcripts" — read the transcript cues and nothing else. The Posts box in the Type
-row put the posts corpus into the global scope only when a leaf of scope "Posts" was in the tree
-(`needsPostsManifests`), and every other leaf subtracts the posts slugs (`searchEval.ts:337`), so a
-plain query never read a post. The row as ruled (Posts ticked by default, the row governs the
-transcripts leaf, the toggles say what a query reads) therefore makes a plain query read posts on a
-site that ships them: what a plain search returns there changes. Taking it back is one flag — `posts`
-false in the session's `committedSearchIn` and `draftSearchIn` — and the Posts box would then govern
-only a "Posts" leaf, as before.
-
-**What was built.**
-
-- **The row.** "Search in" beside Type in the Filters panel (`FiltersPanel.tsx`,
- `data-testid="search-in-row"`): **Transcripts** (ticked), **Posts** (ticked; the box moved out of
- the Type row with its key `nop`, its accessible name and its gate, `postsManifest.channels`
- non-empty), **Live chat** (unticked; offered only when `subsManifest.liveChatTotalCount > 0`). The
- Type row keeps Videos and Livestreams. The hub gets it through the shared components.
-- **Mechanism (a), the smaller: a rewrite of the committed tree just before it runs.**
- `applySearchIn(root, {transcripts, posts, chat})` (`common/lib/searchQuery.ts`) turns each active
- "transcripts" leaf into:
- - the leaf itself, the same object, with Transcripts alone ticked (so the default row on a site
- with neither posts nor live chat runs the very tree it was given);
- - the leaf with the one other kind's scope, same id, same `negate`, with one other kind alone;
- - an OR group `<id>~in` over copies `<id>~transcripts`, `~posts`, `~chat`, each with the leaf's
- `contributeHits`, with two or three kinds. A negated leaf is NOT of the union: the OR sits inside
- a negated one-child AND `<id>~not`, so the OR's own group state is the union whatever `negate`;
- - with nothing ticked, the leaf unchanged (see the refusal below).
-
- Posts are not left on the global-scope path, as the prompt proposed: that path reads posts only
- for a "Posts" leaf, so the rewrite makes one (the posts copy) and the path then feeds it. `nop`
- acts only here, by leaving the posts copy out; it no longer gates the global scope (review M2),
- so a leaf whose scope is "Posts" reads posts with the box unticked, as ruled. Under a curated-tag
- filter no posts copy is made either (`searchInUnderTags`; a post carries no tags), unless posts
- are all the row reads — then the copy stays and reads an empty scope, and the leaf does not fall
- back to its transcripts. A leaf of any other scope, and an empty leaf, are untouched.
- (b) would have run up to three pipelines per leaf inside `runLeaf`, each with its own cache key,
- controller and streaming merge; (a) touches the evaluator only in `runLeaf`'s empty-scope
- short-circuit (review M1) and in what a cached or empty leaf reports as its progress (re-review
- R-L1).
-- **The fold.** `foldSearchIn(progress, tree)` (`common/lib/search/searchIn.ts`, new) files the
- copies' hits back under the visitor's leaf id (a chat hit keeps `scope: "chat"` and
- `track: "live_chat"`, so it lands in the same section of the same video row, in time order), and
- folds the copies' states into one: the count is the OR group's union once every copy has started
- (before that, the evaluator reads a copy with no result as the whole scope, so the largest copy
- stands in and the leaf shows as active), hits, processed and to-process summed, capped if any,
- cached if all. Nothing else reads the copies' ids.
-- **The session** (`SearchSessionContext.tsx`). What counts as ticked is what the site can honour:
- Posts only with a posts corpus, Live chat only with live chat — the panel's own conditions — so a
- stored `lc` on a site without chat asks for no subs manifest (see "Found and left" for what a
- "Live chat" leaf does there). The session waits for the two manifests before it decides anything
- from the row (review L4): `SearchDataValue.manifestsSettled` — the single site's settles at each
- manifest's first answer or first failure (a 404 subs manifest is not held for the retry), the
- hub's is `summariesReady`, since an archive is ready only once both its manifests have settled.
- Until then Search is not refused and the query does not run, so a stored row with Transcripts
- unticked never reads transcripts first and then re-runs — on a single site; for the progressive
- hub see "Found and left". The committed tree runs as `applySearchIn(committedRoot, …)` and its progress
- is folded before `setTreeProgress`; `needsChatManifests` and `needsPostsManifests` read the
- rewritten trees (draft and committed), so Live chat ticked loads the subs manifests and passes
- `chatScopeSlugs` exactly as a "Live chat" leaf does (the prompt's `|| committedLiveChat`, but only
- when there is a leaf to read it). The run and the hit-cap reset also depend on the rewritten tree's
- hash, so a change of the row alone re-runs. `committedRoot`, its hash, `qt=`, the builder's leaves
- and the result cards' sections stay the visitor's tree.
-- **State.** `notr` (Transcripts unticked) and `lc` (Live chat ticked) in `FilterSnapshot`, threaded
- like `nop`: `parseSnapshot`, `snapshotsEqual`, the draft/committed pairs, `buildDraftSnapshot`,
- `committedSnapshot`, `filtersDirty`, `promoteDraftsToCommitted`, `filterKey`, hydration,
- `applyDraftSnapshot`, `applySnapshot`, each written only off its default. Not in `UrlParams`, not in
- `ShareSelection`: **share links do not carry the row this release** (they do not carry `nop`
- either). Hydration reads the row from the stored snapshot (active profile, else working) whatever
- the URL carries, so a `qt=` link — and a share-v1 link, whose filters otherwise replace the
- stored ones — reads with the visitor's own row.
-- **`nop` was not threaded, three ways, and is now.** Hydration set the draft `nop` to false and
- never set the committed one, so Posts unticked came back ticked on every reload;
- `committedSnapshot` did not write it, so a profile with Posts unticked always showed as changed
- against what it had just loaded; `applySnapshot` did not commit it, so a loaded profile with Posts
- unticked searched posts until the next Search.
-- **Nothing ticked.** When nothing the site offers is ticked (`draftSearchInEmpty`), Search is
- disabled, `Apply filters` in the sheet is disabled (`FiltersContainer.tsx`, a new `applyDisabled`
- prop), Save and Save as… are disabled (`ProfilesRow`'s `saveDisabled`, review L2), and
- `commitSearch` (where Enter and Apply arrive) and both profile saves (which commit the draft)
- refuse. The row's line, "Search in: pick at least one" (`data-testid="search-in-empty"`,
- `aria-live="polite"`), is always mounted and empty unless Search is refused, so the change is
- announced (review L1; a live region, not `role="status"`, which the first cut used and which gave
- the page a second "status" beside the modal's — `modal-digest.spec` finds that one by role); the Search button is described (`aria-describedby`) by an always-mounted `sr-only`
- copy of the words in the bar (`id="search-in-refusal"`), because below xl the panel is a sheet
- that is not mounted while closed; its `title` stays for the mouse. The bar's "Press Enter or click
- Search to apply" is withheld while Search is refused. A tree committed with nothing ticked
- some other way (a hand-edited profile) reads its transcripts rather than matching nothing.
-- **Display.** The `hit.track !== "live_chat"` suppression in `SearchResults.tsx` is gone: every track
- hit wears its `TrackBadge`, so a "Live chat" leaf's hits now carry the badge too (no spec asserted
- its absence; `live-chat.spec.ts` searches nothing and was not changed). A transcripts leaf's
- section bar is named for what it holds (`sectionScope`): "Posts" on a post's card, "Live chat" when
- every hit in it is a chat hit, else "Transcripts".
-- **The bar.** The hint reads "Live chat available on N videos — tick Live chat under Search in." and
- goes once Live chat is ticked. The Filters chip's count gains one for the row off its default (Live
- chat ticked widens rather than narrows, but the panel that says so may be behind the chip); Videos
- and Livestreams keep their own one.
-
-**The fixture.** The export e2e fixture's posts said "alpha" and "gamma", like every video's cues. With
-posts read by default, every spec searching those words for its own reasons got two post cards: a first
-full run at `2d68d9d9` (stopped at 174 of 265) had 17 failures — 7 in `ask-chat`, 5 in `ask-workspace`,
-2 in `posts-search`, 2 in `query-tree`, all post cards, and 1 in `charts` (a browse-mode stacked-bar
-case the row cannot reach; it passed in both later runs). The posts now say "kappa" and "sigma"
-(`omega` was already theirs); `posts-search.spec.ts` and `tag-chips.spec.ts` name them in their posts
-leaves, and `search-in.spec.ts` reads both corpora with a regex `alpha|kappa` in one plain leaf.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `0edc628f` | `common:` `applySearchIn`, `SearchIn`, `SEARCH_IN_DEFAULT`, `searchInReadsNothing` in `lib/searchQuery.ts`; `foldSearchIn` in `lib/search/searchIn.ts`; tests. |
-| `41e75543` | `common:` `notr` and `lc` in the filter snapshot; `parseSnapshot` exported; the round-trip test. |
-| `2d68d9d9` | `common:` the row; the session (rewrite, fold, manifests, state, refusal, the three `nop` fixes); the bar; the badge and the section names; `applyDisabled` on the sheet's Apply. |
-| `5699a1e7` | `export(e2e):` `search-in.spec.ts`; the fixture's posts get their own words; `posts-search` and `tag-chips` follow them. |
-| `861baaa0` | `plans:` this section; FACTS "Search in"; the export changelog. |
-| `1eb089da` | Merge `main` (`0fe719b1`, the 0.11.0 cut, which renamed `[Unreleased]` while this branch added to it): the bullet goes under a fresh `[Unreleased]` above `[0.11.0]`. Changelogs only; no code moved on `main`, so no gate was re-run. |
-| `26c63ccb` | `plans:` the two rows above. |
-| `6980ac75` | `common:` review M1 — the three streaming drivers settle when no worker starts (and after a raised cap); `runLeaf` answers an empty scope at once; tests through the real drivers. |
-| `b22198d5` | `common:` review M2, L1, L2, L4 and M1's tag rule — `nop` no longer gates the global scope; `searchInUnderTags`; `manifestsSettled` on both SearchData providers and the held decision; the always-mounted refusal line and the button's description; Save and Save as… disabled. |
-| `aaf3accd` | `export(e2e):` `search-in` cases 9 (the "Posts" leaf), 10 and 11, the refusal's description and Save as…; `posts-search` for M2. |
-| `76deaac7` | `common:` the refusal line is a polite live region, not a second `role="status"` (it broke `modal-digest.spec`'s `getByRole("status")`). |
-| `1d7da806` | `plans:` the review, its rulings and gates in this section; the standing choice amended; FACTS; the changelog. |
-| `500417f3` | `common:` re-review R-L1 — a cached or empty leaf reports its progress over the scope it read (0 of 0 when empty); a real-driver test asserts the folded "searched N/M" only climbs. |
-| this commit | `plans:` the re-review in this section; "Found and left" gains R-L2, R-I2 and R-I1; the mechanism sentence; the follow-up in `STATE.md`. |
-
-**Tests** (unit)
-
-| File | What it pins |
-|---|---|
-| `lib/searchQuery.test.ts` (11, new) | Transcripts only returns the very same root; the default is Transcripts and Posts; Transcripts + Live chat is `OR(a~transcripts, a~chat)` with both mapped to `a` and `a` → `a~in`; Live chat only and Posts only swap the scope and keep the id; all three in a fixed order; nothing ticked is left alone, and `searchInReadsNothing`; leaves of every named scope and an empty leaf are untouched (same root); a negated leaf becomes a negated AND over an un-negated OR whose copies keep `contributeHits: false`; nested: an untouched subtree keeps its identity, group ids are kept, the input's `stringifyRoot` and `canonicalHash` do not change; two leaves get two sets of copies. |
-| `lib/search/searchIn.test.ts` (8, new) | Through the real `runQueryTree` with a fake leaf runner: Transcripts alone reads the cues only; Transcripts + Posts returns the video and the post, the post hit filed under the visitor's leaf with scope `posts`; Live chat ticked adds the chat-only video, its hit under the leaf with `track: "live_chat"`, the leaf's state folded (only `a` left, count 2 = the union, not active); Transcripts off + Live chat on: a cue-only word finds nothing; a "Live chat" leaf ignores the row; NOT reads NOT of the union and still counts what it matched. The fold alone: before every copy has started, the largest copy and active (not the 30,000 the evaluator reports); nothing rewritten returns the same progress. |
-| `components/exportFilterStorage.test.ts` (5, new) | `notr`, `nop`, `lc` survive a JSON round trip; absent reads as the default and a pre-row profile equals one spelling the defaults; a non-boolean is dropped; `snapshotsEqual` tells each apart; the working snapshot and a profile keep the row through `saveStoredState`/`loadStoredState`. |
-
-**e2e** (`export/e2e/search-in.spec.ts`, new, 11 cases after the review): (1) the defaults — Transcripts and Posts
-ticked, Live chat not, exactly one checkbox named "Posts" on the page, Videos and Livestreams still
-in Type, and the bar's hint, gone once Live chat is ticked; (2) a plain "kappa" returns the two posts
-under a section named "Posts", and none with Posts unticked; (3) one plain regex leaf `alpha|kappa`
-returns 3 videos and 2 posts, "5 videos, 5 hits"; (4) "message" (only in one video's chat) finds
-nothing by default, and with Live chat ticked finds that video, "1 video, 30 hits", every shown hit
-badged "live chat", the section named "Live chat", and `qt=` still the visitor's one transcripts
-leaf; (5) Transcripts off + Live chat on: "line" (only in cues) finds nothing, "message" finds the
-chat video, Transcripts back on finds all three; (6) nothing ticked: Search disabled and described
-by the words, Save as… disabled, the line shown (always mounted, empty otherwise), the "Press Enter"
-line withheld, Enter commits nothing (no `qt=`, no results), Live chat or Posts re-enables it; (7) the row survives a reload, is saved with "Save as…", a diverging Search
-leaves the profile, and loading the profile brings the row back with no unsaved-changes dot and its
-results; storage holds `notr` and `lc` and no `nop`; (8) an empty query with Transcripts off lists
-"All videos (3)"; (9) a "Live chat" leaf from `qt=` reads the chat with the row at its default, and
-a "Posts" leaf reads its two posts with Transcripts and Posts unticked; (10) a plain query under a
-tag chip finishes with its two tagged videos, and with posts alone ticked says "No matching
-videos." and finishes; (11) with Videos and Livestreams unticked a plain "kappa" reads the two posts
-and finishes. `posts-search.spec.ts`: unticking Posts leaves a "Posts" leaf's two posts.
-
-#### Gates (logs `$T/ck-*.log`)
-
-- **tsc** (all workspaces): clean before each code commit — 71 s at `2d68d9d9` (after removing a
- truncated, stale `editor/.next/dev/types/validator.ts` left in this worktree by an earlier dev run,
- which failed the first attempt with TS1002); export's alone after the e2e edits.
-- **Unit:**
-
- | Suite | Result |
- |---|---|
- | common | **2,372/2,372**, 84 s (24 new: 11 + 8 + 5) |
- | mcp | **271/271**, 27 s (it imports `lib/searchQuery.ts`, which only gained exports) |
- | editor unit, `test:scripts` | not run: no editor file, script or anything they import changed |
-
-- **Build:** `pnpm --filter export exec next build` — exit 0, 35 s, `export/public` links refreshed from
- the primary and none dangling (three that were — `hub-sites.json`, `hub-summary.json`,
- `duplicates.json`, gone from the primary — removed first). The editor and umtool builds: not run,
- neither imports a changed module.
-- **e2e** (detached and queued; none waited in the queue):
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 1 | `2d68d9d9` | the prompt's eight (`search-in`, `posts-search`, `live-chat`, `filter-profile-persistence`, `first-search`, `browse-all`, `query-tree`, `share-current-search`) | 50 passed, **6 failed**, 4.4 min — `search-in` 8/8; the six were post cards (above) |
- | 2 | `2d68d9d9`, old fixture | the full export suite | stopped at 174 of 265: 157 passed, **17 failed** (above) |
- | 3 | `2d68d9d9` + the fixture and spec edits | the full export suite | 264 passed, **1 failed**, 14.0 min — `tag-chips` named "alpha" in a posts leaf |
- | 4 | `5699a1e7` | the eight + `tag-chips` | **72 passed**, 0 failed, 3.5 min |
- | 5 | `5699a1e7` | the hub suite (`e2e:hub`) | **36 passed**, 0 failed, 1.6 min — its fixtures ship no posts and no live chat, so the row is a lone Transcripts box and no tree is rewritten |
- | 6 | `5699a1e7` | the editor suite's `export-search.spec.ts` (it drives the export's filter rows) | **19 passed**, 0 failed, 1.0 min |
- | 7 | `5699a1e7` | the full export suite | **265 passed**, 0 failed, 15.1 min |
-
-- **Numbers tool:** none.
-
-#### Found and left
-
-- **Not governed by the row:** a chart's own search series (`components/charts/useSearchSeries.ts`
- runs its own tree), `/ask`'s retrieval (`export/app/lib/askRetrieval.ts`, its own OR of keywords —
- though the grounding it is handed from the search page is the session's results, which the row
- governs), and the MCP (no row).
-- **A late manifest after a failure.** The single site's manifests count as settled at their first
- failure (so a site with no live chat, whose subs manifest 404s, is not held for the retry). A
- manifest whose retry does answer arrives later and the row re-runs, as a late manifest always
- did.
-- **A draft tick restarts the committed run** (review I2, left): the manifests load on the draft's
- need or the committed one's, and the run waits on both, so ticking Posts or Live chat in the
- draft cancels a committed run in flight, which re-runs once the manifests are in (cheaply, from
- the layer cache). The same was already so for a draft "Live chat" leaf.
-- **Hub mode is covered by reasoning** (review I3): no hub or two-origin fixture ships posts or
- live chat, so their suites see a lone Transcripts box and no rewrite. The rewrite never touches
- slugs, and the posts and chat scopes are built from the merged, origin-qualified manifests.
-- **On the progressive hub, a stored row of posts only or live chat only can read as empty at
- first** (re-review R-L2). The hub's `manifestsSettled` is `summariesReady`, true once the first
- archive is ready, and the merged posts and subs manifests grow one ready archive at a time. If
- that archive has neither, a stored row with Transcripts unticked reads as nothing: the refusal
- shows, and a `qt=` link runs through the empty-row fallback, reading transcripts, then re-runs
- when an archive with posts or chat lands. On a single site the manifests settle together, and the
- claim holds.
-- **The global scope takes the posts when the draft needs them too** (re-review R-I2):
- `needsPostsManifests` is the draft's need or the committed tree's. With Posts unticked and a
- committed negated plain query (`NOT x`), a draft that grows a "Posts" leaf re-runs the committed
- query, and its result gains every post (the plain leaf read none). Consistent with NOT; the
- result depends on the draft. On `main` the same held with Posts ticked.
-- **"Load more results" never resumes a leaf that settled at its cap** (re-review R-I1; on `main`
- too): a driver resolves `done` when its workers stop at the cap, `runLeaf` drops its controller,
- and the tree's `setHitLimit` reaches running leaves only. More plain queries reach the cap now
- that each copy has its own. A follow-up in `STATE.md`.
-- **A lone Transcripts box.** On a site with neither posts nor live chat (the hub's e2e fixture) the
- row is one box, whose only effect unticked is to refuse Search. Shown as ruled (Transcripts is not
- conditional).
-- **Each post twice under an explicit `(transcripts OR posts)` tree.** With Posts ticked the
- transcripts leaf reads posts too, so a post matched by both leaves shows one section per leaf. The
- tree says to read posts twice; the row does not merge leaves.
-- **"Matching videos (N videos, …)" counts posts as videos** — as before, for a "Posts" leaf.
-- **The builder's scope select still says "Transcripts"** for the default leaf, which now reads what
- the row ticks; its placeholder still says "Search transcripts...". Unchanged (the labels are
- contracts; `filter-profile-persistence` finds the input by that placeholder).
-- **A "Live chat" leaf on a site with no subs manifest at all waits for ever** (as on `main`): the
- run waits for `subsManifestReady`, which needs a manifest that 404s. The row does not reach it,
- since it counts Live chat only where `liveChatTotalCount > 0`.
-- **A stored `lc` on a site without live chat** is kept (the panel does not show the box, and the
- session counts it as unticked); it applies again on a site that has chat, since profiles are per
- browser, not per site.
-
-#### Decisions the operator could overturn
-
-| What I assumed | The alternative |
-|---|---|
-| **A plain query reads posts by default** (the ruling as written; the ruling's "today" said it already did, and it did not) | Posts in the row governs only a "Posts" leaf, and a plain query reads no posts, as on `main` (one flag) |
-| Mechanism (a), a rewrite before the run plus a fold of the progress | (b), branching inside `runLeaf` |
-| Posts are read through a posts copy of the leaf, not left on the global-scope path, which reads posts only for a "Posts" leaf | — |
-| Posts and Live chat count as ticked only where the site has them, for the rewrite and for "nothing ticked" | The stored booleans as they are, whatever the site ships |
-| The row always renders, even as a lone Transcripts box | Hide it where neither Posts nor Live chat is offered |
-| With nothing ticked, `Apply filters` and the two profile saves refuse too, and the bar's "Press Enter" line is withheld | Only the Search button |
-| A committed tree with nothing ticked (a hand-edited profile) reads its transcripts | Matches nothing |
-| The row is read from the stored snapshot whatever the URL carries, share-v1 links included | A share-v1 link resets the row to its defaults, as it resets the other filters to the link's |
-| A transcripts leaf's section is named for what it holds ("Posts", "Live chat") | Always "Transcripts" |
-| The Filters chip counts the row off its default as one, Live chat ticked included | Only unticks count, as narrowing |
-| The fixture's posts get words of their own, rather than every spec that searches "alpha" or "gamma" growing two post cards (16 failures in four specs by 174 of 265 tests) | Keep the posts' "alpha" and add the posts to each expectation |
-| The hint goes once Live chat is ticked | Always shown where live chat exists |
-| Each copy of a plain leaf has its own hit cap, so one reading two or three kinds can show up to 2–3× "Max hits" before "Load more" (as an explicit OR of leaves can); the header counts each video once | One cap shared by the copies |
-| After the review: no posts copy under a tag filter, unless posts are all the row reads | A posts copy that reads an empty scope |
-| After the review: the single site's manifests settle at their first failure | At the end of the retry (about a second more on a site with no live chat) |
-| After the review: the Search button is described by a copy of the words in the bar | Described by the panel's line (no description while the sheet is closed) |
-
-#### Review
-
-**Verdict: SHIP AFTER FIXES** (`ck-review.md` in the job's scratch). Rulings (parent, 2026-09-30):
-
-| Finding | Ruling | Where |
-|---|---|---|
-| M1: a copy with nothing to read never finished — none of the three streaming drivers finalized for zero slugs, and the rewrite makes such scopes from a plain query (a posts copy under a tag chip or a channel selection with no posts, a chat copy where no video in scope has chat, a transcripts copy when Type keeps no video), so the query read "searched N/M…" for ever | The drivers settle when idle after their first `ensureWorkers` and after a raised cap; `searchEval.runLeaf` answers an empty scope at once. No posts copy under a tag filter (unless posts are all the row reads). Tests through the real drivers; two spec cases | `6980ac75`, `b22198d5`, `aaf3accd` |
-| M2: `nop` still emptied a leaf of scope "Posts", against the ruling | `nop` no longer gates the global scope; it only leaves out the plain query's posts copy. `posts-search`, FACTS, the storage comment, this record and the changelog follow | `b22198d5`, `aaf3accd`, this commit |
-| L1: the refusal line appeared with its text, and the Search button's reason was only a `title` | The line is always mounted; the button is described by an always-mounted copy in the bar | `b22198d5`, `aaf3accd` |
-| L2: Save and Save as… stayed enabled and silently did nothing | Disabled like Search and Apply | `b22198d5`, `aaf3accd` |
-| L3: case (9) claimed a "Posts" leaf it did not check | Checked, with Transcripts and Posts unticked | `aaf3accd` |
-| L4: a stored row with Transcripts unticked read as empty until the manifests answered, and a `qt=` link could read transcripts first | The decision waits for `manifestsSettled`: no refusal, no run | `b22198d5` |
-| I1: the hit cap applies per copy | Recorded (decisions table) | this commit |
-| I2: a draft tick restarts the committed run | Left, recorded ("Found and left") | this commit |
-| I3: hub mode covered by reasoning only | Recorded ("Found and left") | this commit |
-| I4: the standing-choices paragraph said a plain query already read posts | Amended to what `main` did | this commit |
-
-The empty-scope settling also ends a hang that `main` had for a leaf asked for by name: a "Posts"
-leaf under a tag chip, or a "Live chat" leaf where no video in scope has chat, never finished
-there either (its own changelog bullet).
-
-**Tests after the review:** `lib/searchQuery.test.ts` 12 (+1: `searchInUnderTags`);
-`lib/search/searchIn.test.ts` 15 (+7: each of the transcripts, posts, chat and description drivers
-settles an empty scope and settles again after a raised cap; a plain query finishes through
-`runQueryTree` with the real drivers, with the posts scope null, an empty posts set, and an empty
-chat set, and with posts alone and none to read). All seven new cases fail on the code before the
-fix; the drivers' fix alone passes all 15, the `runLeaf` short-circuit alone passes the three
-`runQueryTree` cases.
-
-#### Gates after the review (logs `$T/ck-*.log`)
-
-- **tsc** (all workspaces): clean, 70 s before the fix commits and 42 s at `76deaac7` (common and
- export alone before that commit).
-- **common:** **2,380/2,380**, 79 s (+8).
-- **Build:** `pnpm --filter export exec next build` — exit 0, 33 s; no dangling `export/public` link.
-- **e2e:**
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 8 | `aaf3accd` | `search-in`, `posts-search`, `query-tree`, `tag-chips`, `live-chat` | **56 passed**, 0 failed, 2.5 min |
- | 9 | `aaf3accd` | the full export suite | stopped at 214 of 267: 213 passed, **1 failed** — `modal-digest`'s `getByRole("status")` found the always-mounted refusal line beside the modal's status; fixed in `76deaac7` |
- | 10 | `76deaac7` | the full export suite | **267 passed**, 0 failed, 13.5 min |
- | 11 | `76deaac7` | the hub suite | **36 passed**, 0 failed, 1.5 min |
-
-#### Re-review
-
-**Verdict: SHIP**, with three small things landed before the merge (parent's rulings, 2026-09-30):
-
-| Finding | Ruling | Where |
-|---|---|---|
-| R-L1: an empty-scope copy reported its parent scope as processed, so the folded "searched N/M" started full and then fell back (a cached copy did the same) | `applyCached` takes the size of the scope the leaf read: 0 of 0 when empty, a cached leaf's effective scope otherwise. The real-driver test with the posts scope null asserts the folded leaf's processed and fraction never fall; it fails on the previous code | `500417f3` |
-| R-L3: "(a) touches the evaluator not at all" was stale | The sentence names `runLeaf`'s empty-scope short-circuit and the progress `applyCached` reports | this commit |
-| R-L2: on the progressive hub a stored posts-only or chat-only row can read as empty until an archive with posts or chat is ready | Recorded ("Found and left"); the single-site claim is marked single-site | this commit |
-| R-I2: the global scope takes the posts when the draft needs them too | Recorded ("Found and left") | this commit |
-| R-I1: "Load more results" never resumes a leaf that settled at its cap (on `main` too) | Recorded ("Found and left") and a one-line follow-up in `STATE.md` | this commit |
-
-**Gates after the re-review:** tsc (all workspaces) clean, 48 s; common **2,380/2,380**, 84 s (the
-count is unchanged: one test extended); `pnpm --filter export exec next build` exit 0, 29 s;
-`search-in`, `query-tree` and `posts-search` at `500417f3`: **38 passed**, 0 failed, 1.9 min. The
-full export suite and the hub suite were not re-run, as the parent directed.
-
-### Slice DX, as shipped — the research-only setup, told where a visitor reads (2026-09-30)
-
-Branch `r16/research-setup` off `main` `2f09b065` (first cut at `2b767bc9`, reset on the amendment), worktree `~/Projects/homepage-social-visible`
-(block #3: editor 3301, test 3311, export 3310), one Opus implementer. Scratch files `dx-*` in the
-job's `tmp`. Built to the ruling as amended the same evening ("Slice DX — the ruling" above): the
-branch was first built to the ruling as first written (a shared `common/lib/researchSetup.ts` and the
-block on every site's page); on the amendment it was reset to `main` `2f09b065` (slice CK merged)
-and rebuilt, and of that first pass only the READMEs commit was kept (cherry-picked as `7921293f`).
-
-**What it does.**
-- **The homepage's AI and MCP doc has a "Ten-minute setup"** (`homepage/content/docs/ai-and-mcp.md`,
- an `###` under "## The MCP server", right after its two opening paragraphs): one `sh` block —
- `git clone https://archilyzer.pages.dev/source/archilyzer.git archilyzer # or the tarball on
- /downloads/`, `cd archilyzer && pnpm install`, `claude mcp add archilyzer --env
- TRANSCRIPT_SITE_URL=https://jeralyzer.pages.dev -- pnpm -C "$PWD" --filter yt-dlp-transcript-mcp
- exec tsx src/index.ts`, `claude # then: /ask what has he said about …` — and seven notes: what you
- need (Node.js 20.9 or newer, pnpm 9 or newer, Claude Code; no corpus, no yt-dlp, no GPU, nothing
- hosted; the repo has no `engines` field, so the numbers are README's Requirements table), the
- source ([git mirror](/source/), [tarball](/downloads/)), **register it as `archilyzer`** with the
- one-sentence reason, the two optional editor lines for `fetch_clip`, `TRANSCRIPT_SITE_URL` /
- `TRANSCRIPT_HUB_URL`, the `mcp.json` form for another client (in `mcp/README.md` on the raw
- tree), and WSL2 on Windows (the README's "Claude Code on Windows", on the raw tree). "What it can
- do:" became `### What it can do`, same words, so the list is not under the setup. Everything else
- on the page is unchanged.
-- **The sites' `/use-with-ai` page is removed** (`export/app/use-with-ai/`, export and hub). Its
- links keep the label **Use with AI** and go to `AI_DOC_URL` (`common/lib/project.ts`,
- `${PROJECT_URL}/docs/ai-and-mcp/`), same tab, as plain anchors: the header's nav (its entry, and
- `MobileMenu`'s, carry `external: true`), the footer's, and the one on Ask AI.
-- **What named the page names the doc:** `corpus.json`'s `useWithAi` (site and hub; the key stays),
- `llms.txt`'s "## Ask AI" (two lines now: `[Ask AI](<base>/ask/)` for the chat and `[Use with
- AI](<doc>)` for the MCP setup, site and hub), and the sitemap (`/use-with-ai` dropped).
-- **The READMEs are their own copies:** `mcp/README.md`'s "Add to Claude Code" and `mcp.json`
- examples register `archilyzer` (were `rekietalyzer`) from `/ABS/PATH/TO/archilyzer`, the
- directory the clone makes; its renaming paragraph stays and says why every example uses the name. `README.md` §1 registers with `pnpm -C "$PWD"`, "from the repo's
- root" (was `/ABS/PATH/TO/this/repo`, against §4 and the Windows notes); §4's quickstart starts
- from the source (`git clone …` or the tarball, then `cd archilyzer && pnpm install`). The
- homepage's drift table (`homepage/content/README.md`) names README §1/§4 and mcp/README as copies
- of the setup's commands, to change together; FACTS says the same.
-- **Specs.** `first-search` and `restore-no-refire` left the workspace through the header's Use with
- AI, a client navigation in the same page life. No site link makes one to a page outside the
- workspace now (the footer's Changelog is a plain `<a>`, a new page life), so they push
- `/changelog/` through `window.next.router` (FACTS) and assert the Changelog heading and no query
- builder before Back or the header's Search; their assertions are unchanged. `responsive` checks
- `/changelog/` in place of `/use-with-ai/`, expected to fail (below).
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `7921293f` | `docs:` mcp/README registers `archilyzer` in both examples; README §1's `"$PWD"` |
-| `8bfecf14` | `common:` `AI_DOC_URL`; `corpus.json` `useWithAi`, `llms.txt`'s Ask AI, the sitemap |
-| `e5160555` | `export:` the page removed; the header's, the menu's, the footer's and Ask AI's links; `first-search`, `restore-no-refire`, `responsive`; `use-with-ai-link.spec.ts` (site and hub) |
-| `ab8d46a5` | `homepage:` the Ten-minute setup; the drift table; `docs.spec.ts` |
-| `217d398f` | `docs:` README §4's quickstart starts from the source |
-| `ae206b01` | `export(e2e)`, `homepage(e2e)`: `/changelog/`'s overflow marked `test.fail`; `docs.spec`'s locator |
-| `6027b0dc` | `docs:` mcp/README's two examples name the checkout `/ABS/PATH/TO/archilyzer` |
-| `20605b5f` | `plans:` this section; FACTS; the export and homepage changelogs |
-| `1fcb224d` | `common:` review L3 — `corpus.test` pins `useWithAi` (site and hub) and llms.txt's two Ask AI lines |
-| `cadc595e` | `homepage:` review L2 — the doc names `fetch_clip` as the one exception to "it only reads" |
-| this commit | `plans:` review L1 (FACTS), L4 and the slices table's DX row; the review's findings; STATE's two follow-ups |
-
-#### Gates (logs `$T/dx-*.log`)
-
-- **tsc** (all workspaces) clean, 70 s — after deleting the worktree's `export/.next/dev/types`,
- left by the first pass's e2e dev server: its `validator.ts` imported the removed page (the build
- regenerates `.next/types`; the dev copy waits for a dev server). Export and homepage alone again
- after the spec fixes: clean.
-- **common:** 2,380/2,380, 129 s (the count unchanged: `corpus.test.ts`'s sitemap case takes
- `/changelog` as its sample route). **`test:scripts`:** 194 passed, 2 skipped (the umtool post-build
- check, whose worktree build predates its code; `LIVE`). **homepage unit:** 23/23.
-- **Builds:** `pnpm --filter export exec next build` exit 0, 33 s; the hub (`INSTANCE_MODE=hub`, the
- same command) exit 0, 31 s. In each `out/`: no `use-with-ai/`; every "Use with AI" in the HTML
- (the header's, the footer's, Ask AI's) has `href="https://archilyzer.pages.dev/docs/ai-and-mcp/"`;
- no `href="/use-with-ai`. The homepage (`next build`, capped at 5 GB) exit 0, 22 s; the doc carries
- the block. `eslint` on the touched export files: clean.
-- **e2e:** see the table below.
-- **Numbers tool** (`plans/tools/compose-fixture-one-youtube-channel`, composed into scratch): this
- slice's differences are exactly `corpus.json`'s `useWithAi`, `llms.txt`'s two Ask AI lines and
- `sitemap.xml`'s `/use-with-ai` entry. The committed fixture had already drifted from `main` (`spec`
- 3 → 4, four `_headers` entries, `index/sites/testsite/tag-counts.json`), so it was not updated.
-- **Privacy:** 0 matches of the operator's user name and 0 of the host name in every changed file,
- but `plans/FACTS.md`'s user-name count of 3, which is `main`'s (0 in the lines this slice adds).
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 1 | `217d398f` | homepage `docs.spec.ts` | 4 passed, **1 failed** (`.doc-measure` matched three elements; fixed in `ae206b01`), 19 s |
- | 2 | `217d398f` | export `use-with-ai-link`, `first-search`, `restore-no-refire`, `responsive`, `header` | 61 passed, **1 failed** (`/changelog/` overflows; marked in `ae206b01`), 4.9 min |
- | 3 | `ae206b01` | homepage `docs.spec.ts` | **5 passed**, 0 failed, 19 s |
- | 4 | `ae206b01` | the full export suite | **271 passed**, 0 failed, 15.1 min (`main`'s 267 + 4; `/changelog/`'s overflow case fails as marked, which the list prints as ✘ and counts as passed) |
- | 5 | `ae206b01` | the hub suite | **39 passed**, 0 failed, 1.6 min (`main`'s 36 + 3) |
-
-#### Found and left
-
-- **`/changelog/` overflows a 390 px phone by about 600 px** (the new `responsive` case; it was not
- checked before). Long inline `code` in released entries (`export/app/ask/{MessageBubble,…}.tsx/ts`,
- a JSON literal) has no break opportunity. The case is `test.fail`, so a fix turns it red. Fixing it
- is a change to the changelog's rendering, outside this ruling.
-- **A multi-line JSX text holding an HTML entity loses its leading space** under Next's SWC (FACTS):
- 22 texts in 19 files run a word into the element before it — 1 in `homepage/app/downloads/page.tsx`,
- 21 across `editor/app/**`; none in `export/app` or `common/components`. Found on the first pass's
- page, which is gone. Not fixed.
-- **The compose fixture under `plans/tools/` is behind `main`** (above). Refreshing it is its own
- commit.
-- `PUBLISH.md`'s registration (`-- pnpm -C "$PWD" archilyzer mcp`) and `AGENTS.md`'s (with the
- editor lines) register `archilyzer` and were left as they are; `export/CHANGELOG.md`'s released
- entry for the page is history.
-- A site deployed before its rebuild still serves `/use-with-ai/` and its old `corpus.json`; the
- rebuild removes both together.
-
-#### Decisions the operator could overturn
-
-| What I did | The alternative |
-|---|---|
-| `AI_DOC_URL` in `common/lib/project.ts`, beside `INSTANCES_URL` | `${PROJECT_URL}/docs/ai-and-mcp/` written at each of the six places |
-| The header's and the menu's entries render a plain `<a>` (`external: true`) | `next/link` with the absolute URL, which also renders an `<a>` and does not client-navigate |
-| `corpus.json` keeps `useWithAi`, now the doc's URL | Drop the key (a contract change) |
-| `llms.txt`'s Ask AI section: the site's `/ask/` chat and the doc, two lines | One line, to the doc |
-| The sitemap drops `/use-with-ai` and adds nothing | Add `/ask/` |
-| `first-search` and `restore-no-refire` reach `/changelog/` through `window.next.router.push` | Click the footer's Changelog: a hard navigation, a new page life, which is not what those tests prove |
-| `responsive` checks `/changelog/` with `test.fail` | Drop the route; or fix the changelog's wrapping here |
-| "What it can do:" is `### What it can do`, same words | The setup at the end of "## The MCP server", after the list |
-| The doc's notes include where the `mcp.json` form is (the removed page carried it) | Leave it out |
-| README §4's quickstart gains the clone step, with the tarball's host in its comment | Leave §4 starting at `pnpm install` |
-| The doc's `/ask what has he said about …` (README §4's words) | "they", for any archive |
-
-#### Review
-
-**Verdict: SHIP AFTER FIXES** (`dx-review.md` in the job's scratch): four lows, no High or Medium.
-
-| Finding | Where |
-|---|---|
-| L1: FACTS said README §1, §4 and mcp/README "say the same steps" | This commit: README §4 carries the doc's whole sequence in the same order; README §1 and mcp/README share only the registration command (§1 with `"$PWD"`, mcp/README with `/ABS/PATH/TO/archilyzer`) |
-| L2: the doc brought in `fetch_clip` beside "it only reads already-published static JSON" | `cadc595e`: "The one exception is `fetch_clip`, which asks a local Archilyzer editor for a clip's media: the editor writes it, and the server itself never writes." |
-| L3: nothing pinned the composer changes | `1fcb224d`: `useWithAi === AI_DOC_URL` for site and hub; the two "## Ask AI" lines of each llms.txt; no `use-with-ai` in either |
-| L4: the record's base | This commit: off `main` `2f09b065`, first cut at `2b767bc9` |
-| I1: `window.next.router` is undocumented | This commit: FACTS says so, and to check it first on a Next upgrade |
-| I2: `test.fail` is satisfied by any failure, not only the overflow | Left as ruled; STATE's follow-up drops the line once the changelog wraps |
-| I3: the slices table's DX row described the first ruling | This commit: the row states the amended scope |
-| I4: the primary's `export/.next/{,dev/}types` still name the removed page | The parent's, before the post-merge tsc |
-| I5–I8 | No action here (deploy order: the homepage with or before the sites and hub; README's Windows blocks' `<your-remote>` a follow-up) |
-
-**Follow-ups in `STATE.md`:** `/changelog/`'s overflow (wrap `<code>` in the changelog renderer, then
-drop the `test.fail`); the JSX entity/whitespace sweep (22 texts in 19 files, FACTS).
-
-**Gates after the review** (logs `$T/dx-regate.log`, `$T/dx-e2e4.log`): tsc (all workspaces) clean,
-125 s; common **2,381/2,381** (+1), 166 s; mcp **271/271**, 59 s; homepage `docs.spec.ts` **5
-passed**, 19 s; export `use-with-ai-link.spec.ts` **4 passed**, 12 s; the hub's **3 passed**, 10 s.
-The full suites were not re-run, as the parent directed.
-
-### Slice FK, as shipped — a form that fails keeps what was typed (2026-10-01)
-
-Branch `r16/forms-keep-input` off `main` `57d982bb`, worktree `~/Projects/r12-paths-fix` (editor 5001,
-test 5011, export 5010), one Opus implementer. Scratch files `fk-*` in the job's `tmp`. The ruling
-is above ("Slice FK — the ruling"); the inventory that found the cause is `fk-inventory.md`.
-
-**The cause had three more parts than the inventory found, and the slice fixed all of them** (the
-operator's "fix it everywhere", relayed mid-slice). Measured first in Chromium against
-`react-dom@19.2.4` (a bundled test page, `fk-exp/`), then in the editor itself on `main`'s code with
-a throwaway probe spec (`fk-probe-main.keep.log`), each read at 0 / 0.3 / 1.5 / 7 s after the
-refusal showed:
-
-| Element | On `main` after a submit | Why (react-dom; lines in FACTS) |
-|---|---|---|
-| Uncontrolled text input, textarea, checkbox | back to the stored value, for good | the reset; no action returned what was typed (the inventory's finding) |
-| Uncontrolled `<select>` | back to the option it MOUNTED with, **after a success too**: `cookieMode` saved as `defer` still read `when-required` 7 s later, and a second save would send that | a `defaultValue` change after mount is never applied |
-| A focused number input (Enter submits) | back to its old default | `setDefaultValue` skips a focused number input |
-| Controlled checkbox, radio, select | back to what it mounted with (a select: its server-rendered option, or its first when it mounted on the client) **until the next re-render reaches it**: the workers' Enabled boxes between 0.3 and 1.5 s; a site's accent and membership, the sync form's sweep select, a new channel's platform and handling between 1.5 and 7 s (the auto-refresh, 5 s by default; never, with it off). A named one posts the stale choice if submitted in that window | `defaultChecked` is set only at mount; a controlled select's options never get `defaultSelected` |
-| Controlled text input | kept | React keeps its `defaultValue` in step with `value` |
-
-**What it does.**
-- **`editor/app/lib/formState.ts`** (pure; the actions and the forms both import it): `FormState<T>`
- (`{ ok: true } & T | { ok: false; error; values? }`), `FormErrorState` (the channels flavour,
- `{ error; values? } | undefined`), `formValues(formData)` (each name's first value, files skipped,
- a `__proto__` name kept), and one reading of both flavours — a state is a failure unless it says
- `ok: true` — behind `seedValue` and `seedChecked`. `formState.test.ts`, 8 cases.
-- **Every action that can refuse returns what was submitted**, captured at its top, with every
- refusal, validation and caught failure alike; a success returns what it did: `saveSiteAction`,
- `saveSettingsAction`, the four in `operations/settingsActions.ts`, `saveSchedulerSettingsAction`
- and `setChannelCadencesAction`, `saveHealthTimingsAction`, `saveHomepageConfigAction`,
- `cutReleaseAction`, `saveSavedVideoBackupAction`, `createChannelAction`, `updateChannelAction`,
- `renameChannelAction`, `deleteChannelAction`, `deleteVideoDirAction`. Their result types are
- `FormState<…>` / `FormErrorState`.
-- **`editor/app/components/forms/Field.tsx`: one `Field`.** SiteForm's and ChannelForm's own copies
- were the same label → input → hint with other props (`min`; `placeholder`, `readOnly`, a controlled
- mode); they fold in, and `Field` takes `state`. `SeededInput` (an uncontrolled input seeded from
- `state`; a number input re-mounts when its default changes) and `SeededSelect` (re-mounts whenever
- its default changes). Both key on the default itself. OverviewPanel's `Field` is a read-only
- figure, not an input, and stays.
-- **`editor/app/components/forms/Controlled.tsx`: `ControlledCheck`, `ControlledSelect`** — the bare
- element plus a `reset` listener on its form that puts the latest committed value back a microtask
- after the reset. They touch the DOM at no other time: the first cut wrote the value in a layout
- effect on every commit, mount included, and that overwrote a choice made before hydration
- (`19f8e867`, below).
-- **The forms**, all of the ruling's fifteen: SiteForm (create and edit; the accent radios, the
- membership and group controls are `ControlledCheck`/`ControlledSelect`), SettingsForm,
- ChannelForm (create and edit; create mode's handling radios and platform select are controlled
- and posted), AttributionSettingsForm, DiarizationSettingsForm, DigestSettingsForm,
- LaneSettingsForm, SchedulerSettingsForm, HealthTimingForm, HomepageConfigForm, CutReleaseForm,
- RenameChannelForm, DeleteChannelForm, DeleteVideoDirSection and SavedVideosControls' checkbox. Every
- `defaultValue`/`defaultChecked`/`<select defaultValue>` in them goes through the helpers;
- `state` comes from each form's `useActionState` (ChannelForm's through `ChannelFormClient`).
- - **Shaped differently, and said where it is:** DigestSettingsForm's `digestSections` is one name
- posted once per ticked box, which `values` (first value per name) cannot carry; its boxes are
- controlled (`ControlledCheck`) and re-read from the stored list after a success or a new stored
- list, posting what they always posted. ChannelForm's edit-mode handling radios seed from the
- VALUE posted, not the name's presence.
-- **The shared widgets' checkboxes and selects** (`ae5a212f`, its own commit): the ruling named
- `DurationField`, `SocialLinksField`, `SiteMembershipsSection` and `WorkersField` as the model that
- already survives. Their text inputs do; their checkboxes and selects are the last row of the table
- above. One tag swap each to `ControlledCheck`/`ControlledSelect`, nothing else changed in them.
- `DigestAppsField`, `LocationForm`, `EditorTagsClient`, `BulkCadenceBar` and `ChannelCadenceEditor`
- are untouched (the last two get the fix through `DurationField`).
-- **Inventory check** (the operator's "plus any form the inventory missed"): every
- `defaultValue=`/`defaultChecked=` under `editor/app` is seeded, and every `<form action>` with a
- field was looked at. The one not changed is the Diagnostics stage's **Go to video** (its action
- always redirects; there is no refusal to keep anything through).
-
-**A success path is unchanged except where it was showing the wrong thing:** a select, and a
-controlled checkbox or select, now show what was saved after a save; each used to go back to what
-the page mounted with (the uncontrolled select for good). The `[Unreleased]` bullet says so.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `353f3219` | `editor:` `formState.ts` + test, the one `Field`, `SeededInput`/`SeededSelect`, `Controlled.tsx`; SiteForm and SettingsForm with their actions |
-| `06984433` | `editor:` the other thirteen forms and their actions |
-| `ae5a212f` | `editor:` `DurationField`, `SocialLinksField`, `SiteMembershipsSection`, `WorkersField` — controlled checkboxes and selects |
-| `716f58bb` | `editor(e2e):` `forms-keep-input.spec.ts`, 18 cases |
-| `798cf7ec` | `editor(e2e):` controlled elements read once, as the refusal shows |
-| `19f8e867` | `editor:` `ControlledCheck`/`ControlledSelect` put the value back after the reset only — never at mount |
-| `657a6949` | `plans:` this section; FACTS; the editor changelog |
-| `6cf51b24` | `editor:` review L1 — ChannelForm create's **On create** boxes seed only from a refusal of their own kind; the spec's 19th case; `Controlled.tsx`'s comment (I2) |
-| `0520ec75` | `plans:` review L1's bullet, I1, I2, I3 |
-| `9487c74b` | merge of `main` `458f4fcd` (below) |
-| this commit | `plans:` the review, the gates after it, the merge |
-
-#### Gates (logs `$T/fk-*.log`)
-
-- **tsc** (all workspaces) clean, 46 s, at `19f8e867` — after deleting the worktree's
- `export/.next/dev/types`, left by an earlier slice's dev server and still naming the removed
- `/use-with-ai` page (DX's note).
-- **common:** 2,404/2,404, 78 s (nothing under `common/` changed). **Editor unit:** 109/109 (`main`'s
- 101 + `formState.test.ts`'s 8).
-- **Build:** the capped editor build with the corpus linked (`ln -sT` the primary's `transcripts`,
- `systemd-run --scope -p MemoryMax=5G`, `pnpm --filter editor exec next build`, the link removed
- after): exit 0, 43 s, 1.65 GB peak, at `19f8e867` (48 s, 1.6 GB at `798cf7ec`).
-- **Numbers tool:** none.
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 1 | `716f58bb` | `forms-keep-input` + `sites-crud`, `settings`, `channels`, `storage-locations`, `site-scope` | **75 passed**, 0 failed, 5.2 min |
- | 2 | `main`'s `editor/app` (`57d982bb`), the spec at `716f58bb` | `forms-keep-input` | 17 failed, 1 passed, 3.4 min — the worker list's boxes were re-synced by a re-render inside the polled assertion's 5 s (so run 4) |
- | 3 | `main`'s `editor/app`, then the slice's | a throwaway probe (5 cases, not committed) | the table above (`fk-probe-main.keep.log`); on the slice's code every read is right at every moment (`fk-probe-slice.log`) |
- | 4 | `main`'s `editor/app`, the spec at `798cf7ec` | `forms-keep-input` | **18 failed**, 0 passed, 2.5 min — every case fails on the code before the slice |
- | 5 | `798cf7ec` | the full editor suite | stopped at 203 of 694: `cadence-ui` (3) and `channel-site-membership`'s create case failed — the first `Controlled.tsx` overwrote a choice made before hydration; fixed in `19f8e867` |
- | 6 | `19f8e867` | `forms-keep-input`, `cadence-ui`, `channel-site-membership`, `workers`, `operation-settings`, `saved-videos`, `new-channel-onboarding` + the five the prompt named | **109 passed**, 0 failed, 6.9 min |
- | 7 | `19f8e867` | the full editor suite | **681 passed**, 1 failed, 12 skipped (the rack-audit shots), 38.1 min — `export-search` "Advanced reset does not touch filter checkboxes": its `getByRole('checkbox', { name: 'Deleted' })` also met a result's "Select "Deleted platypus chronicles" for AI" box |
- | 8 | `19f8e867` | `export-search.spec.ts` alone | **19 passed**, 0 failed, 50 s. Nothing under `export/` or `common/` differs from `main`; run 7's failure is that locator's race with the results |
-
-#### Found and left
-
-- **A controlled NUMBER input focused when Enter submits** (`DurationField`'s amount, the number
- boxes in `WorkersField` and `DigestAppsField`) shows its old value after the reset until its next
- change: React writes its `value` on an update but nothing updates it. What posts is from state (a
- hidden input), so nothing saved is wrong. A `ControlledInput` would close it; not built.
-- **An action that throws past its own `try`** (`createChannel` itself, for one) still reaches the
- form as Next's error, not as `{ error, values }`. Every caught failure carries `values`;
- converting the uncaught ones is a behaviour change of its own.
-- **A field not rendered at the submit** is seeded as not posted: a checkbox reads unticked when a
- later render shows it, a text field keeps its initial value. The one place a form switches what it
- renders is ChannelForm create (a social or a video source), and its **On create** boxes seed only
- from a refused submit of their own kind (review L1, below); every other box a social submit leaves
- out starts unticked in create mode anyway.
-- **A seeded select or number input re-mounts when its stored value changes under it** (a save from
- another tab), and an in-progress edit of THAT field is lost; every other field keeps its edit.
- DigestSettingsForm's section boxes do the same: they re-read the stored list whenever it changes
- and the last result was not a refusal, before any submit too, so unsaved ticks give way to another
- tab's save (on `main` a touched box kept its tick).
-- **`ControlledSelect` puts back a value no option has as a blank select** (`selectedIndex` −1);
- React's own update selects the first enabled option instead. Reachable for `WorkersField`'s engine
- select (`row.appId ?? ""`, no `""` option) and a membership whose group was deleted. Visual only:
- both post from state.
-- **The other way to do it**, for the record and not tried: `onReset={(e) => e.preventDefault()}` on
- each action form should cancel React's reset outright, so nothing is wiped and nothing needs seeding, but the
- success path would keep what was typed instead of re-reading the stored values. The ruling chose
- the values contract; this was not built.
-
-#### Decisions the operator could overturn
-
-| What I did | The alternative |
-|---|---|
-| `seedValue` keeps `initial` for a name the failed submit did not carry | The prompt's `values[name] ?? ""`: a disabled or not-yet-rendered field would go blank (the ruling's "else from the initial value" read per field) |
-| Fixed the controlled checkboxes/selects too, including in the four widgets the ruling named as the model (`ae5a212f`, revertable alone) | Leave them: their desync lasts until the next re-render, and the unnamed ones post from state |
-| `SeededSelect` re-mounts on every change of its default, a success included | Re-mount only out of a failure: the select would keep showing its mount-time option after a plain save |
-| DigestSettingsForm's sections controlled | Extend `FormValues` to carry every value of a repeated name |
-| The e2e refuses the settings-only forms by putting a directory at `test-settings.json` | A test-only failure switch in `saveSettings` behind `/api/test/*` |
-
-#### Review
-
-**Verdict: SHIP** (`fk-review.md` in the job's scratch): one Low, five infos.
-
-| Finding | Where |
-|---|---|
-| L1: in ChannelForm create, after a refusal from one kind of source (video or social), switching the URL to the other kind mounted that kind's **On create** box seeded from `values`, where its name was absent, so unticked; on `main` it mounted ticked | `6cf51b24`: `fetchPostsNow` seeds only from a refused social submit (it posts the hidden `sourceKind=social`), `fetchPlaylist` and `prioritizeDownload` only from a refused video one. A 19th case refuses a video submit and switches to a social URL (**Fetch posts now** ticked), and the reverse; against `657a6949`'s ChannelForm it fails ("Received: unchecked") |
-| I1: the digest section boxes re-read a new stored list before any submit too, so another tab's save replaces unsaved ticks | `0520ec75`: added to the cross-tab bullet in "Found and left" |
-| I2: a controlled select never gets `defaultSelected` (mount passes `false` too, `:22121`); the reset selects the server-rendered option, or the first for a client-mounted select — not "what it mounted with" | `6cf51b24` (`Controlled.tsx`'s comment), `0520ec75` (FACTS, the table above) |
-| I3: `putValue` leaves a blank select for a value no option has | `0520ec75`: recorded in "Found and left" |
-| I4: the microtask deferral relies on React's script-initiated reset; a native `<button type="reset">` would undo the put (the editor has none) | No action |
-| I5: the full suite's `export-search` failure is pre-existing — `{ name: 'Deleted' }` matches by substring the result card's "Select "Deleted platypus chronicles" for AI" box (since `9a5029ec`) | No action here; `{ exact: true }` in six places is a follow-up |
-
-#### Brought to main (2026-10-01)
-
-`9487c74b` merges `main` `458f4fcd` (the deck's posts: `umtool/` only, plus `plans/` and two
-`[Unreleased]` bullets) into `0520ec75`. No conflict. `editor/CHANGELOG.md` keeps one
-`## [Unreleased]`: the deck's two bullets at its top, this slice's at its end. `plans/release-16.md`
-keeps both sides: `main`'s deploy note under "## Rollout" and this section with the slices table's
-FK row.
-
-**Gates after the review and the merge** (at `9487c74b`; logs `$T/fk-tsc3.log`, `fk-unit3.log`,
-`fk-build3.log`, `fk-e2e3.log`): tsc (all workspaces) clean, 34 s; editor unit **109/109**
-(`formState.test.ts` alone 8/8); the capped editor build with the corpus linked exit 0, 37 s,
-1.66 GB, the link removed; e2e `forms-keep-input`, `channels`, `channel-site-membership`,
-`new-channel-onboarding`, `social-channel`, `sites-crud`, `settings`: **70 passed**, 0 failed,
-5.6 min. The full suite was not re-run, as the parent directed.
-
-### Slice RM, as shipped — a move holds the channel's writers and mirrors its copy (2026-10-01)
-
-Branch `r16/move-holds-writers` off `main` `2e2f6b2a` (the ruling's remediation bullet merged in from
-`9cec5be6`, a fast-forward), worktree `~/Projects/plans-export-header-first-search` (editor 4201,
-test 4211, export 4210 — `pnpm wt list`'s block #12), one Opus implementer. Scratch files `rm-*` in
-the job's `tmp`. The ruling is above ("Slice RM — the ruling").
-
-**Which writer got past the guard on 2026-09-30** (the job metas and logs in `transcripts/.jobs/`
-and `realcandaceo/data/v50t5yt/transcribe-outcome.json`, read only). Not a lane: the lanes skip a
-channel with a marker twice over (the projection's media check and the pick→run backstop), and both
-held. It was a manual **Transcribe all** (`whisper-all`, job `01M3TGYDXA7WCBGN014A90J3JW`, the scan
-over the channel's 434 items):
-
-| When | What |
-|---|---|
-| 21:16:42 | The move (`01M3TGHZSMQHHYXH44ATXXFKSQ`) is queued; the action's busy check finds nothing running |
-| 21:23:30 | Transcribe all is queued and starts. No marker exists yet, so its media guard passes — correctly |
-| ≈21:25:37 | Its transcription of `v50t5yt` begins (749.78 s); parakeet's scratch dir `.audio.mp3.parakeet/` fills window by window |
-| 21:36:28 | The move starts, after twenty minutes behind other moves on the one relocation queue. It asks nothing about the channel's jobs, writes the marker and copies — the scratch dir (meta + four windows) included |
-| 21:38:06–07 | `v50t5yt`'s transcript, cues and outcome land, after rsync had passed the directory; the scratch dir is deleted from the source |
-| 22:02:37 | The verify refuses: four paths differ. The marker stays (phase copy) |
-| 22:40, 23:13, 23:21 | The batch keeps writing with the marker standing — `v511otv`, `v519k6c`, `v51fpcd`'s scratch — until cancelled at 23:29:44 |
-| 2026-10-01 10:17 | The resume copies the new files and refuses on the counts, 1755 against 1750: the five scratch files on the destination, which a copy that never deletes could not settle |
-
-So three things let it through, and the slice closes each: the move asked about the channel's jobs
-only when it was enqueued; a job's media guard ran only at enqueue, never when its queue started it
-(and its per-video loop never re-asks); and seven per-video writers were not in `JOB_KINDS` at all,
-so they were never refused for a moving channel.
-
-**What it does.**
-- **A move refuses to start over a writer, and names it.** `common/controller/channelWriters.ts`
- (new) reads who is writing into a channel: running registry jobs on its slug (queued ones too for the
- editor's courtesy check) and every lane's in-flight units for it; a lane's download unit, which is
- also a registry job, is named once. The refusal: `Cannot move the media of "realcandaceo" now: a
- transcription of v50t5yt is running (Transcribe all, job 01M3…) — wait for it or cancel it. Nothing
- has been touched.` (a lane unit: "wait for it, or hold the transcription lane"). Asked by
- `previewRelocation`, by the job's first step, and a third time the moment the copy phase's marker is
- written — after which the lanes skip the channel and a media job refuses to start, so that answer
- cannot go stale; a refusal there removes a marker this run created. A job that has been cancelled
- but whose function has not returned yet still counts ("is stopping — wait for it to stop"): the
- registry stamps `endedAt` on a cancelled-while-running job only when it has actually stopped
- (`registry.finalize`, and `forceRelease` for one never finalized). The editor's
- `channelMediaBusyReason` (the panel's blocked message, rename, delete, the bulk move's skips) reads
- the same list and appends `Now: <the first writer>.` to its counts.
-- **The writers are held while the marker stands.** A media job's guard (`needsMedia`) is asked again
- when its queue starts it (`jobs/streamCommand.ts`), so a job queued before a move and started during
- it fails before it runs, in the hold's words: `Channel "x" is held: its media is moving (a move is in
- progress or was interrupted) — …`. `whisper-video`, `transcribe-one`, `download-one-pipeline`,
- `transcode-audio`, `check-availability`, `quick-availability-check` and `check-maybe-missing` now
- declare `needsMedia` (labels still absent, so `/jobs` shows them as before). The lanes skip on
- `isMediaHeld`, logging the hold's sentence. `HELD_REASON["in-transition"]` leads with "its media is
- moving", and `mediaHoldText` is the one wording: the rack's **media held** chip in the Tier cell
- (`aria-label="media hold for <slug>"`, the sentence on `title`) and the Storage panel's "Held: its
- media is moving (…). The lanes skip this channel and its media jobs refuse to start until the hold
- lifts — when the move completes, or its marker is cleared below." Both go with the marker.
-- **The copy mirrors, toward the destination only.** `relocateDir.ts`'s `copyMirrorVerify` is the copy
- phase for both movers and both directions: the progress copy, then `rsync -a --delete` source → the
- copy under construction, then a verify whose dry run carries `--delete` plus equal counts. One
- change seen between the mirror and the check gets one more mirror pass; a second refuses with the
- paths by kind — extra on the destination, missing on the destination, changed — and "Something is
- still writing into <src>: stop it, then Reconcile and resume." The mirror runs with `--info=del`,
- so every file it removes is a `deleting <path>` line in the job log. **What the direction guard
- proves** (`assertMirrorDirection`, asked by `copyMirrorVerify` before its first rsync and by
- `mirrorTree`): the destination's real path is not the live media's, does not contain it and is not
- inside it — `live` being what the caller knows is live, `channels/<slug>/data` resolved through its
- link (so the relocated target on the way back) or the saved-video store, never derived from `src`
- or `dest`; and the source and destination do not contain one another. A call with the two swapped
- is refused with nothing spawned, in either direction. A resume takes the same path, so the
- realcandaceo leftovers are mirrored away. A swap-phase re-verify mirrors only while `data/` is still the live directory; against
- a parked `data.relocated-*` it stays the strict verify, so the target is never mirrored from a copy
- that is no longer live.
-- **Reconcile and resume** (the remediation bullet): a button beside **Resume move**, with its own log
- ("Reconcile and resume output"), offered under Resume's condition (a marker, nothing running). One
- relocation job with `reconcile`: no copy pass; it lists how the destination differs from the source
- by kind ("Reconciling: the destination copy differs from the source — 2 extra on the destination
- (…), 0 missing on the destination, 2 changed (…)"), mirrors (the progress bar rides the mirror
- pass), verifies, swaps and reclaims; the done line says "(reconciled and resumed an interrupted
- move)" — only when the copy phase ran as a reconcile (`result.reconciled`): a marker already past the
- copy phase has nothing to reconcile, and that run says "(resumed …)". Without a marker it refuses.
-- **The saved-video store's move shares the pipeline** — `relocateSavedVideos` uses
- `copyMirrorVerify` both ways and mirrors its swap re-verify while the store is still a real
- directory — and takes a `busy` first step, which the editor's job fills with the store check
- (`savedVideosStoreBusyReason(…, { runningOnly: true })`: by then a merely queued download is not
- writing, and its persist is refused by the marker anyway). It has no Reconcile button; its Resume
- mirrors.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `50fc580c` | `common:` `channelWriters.ts` + test; the mirror, the direction assertion, `copyMirrorVerify`, the verify by kind (`relocateDir.ts` + test); both movers (`reconcile`, `writers`, `busy`) + tests; the start-time media guard + test; seven `needsMedia` kinds; the hold's words, the lanes' skip + test; `ChannelRowView.mediaHold` |
-| `1c5b9739` | `editor:` the Storage panel's hold line and Reconcile and resume; the rack's chip; `mediaBusy` names the writer; the store job's first step |
-| `0ee291f9` | `editor(e2e):` `channel-storage.spec.ts` — three new cases and Resume extended (below); `/api/test/stuck-job` takes `slug` and `task` |
-| `05383fe6` | `plans:` this section, the slices table's RM row; FACTS; the editor changelog |
-| `f9dcf2d4` | `common, editor:` the review's fixes — M1 the guard checks the live media the caller names; L1 `--info=del` and the preview's partial-copy line; L2 a cancelled job counts until it has stopped (`registry.finalize`/`forceRelease` stamp `endedAt`); L3 `reconciled` on the result; tests and one e2e case |
-| `01de2613` | `editor:` the changelog bullet — the fixes, and a made-up video id in its example (N3) |
-| `3cc7a5da` | merge of `main` `a2229d68` (plans only: slice XL's ruling) — the slices table keeps both rows |
-| this commit | `plans:` the review, its fixes and the gates after them |
-
-#### Gates (logs `$T/rm-*.log`)
-
-- **tsc** (all workspaces) clean at `0ee291f9`, after deleting the worktree's stale
- `export/.next/{dev/,}types` (still naming the removed `/use-with-ai` page, DX's note).
-- **common:** **2,432/2,432**, 78 s (`main`'s 2,404 + 28) — new: `channelWriters.test.ts` 7, `relocateDir.test.ts` +8 (the
- mirror carries a file added after the copy pass and removes one deleted after it; the realcandaceo
- stale dir; one change → one more pass; a second → refused by kind; reconcile lists then mirrors;
- the `--delete` direction refused before rsync spawns; the itemize classifier),
- `relocateChannelMedia.test.ts` 39 (two old cases re-premised, below; +9: a stray file mirrored
- away, the strict parked re-verify, the refusal over a running job, the preview's, a writer seen
- under the marker, a resume over a stale scratch dir, the same coming back, reconcile, reconcile
- without a marker),
- `relocateSavedVideos.test.ts` +2, `streamCommand.test.ts` +1 (a media job queued before the marker
- refuses at its start), `autoRunner.test.ts` +1 (every lane projects nothing for a marked channel and
- the hold lifts with the marker). **Editor unit:** 109/109. **test:scripts:** 302 passed, 2 skipped
- (304).
-- **Build:** the capped editor build with the corpus linked (`ln -sT` the primary's `transcripts`,
- `systemd-run --scope -p MemoryMax=5G`, `pnpm --filter editor exec next build`, the link removed
- after): exit 0, 47 s, 1.68 GB peak, at `0ee291f9`.
-- **Numbers tool:** none.
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 1 | `0ee291f9` | `channel-storage`, `storage-locations`, `channels-storage-columns`, `channels`, `channel-rename`, `ops-api`, `channel-priority`, `channels-rack-layers`, `saved-videos`, `review` (which also matched `site-publish-preview`), `fetch-window` | **88 passed**, 1 failed, 6.9 min — `channel-rename` "rename and delete refuse while a job is writing": **Delete channel** was disabled when clicked (below) |
- | 2 | `0ee291f9` | `channel-rename` × 4 | **8 passed**, 0 failed, 49 s |
- | 3 | `0ee291f9` | the full editor suite | **683 passed**, 3 failed, 12 skipped (the rack-audit shots), 51.8 min — `jobs-channel` "auto-refreshes the jobs list": every button on the Playlist stage still disabled after 30 s (the page never hydrated); `perf-budget` "the dashboard renders within budget": `resetData` met `EEXIST` making `test-transcripts/channels` (the fixture race helpers.ts describes); `widget` "+N more expands": `ERR_CONNECTION_REFUSED` — the log's one `[WebServer] ⚠ Server is approaching the used memory threshold, restarting...` landed on it |
- | 4 | `0ee291f9` | `jobs-channel`, `perf-budget`, `widget` | **34 passed**, 0 failed, 1.4 min (after ~4 min waiting for the queue). None of the three touches what the slice changed beyond the shared job start |
-
- Three new `channel-storage` cases and one extended: **a move that starts while a job writes into the channel
- refuses, naming the job** (the 2026-09-30 shape: a stuck job holds the relocation queue for 4 s, the
- move goes in through `/api/ops/relocate`, a fake running Transcribe all on the channel's video
- appears, the move starts and fails with the exact sentence; no marker, no copy; the panel's blocked
- message names the writer); **the rack and the Storage panel show the hold while a marker stands, and
- it lifts with it** (Clear marker); **Resume move** extended with a planted stale scratch dir on the
- destination, gone after the resume; **Reconcile and resume settles an extra and a changed file on
- the destination**.
-
-#### Found and left
-
-- **Run 1's `channel-rename` failure is that spec's race with the page's own refresh**, not this
- slice: the spec renders the Danger zone while the channel is quiet, starts a sync out of band, and
- submits Rename then Delete from the stale page. The sync's start moves the pulse token, and when the
- next pulse tick (every 5 s) lands between the two submits, the refreshed page renders Delete
- disabled with the busy reason (`error-context.md` shows both forms blocked, the reasons naming the
- sync). 8/8 on the rerun. Not changed: the spec is not this slice's.
-- **The two existing tests whose premise the ruling reversed**, re-premised: "a verify failure keeps
- the source…" planted a stray file on the target and expected a refusal — now the mirror removes it
- (that case is "a stray file on the destination is removed by the mirror pass"), and the refusal case
- is a source that keeps changing; "out @ swap: a file the target is missing is still a refusal" is now
- "… is mirrored by one more pass".
-- **Corpus-wide writers carry no slug**, so the move's check cannot name them: a corpus-wide Normalize
- or Evict already inside a channel when its move starts is not refused. Both re-ask the hold per
- channel, and a write that lands mid-copy is carried by the mirror (or refused by kind if it keeps
- landing).
-- **Kinds still outside `JOB_KINDS` with a slug:** `worker-transcribe` / `worker-unit` (this box as a
- worker, writing into a scratch dir or another machine's mount), `refresh-report` (it asserts
- reachability itself), and the slug-less `normalize-live-chat` / `archive-*`.
-- ~~A lane tick that inspected the channel just before the marker landed can dispatch a unit after
- the third ask.~~ **Closed, by ordering** (the review's trace): a unit is in `inFlight` before the
- pick→run backstop reads the marker, so a unit the third ask missed reads the marker itself; and a
- job is marked running before its start-time guard reads the marker.
-- **A resumed or reconciled move-out is charged the whole tree against the destination's free space**,
- not what is still missing (the move back charges the remainder). Unchanged; a near-full destination
- can refuse a resume it has room for.
-- **A server action that writes into a video's directory without a job** (the video page's edits) is
- not held by the marker; the mirror carries its write.
-
-#### Decisions the operator could overturn
-
-| What I did | The alternative |
-|---|---|
-| The move's own check refuses over RUNNING jobs and lane units; a QUEUED media job is refused when it starts instead | Refuse the move over queued jobs too (the editor's enqueue-time check does): the operator re-queues the move after a twenty-minute wait for a job that would not have written yet |
-| A third ask right after the marker is written, removing a marker the run created | The first step only; a job that starts while a big tree is measured would be copied over |
-| The swap-phase re-verify mirrors while `data/` is live, never from a parked copy | Mirror from the parked copy too: it would delete from the target what was written through the link after the swap |
-| The Storage panel's busy message keeps its counts and adds `Now: <writer>.` | Replace the counts with the named writer (the `ops-api` spec pins the counts' wording) |
-| The rack's hold is a chip in the Tier cell, shown for every held status (unreachable, stalled and inconsistent too: the lanes skip all of them) | Only for a moving channel, as the ruling's sentence names |
-| Reconcile and resume skips the progress copy and lets the mirror pass carry the bar | Run the copy pass first, as Resume does — the same bytes either way |
-
-#### Review
-
-**Verdict: SHIP AFTER FIXES** (`rm-review.md` in the job's scratch): one Medium, three Lows, three
-notes. Every `--delete` was traced and found pointed the right way; the fixes are what the guard and
-the wording promise.
-
-| Finding | Where |
-|---|---|
-| M1: half the `--delete` direction check could not fail — every caller set `underConstruction` to `dest`, so "dest equals the copy under construction" held by construction, and a swap across two volumes would have passed the nesting check | `f9dcf2d4`: `assertMirrorDirection` takes `live` from the caller (`channels/<slug>/data` through its link, or the store) and refuses a destination whose realpath is, contains or sits inside it; `copyMirrorVerify` asks before its first rsync. Tests: swapped across two roots, out and back, nothing spawned; a destination inside and one containing the live media; the containment check kept |
-| L1: the mirror's removals were not logged, and the preview did not say a pre-existing copy loses files | `f9dcf2d4`: `--info=del` on `MIRROR_ARGS` (a test reads the `deleting` line); the partial-copy line adds "files there that the channel no longer has are removed from that copy (never from the channel)" |
-| L2: a job cancelled but still winding down was not a writer | `f9dcf2d4`: `registry.finalize` stamps `endedAt` on a cancelled-while-running job when it actually stops (`forceRelease` on one never finalized); `channelWriters` counts "cancelled, no `endedAt`" as "stopping — wait for it to stop". Unit (injected and through the live registry) and e2e ("a job cancelled but still stopping holds the move until it has stopped", the stuck-job route cancelled from `/jobs`) |
-| L3: Reconcile on a marker past the copy phase said "reconciled" | `f9dcf2d4`: `RelocateChannelMediaResult.reconciled`; the done line says "resumed" otherwise; a unit test on a swap-phase marker |
-| N1: "four new" cases — three are new, Resume was extended | This commit |
-| N2: any running job on the slug refuses a move, `refresh-report` included | No action (errs safe) |
-| N3: the changelog's example quoted a real video id | `01de2613`: a made-up id |
-
-The review also traced the race "Found and left" listed (a lane tick dispatching after the third
-ask) and found it closed by ordering; that item is struck above.
-
-#### Gates after the review and the merge (at `3cc7a5da`; logs `$T/rm-*2.log`, `rm-tsc3.log`, `rm-e2e5.log`)
-
-- **tsc** (all workspaces) clean, 52 s. **common:** **2,438/2,438**, 94 s (+6: three direction
- tests in place of one, the mirror's logged removal, two stopping-writer tests, the reconcile past
- the copy phase). **Editor unit:** 109/109. **test:scripts:** 302 passed, 2 skipped.
-- **Build:** the capped editor build with the corpus linked: exit 0, 63 s, 1.67 GB, the link removed.
-- **e2e** (after ~1.5 min waiting for the queue):
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 5 | `3cc7a5da` | `channel-storage` (13, the stopping case included), `storage-locations`, `channels-storage-columns` | **24 passed**, 1 failed, 5.4 min — `storage-locations` "a volume that came up somewhere else is re-pointed": the first step's `clickUntil` on **Refresh** never saw the volume's identity written to settings in 30 s (the page showed the probe's identity; the action's write did not land). Nothing in that step is the slice's |
- | 6 | `3cc7a5da` | `storage-locations` × 2 | **18 passed**, 0 failed, 2.0 min |
-
-### Slice XL, as shipped — connecting an X account works (2026-10-01)
-
-Branch `r16/x-login` off `main` `a2229d68`, worktree `~/Projects/r12-source-mirror` (editor 5101,
-test 5111, export 5110), one Opus implementer. Scratch files `xl-*` in the job's `tmp`; the
-measurements behind the launch options are `xl-exp/` (two probe scripts, their screenshots, and a
-smoke of the slice's own modules). The ruling is above ("Slice XL — the ruling").
-
-**Measured first** — Playwright 1.59.1 driving system Chromium 153 and the bundled build, headed
-under Xvfb (never on the operator's display) and headless, on scratch profiles; no page ever
-loaded x.com or Google:
-
-| Launch | `navigator.webdriver` | The window's bar |
-|---|---|---|
-| Playwright's defaults, system Chromium | true | "Chrome is being controlled by automated test software" |
-| `ignoreDefaultArgs: ["--enable-automation"]`, sandbox on | **true** — the debugging pipe sets it | none |
-| + `--disable-blink-features=AutomationControlled`, Playwright's `--no-sandbox` | false | "You are using an unsupported command-line flag: --no-sandbox" |
-| the same, sandbox on | false | "… unsupported command-line flag: --disable-blink-features=AutomationControlled" |
-| + `--test-type` | false | none |
-| the bundled Chrome for Testing, the same options, sandbox on or off | false | none |
-
-So the blink flag is what turns `navigator.webdriver` off, and `--test-type` plus the sandbox is
-what keeps a system Chrome's window free of a warning bar. **The bundled build is chromium-1217,
-Chrome for Testing 147** (`playwright-core@1.59.1`'s `browsers.json`), not the cache's
-chromium-1234 (151), which this Playwright does not use. **A profile written by system Chromium 153
-opens in the bundled headless shell 147 with its cookies readable** (a cookie added in 153, read back
-by value in 147; `Last Version` stays 153; 153 re-opens it after), so the refresh keeps the bundled
-build and the recorded executable is a fallback, not the common path.
-
-**What it does.**
-- **The Connect window is the operator's own browser without the automation signals**
- (`common/social/xBrowser.ts`, used by `connectXAccount`): `ARCHILYZER_X_BROWSER` (a path or a name
- on PATH; one that is not an executable refuses the connect — it never opens another browser),
- else the first of `chromium`, `google-chrome`, `google-chrome-stable`, `chrome` on PATH, else the
- bundled Chromium. One pure options builder, `buildXBrowserLaunchOptions`:
- `ignoreDefaultArgs: ["--enable-automation"]` only (never `true`: that would drop
- `--password-store=basic` and a system Chromium would encrypt the profile's cookies with the desktop
- keyring's key, unreadable by the bundled refresh), `--disable-blink-features=AutomationControlled`,
- `--test-type`, the sandbox on for the headed window (retried without it, and logged, when the host
- cannot start one). Connect logs the browser (`[x-session] Opening Chromium 153.0.8010.47 Arch
- Linux at /usr/bin/chromium (found on PATH). …`) and writes it into the profile
- (`archilyzer-browser.json`); its success note names it.
-- **The profile opens headless the same way for the refresh and the Playwright fallback fetcher**
- (`launchXProfile`, and the refresh's own pass): the bundled build with the same signals dropped,
- the recorded executable when the bundled launch throws. **The refresh never replaces a logged-in jar
- with one without a login** (the review's L4): a bundled read with no `auth_token` while the jar holds
- one is read again with the recorded executable, and when no read finds the login the jar is kept
- and the refresh refuses, saying so ("…the logged-in cookie jar exported <when> was kept, not
- replaced…").
-- **The login source, `social.x.cookieSource`** (`common/social/xCookieSource.ts`, pure; the one new
- settings key, `SETTINGS.md` and `settings.json.example` regenerated): `"browser"` | `"profile"`,
- absent by default and **resolved at read time** — `"browser"` when `cookiesFromBrowser` is set and
- no profile is connected (no exported jar carrying an `auth_token`), else `"profile"`. `fetchPosts`
- resolves it per channel (the channel's own `cookiesFromBrowser` over the global) and hands the X
- fetchers `cookieSource` and `browserCookies` (`PostFetchInput`, `common/social/fetchers.ts`).
- **The source, not `cookieMode`, governs X**: the browser spec is passed whatever the mode.
- - **gallery-dl** (`galleryDlCookieChoice`, pure): browser → `--cookies-from-browser <spec>` verbatim
- (gallery-dl's `BROWSER[/DOMAIN][+KEYRING][:PROFILE][::CONTAINER]`), never the jar, fresh on every
- run; browser with no spec → a guest run that says why; profile → the jar, else the
- `"always"`-mode spec, else a guest (the order before the choice existed). The job log names the
- source each run.
- - **The Playwright fallback**: browser → a fresh headless context carrying the cookies
- `xCookiesFromBrowser` reads now; a browser it cannot read refuses by name instead of running
- logged out. Profile → `launchXProfile`, as before.
- - **Nitter** uses no X login and is unchanged.
-- **`xCookiesFromBrowser(spec)` and `readXLoginStatus(paths, settings)`**
- (`common/social/xBrowserLogin.ts`). The read takes the resolved SPEC, not the settings, so a
- channel's own `cookiesFromBrowser` holds. **Firefox only, read-only**: the store is found much as
- gallery-dl finds it (a profile path or name, else the most recently modified `cookies.sqlite` under
- the Firefox roots), `cookies.sqlite` and its `-wal` are copied into a private `mkdtemp` dir, X's rows
- alone are selected, the copies are removed. **It reads what gallery-dl reads** (the review's M1, L3):
- the container as gallery-dl reads it — no `::CONTAINER` (or `::none`) is only the cookies outside
- every container, `::all` is every container, `::NAME` one container matched as gallery-dl matches —
- and a login counts only as an `auth_token` on x.com. Two views of one copy: with the WAL (what
- Firefox holds now; the Playwright fallback uses it) and the main file alone (what gallery-dl's
- immutable open sees). **Chromium's encrypted store is not read here** — gallery-dl (and yt-dlp) read
- it; for such a spec the Check and the fallback say so. The status: the source in use and whether it
- was chosen, whether an `auth_token` for x.com is visible (`null` when the source cannot be read), and
- when it was last seen — the browser's own `lastAccessed` for that cookie, or the jar's export time
- for the profile; and, for the browser, three plain lines when they apply: the login is in Firefox's
- write-ahead log only ("Seen in Firefox's write-ahead log only; gallery-dl will see it after Firefox
- checkpoints (closing Firefox does it)."), an old-domain cookie (a twitter.com `auth_token`) is
- present and not used, and an x.com login sits only in a container the spec does not read.
- `node:sqlite` is loaded at run time (`common/social/nodeSqlite.ts`).
-- **The Settings section** (`XSessionSection.tsx`, `xSessionActions.ts`, `settings/page.tsx`): the
- intro names the two sources; a **Login source** select (Automatic — now: …, Browser login,
- Connected profile) saved on change through `saveSettings` (Automatic stores `social.x` empty); the
- source in use; **Check**, whose result is one line; the Connect text says the window is the
- operator's own browser, that Google's sign-in may still refuse an embedded browser, and that X's
- password login is the reliable path. Every session action also returns the source in use
- (connecting or forgetting a profile can move the default).
-- `ARCHILYZER_X_BROWSER` is declared in `common/lib/envVars.ts` (runtime) and `ENVIRONMENT.md`
- regenerated.
-
-**New accessible names (contracts from here on):** `x cookie source` (the select — `getByLabel`
-needs `{ exact: true }`, the next one contains it), `x cookie source in use`, `check x login`,
-`x login status`. Unchanged: `x session state`, `connect x account`, `refresh x cookies`,
-`clear x session`, the `data-x-session` hook and the `role="status"` / `role="alert"` lines.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `cfb6dd10` | `common:` the Connect browser and its options, the login source, the browser-login reader and status, the fetchers, the `social` settings block; SETTINGS.md, settings.json.example, ENVIRONMENT.md |
-| `a266b18a` | `editor:` the X account session's source select, Check and Connect text; the actions; `x-session.spec.ts` |
-| `f295c263` | `plans:` this section; FACTS; the editor changelog |
-| `457f5961` | `plans:` the e2e run |
-| `b3ee652b` | `common:` the review's fixes — M1 (gallery-dl's containers), L1 (the WAL-only line), L3 (x.com-only logins), L4 (the refresh keeps a logged-in jar; `xSessionBroker.test.ts`), I1 (the `--test-type` wording) |
-| `9275ec44` | `plans:` the review, its record and FACTS lines, the gates after it |
-| `86b48d6b` | merge of `main` `ae23a695` (slice RM) |
-| this commit | `plans:` the re-review, the merge, the gates after it |
-
-#### Gates (logs `$T/xl-*.log`)
-
-- **tsc** (all workspaces) clean, 126 s, at `a266b18a`'s tree — after deleting the worktree's stale
- `export/.next/types` (an old build's, still naming the removed `/use-with-ai` page).
-- **common:** 2,439/2,439, 113 s — the new `xBrowser.test.ts` (9), `xCookieSource.test.ts` (7),
- `xBrowserLogin.test.ts` (11), `xGalleryDlFetcher.test.ts` (7) and one more `settingsSchema` case;
- `settingsDocs`, `envVars` (both generated files) and `architecture` green.
- `archilyzer docs files --check` clean. **Editor unit:** 109/109 (unchanged).
-- **Build:** the capped editor build with the corpus linked (the worktree's own `transcripts/` set
- aside, `ln -sT` the primary's, `systemd-run --scope -p MemoryMax=5G`, `pnpm --filter editor exec
- next build`, the link removed and the directory put back): exit 0, 73 s, 1.64 GB peak RSS.
-- **Smoke of the slice's modules** (`xl-exp/smoke.mts`, under Xvfb, a scratch corpus, no
- navigation): `findXBrowser` picked `/usr/bin/chromium`; the Connect options gave
- `navigator.webdriver === false`; the record was written; `launchXProfile` opened the profile with
- the bundled headless build and read the cookie back by value, `navigator.webdriver === false`.
-- **Numbers tool:** none.
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 1 | `a266b18a` | `x-session`, `settings`, `cookies-mode`, `forms-keep-input`, `social-channel`, `social-fetcher-picker` | **46 passed**, 0 failed, 3.7 min (after 25 min in the queue behind RM's full suite) |
-
-**Not tested, and cannot be here:** a real Google or X login in the Connect window, and gallery-dl
-or the fallback against x.com — the suite never loads X, and no test reads a real browser profile.
-The operator verifies by hand after the restart (below).
-
-#### Found and left
-
-- **Google may still refuse.** The debugging pipe Playwright drives the window through is still
- there, and a sign-in page can look for more than `navigator.webdriver`. The section says so and
- points at X's password login.
-- **The headless paths still say `HeadlessChrome`** in their user agent (the refresh and the
- Playwright fallback); only `navigator.webdriver` is off there.
-- **Chromium-family specs are read by gallery-dl only.** With `cookiesFromBrowser` naming chrome or
- chromium, the browser source works for gallery-dl; the Check reports "cannot be read here" (`null`,
- not "no login") and the Playwright fallback refuses. Reading Chromium's store would mean the
- keyring decryption gallery-dl and yt-dlp already carry.
-- **The default reads "connected" as "an exported jar with an auth_token".** A profile that is
- logged in but has never exported (Connect closed before the jar was written) counts as not
- connected, so the default stays on the browser until a refresh or a connect writes the jar.
-- **The ExperimentalWarning for `node:sqlite`** prints once per editor process, the first time the
- Check or the fallback reads a browser store.
-- **Not run against the operator's own Firefox.** No run read a real browser profile, so whether
- `firefox` resolves to the profile the operator logs in to X with (the most recently used one) is
- the first thing the Check shows after the restart.
-- **Store discovery is close to gallery-dl's, not identical** (review L2). gallery-dl also honours
- `$XDG_CONFIG_HOME` and a second Flatpak root (`~/.var/app/org.mozilla.firefox/config/mozilla/firefox`),
- and for a profile NAME it takes the first root holding `<name>/cookies.sqlite` where this reader
- takes the newest across roots. On a stock Linux Firefox (one root in use) both pick the same store.
-- **From the restart on, every X fetch runs as the operator's own X account** (review I2): the live
- `settings.json` has `cookiesFromBrowser: "firefox"`, no `social` key and no exported jar, so the
- default is the browser and every X fetch, scheduled syncs included, runs logged in as the everyday
- account with no click. As ruled; the operator's steps below say it.
-- **gallery-dl is handed the whole spec** (review I3): `--cookies-from-browser firefox`, with no
- `/DOMAIN`, loads every cookie outside a container from the operator's Firefox into gallery-dl's
- process (it sends only X's to X). Giving gallery-dl's argv alone `firefox/.x.com…` would narrow it;
- not done.
-- **A checkpoint between the two copies** (review I4): the db is copied before its WAL, so a
- checkpoint and WAL reset in that instant can pair them wrongly — an "unreadable" result, reported as
- such, or a stale view. Rare; no retry was added.
-- **The whole `cookies.sqlite` sits in a private temp dir during a read** (review I5): every site's
- rows, mode 0700 under `os.tmpdir()`, removed in a `finally`; only a hard kill leaves it behind.
-
-#### Decisions the operator could overturn
-
-| What I did | The alternative |
-|---|---|
-| `--test-type` in the launch args and the sandbox on for the headed window, so a system Chrome draws no warning bar. `--test-type` is Chromium's internal test-harness switch that skips the startup bars, not the documented route (the machine-wide `CommandLineFlagSecurityWarningsEnabled` policy); it sets no automation signal (measured in review). ChromeDriver passes `--test-type=webdriver`; the bare switch is used | The ruling's two flags alone: the window shows "unsupported command-line flag" for the blink flag (or for `--no-sandbox`) |
-| The refresh and the fallback drop the same signals headless (`launchXProfile`) | Leave them on Playwright's defaults; the ruling named only the Connect window |
-| `ARCHILYZER_X_BROWSER` is a runtime variable read in `xBrowser.ts` | A `paths` entry in `getPaths()` beside `GALLERY_DL_BIN` (it would add a field every `Paths` literal must carry) |
-| "Automatic" is a third option in the select, storing nothing | Two options only: the read-time default would apply until the first choice and never again |
-| The browser source passes the spec whatever `cookieMode` says | Gate it on `cookieMode` like yt-dlp's cookies (`defer` would then run X as a guest) |
-| The browser source's Playwright fallback refuses a browser it cannot read | Fall back to the profile, or run logged out |
-| `xCookiesFromBrowser(spec)` takes the resolved spec | The prompt's `(paths, settings)`: a channel's own `cookiesFromBrowser` would be ignored |
-
-#### After the restart, by hand (the operator)
-
-0. **Every X fetch, scheduled syncs included, runs as your own account from now on** — your
- everyday Firefox's X login, with no click (the default with `cookiesFromBrowser: "firefox"` and no
- connected profile). If that is not wanted, choose **Connected profile** on `/settings` straight
- after the restart, before the next scheduled X sync.
-1. `/settings` → X account session: **In use** should read `Browser login (firefox) (automatic)`
- (the live `settings.json` has `cookiesFromBrowser: "firefox"` and no exported jar). **Check**: an
- X login visible in firefox, outside its containers, with when its `auth_token` was last used. If it
- says none, log in to x.com in that Firefox profile (not in a container — or set
- `cookiesFromBrowser` to `firefox::<container>`) and Check again. If it says "Seen in Firefox's
- write-ahead log only", gallery-dl will not see the login until Firefox checkpoints: close Firefox
- once (or wait), then Check again before step 2.
-2. One X channel's **Fetch posts**: the job log says `X login: the browser (firefox), read by
- gallery-dl.` before gallery-dl runs.
-3. Optionally **Connect X account**: the window should be Chromium 153, with no "controlled by
- automated test software" bar; log in with X's username and password (not Google), close the
- window. The source stays as chosen; on Automatic it moves to the connected profile.
-
-
-#### Review
-
-**Verdict: SHIP AFTER FIXES** (`xl-review.md` in the job's scratch): one Medium, four Lows, five
-infos. The coordinator ruled M1, L1, L3 and L4 in, the I1 wording, and L2 and I2–I5 into "Found and
-left" (I2 also into the operator's steps).
-
-| Finding | Where |
-|---|---|
-| M1: with no `::CONTAINER` the reader took cookies from every container (yt-dlp's default); gallery-dl, the fetcher this login feeds, takes only cookies outside every container and accepts `::all` — so the Check could say "visible" for a login gallery-dl never reads | `b3ee652b`: `firefoxContainerScope` / `inContainerScope` mirror gallery-dl 1.32.9's `_firefox_cookies_database` and its SQL (none = no container, `::all` = no filter, `::NAME` by `name`, `l10nId`, `l10nID`, case-sensitive); the container test expects `["default"]` with no container and has `::all`, `l10nId` and a 2-vs-12 case; the Check names a login that sits only in another container |
-| L1: the Check read the WAL; gallery-dl opens the db `immutable=1`, which ignores it, so just after a login the Check could say "visible" while gallery-dl runs as a guest | `b3ee652b`: one copy, two views (with the WAL; the main file alone); a login in the WAL only adds "Seen in Firefox's write-ahead log only; gallery-dl will see it after Firefox checkpoints (closing Firefox does it)."; the operator's step 1 says what to do |
-| L2: store discovery not exactly gallery-dl's | "Found and left"; FACTS and the module comment no longer say "as gallery-dl and yt-dlp find it" |
-| L3: "visible" also counted an `auth_token` on twitter.com; gallery-dl looks on `.x.com` | `b3ee652b`: `isXComAuth` counts x.com only (the Check and the fallback's warning); a twitter.com `auth_token` is reported as "An old-domain cookie is present too … gallery-dl does not use it." |
-| L4: the refresh fell back to the recorded browser only on a throw; a bundled read that opens a newer profile without its cookies would replace a logged-in jar with an empty one | `b3ee652b`: a bundled read with no `auth_token` while the jar holds one is read again with the recorded executable; when no read finds it the jar is kept and the refresh refuses, saying so. `refreshXCookies` takes an injectable `chromium`; `xSessionBroker.test.ts` (6 cases: login found, empty bundled read → recorded, nothing found → jar kept, no record → jar kept, a jar without a login replaced, bundled throws → recorded) |
-| I1: `--test-type` verified to set no automation signal; the wording "what ChromeDriver passes" was loose, and it is not the documented route | `b3ee652b` (`xBrowser.ts`'s comment), FACTS, the decisions table: Chromium's internal test-harness switch that skips the startup bars; the documented route is the machine-wide `CommandLineFlagSecurityWarningsEnabled` policy; ChromeDriver passes `--test-type=webdriver`, the bare switch is used |
-| I2: from the restart every X fetch runs as the operator's account | "Found and left"; the operator's step 0 |
-| I3: gallery-dl is handed the whole spec (every non-container cookie loads into its process) | "Found and left" |
-| I4: a checkpoint between the db and WAL copies can pair them wrongly | "Found and left" |
-| I5: the whole store sits in a private temp dir during a read | "Found and left" |
-
-**Gates after the review** (at `b3ee652b`; logs `$T/xl-tsc3.log`, `xl-common2.log`, `xl-build2.log`,
-`xl-e2e2.log`, `xl-e2e3.log`). `git merge main` was a no-op: `main` was still `a2229d68` (RM had not
-landed).
-- tsc (all workspaces) clean, 59 s. common **2,450/2,450**, 82 s (+11: the container case rewritten,
- the two-views and x.com-domain cases, three status cases, `xSessionBroker.test.ts`'s 6). Editor unit
- **109/109**. `archilyzer docs files --check`, `settings example --check`, `docs env --check`: exit 0.
-- The capped editor build with the corpus linked: exit 0, 69 s, 1.65 GB peak RSS, no warnings; the link
- removed and the worktree's own `transcripts/` put back.
-
- | Run | At | Specs | Result |
- |---|---|---|---|
- | 2 | `b3ee652b` | `x-session`, `settings` (also matches `operation-settings`), `social-channel` | 18 passed, **1 failed**, 2.5 min — `social-channel` "fetch-posts writes month-sharded JSONL…" hit the 30 s test timeout. The dev server was cold (started straight after the build), and the case is slow on this host anyway: 23.8 s in run 1, its offline neighbours about 12 s each. The gallery-dl path gained only a `stat` of the session dir |
- | 3 | `b3ee652b` | `social-channel`, `x-session` | **7 passed**, 0 failed, 1.8 min (the fetch-posts case 25.7 s) |
-
- Not measured: the same case on `main`'s code, to say how much of its time is older than this slice.
-
-#### Re-review and brought to main (2026-10-01)
-
-**Re-review: SHIP.** `86b48d6b` merges `main` `ae23a695` (slice RM's merge) into `9275ec44`. Three
-conflicts, all records, none in code: `plans/FACTS.md` keeps RM's appended section, then XL's;
-this file keeps both slices-table rows and RM's record, with this section after it; `editor/CHANGELOG.md`
-keeps one `## [Unreleased]`: RM's bullet, then XL's. Nothing RM changed is in a file XL touched.
-
-**Gates after the merge** (at `86b48d6b`; logs `$T/xl-tsc4.log`, `xl-common3.log`, `xl-build3.log`,
-`xl-e2e4.log`): tsc (all workspaces) clean, 155 s; common **2,484/2,484**, 108 s (RM's 2,438 plus
-XL's 46); editor unit **109/109**; `docs files --check`, `settings example --check`, `docs env --check`
-exit 0; the capped editor build with the corpus linked exit 0, 49 s, 1.65 GB peak, the link removed and
-the worktree's own `transcripts/` put back; e2e `x-session` and `channel-storage` (the two slices'
-nearest specs): **15 passed**, 0 failed, 1.9 min.
-
-## Rollout
-
-Both slices are export- and homepage-side; the editor and umtool are not rebuilt for this release.
-
-1. **Preconditions:** the primary clean on `main` at or after `1064d04c` (DX's merge); the source
- gate passes (`archilyzer source publish --check`).
-2. **Homepage:** `archilyzer build homepage` (the source step re-audits the 1,937 commits and
- renders the 32 new history pages), preview, the live check (which also asserts the Ten-minute
- setup on `/docs/ai-and-mcp/` and the `@Archilyzer` link), production, the live check again after
- the CDN's five minutes. First, so the doc every site links to answers.
-3. **Hub**, then the **six sites**, each built, previewed and checked: the site check asserts the
- "Search in" row's markup is absent from the static shell (S1 still holds), the "Use with AI"
- link carries `https://archilyzer.pages.dev/docs/ai-and-mcp/` and no `/use-with-ai` link
- remains, and the X link is `x.com/Archilyzer`.
-4. **By eye on one site with posts (Jeralyzer):** a plain search returns post cards beside videos
- (ruled: Posts on by default); untick Posts → none; tick Live chat on a video with chat → the
- hits wear "live chat"; untick all three → Search disabled with the row named.
-5. Records: this section, `STATE.md`, memory.
-7. Slice RM (2026-10-01) is editor-side: a capped editor build and one restart after its merge.
-8. Slice XL (2026-10-01) is editor-side: with RM's build and restart — done 12:54
- (`Xfavvt2XajdNzOvvn0NtL`), smoke green (one live-drift pair, identical when re-fetched together).
-6. Slice FK (2026-10-01) is editor-only: a capped editor build and one restart after its merge —
- done 03:15–03:16 (`GUkqnqHzYNMPWIF-rBS6W`), smoke green.
-
-Done 2026-09-30 evening by the session up to production: homepage built (`main 1064d04c` → mirror
-`19f7ea3b`, audit clean), preview checked 20/20; the hub and six sites built, previewed and checked.
-The production deploys are the operator's (`~/reports/release-15/RUNBOOK.html`, banner).
-**Deployed 2026-10-01 00:26–01:31** (the operator): the homepage (mirror `6b34c2aa`, 20/20 after the
-CDN's five minutes), the hub, the six sites (every post-deploy check OK); release 13's W1/W2/W3 and
-the on-screen deck went out with it; umtool restarted.
-
diff --git a/plans/release-17.md b/plans/release-17.md
@@ -384,7 +384,7 @@ since the evening of 2026-09-30; the lane retries one unit every ~30 min and eac
subtitle 429. Twelve videos of one channel rotate through the 6 h deferral and fail again each
time; `redownload-archive` jobs on other videos of the same channel succeeded in between. Each
failing unit had already picked its formats and died on the subtitle file. The 2026-09-25
-postmortem (`plans/youtube-lane-pacing.md`) found the same: the timedtext endpoint 429s per video,
+postmortem (`plans/archive/acquisition-and-pipeline.md` (entry `youtube-lane-pacing.md`)) found the same: the timedtext endpoint 429s per video,
not IP-wide. Today's flags: `--sleep-requests 1` for YouTube, `-t sleep` on the primary spawn, no
`--sleep-subtitles` override; yt-dlp re-extracts once after a subtitle 429 then fails; the app
never retries a `rate_limit`.
@@ -397,7 +397,7 @@ never retries a `rate_limit`.
NOT touch the platform backoff and does NOT defer the video's media. The deferred subtitles are
picked up by `download-missing-subs`; the transcription lane sees "downloaded, no transcript".
After 3 subtitle deferrals the video's subtitles are left alone for 7 days (shown on the video
- page with the count and the date; a manual fetch still works). `plans/youtube-lane-pacing.md`
+ page with the count and the date; a manual fetch still works). `plans/archive/acquisition-and-pipeline.md` (entry `youtube-lane-pacing.md`)
gets a dated note pointing here.
2. **The pace adapts per platform.** A persisted per-platform `platformPace`: `--sleep-requests`
starts at the platform's static value, doubles on every platform-level `rate_limit` (never on
diff --git a/plans/release-19.md b/plans/release-19.md
@@ -1,713 +0,0 @@
-# Release 19 — agents run the archive (ops, CLI and MCP; machine safety; the operator's guide)
-
-Written 2026-10-09 from the "next batch" plan (releases 19–22), against `r18/integration` `4cffda3f` (release 18
-complete, `main` `e921f82f` merged in). Rules: `plans/tools/implementer-rules.md` — three parallel Opus implementers,
-one per track, each in its own worktree branched from `4cffda3f`; the parent merges each track into `r19/integration`
-`--no-ff` on a clean tree, then fast-forwards `main`; records state rulings never reasons; counts-only privacy greps
-before every merge; implementers' commits carry their OWN model's `Co-Authored-By` + the session line; never boot a
-second editor against the real corpus; the homepage build gate is `build:nodata`; memory gate (`free -m` available
-≥ 6 GB) before any build, render or e2e, every `next build` under a 5 GB `systemd-run` scope. Record file: this file
-(shape of `plans/release-18.md`). Release 20 (the data model) is [`release-20.md`](release-20.md).
-
-## Context
-
-- Five working sessions (Super Hasanalyzer, Super Jeralyzer, Super Jasolyzer, candace owens corpus analysis, unified
- media aggregation) do corpus and content work and hold no unmerged code. Every gap they report is repo-wide
- tooling: wrappers that find `WORKER_TOKEN`, `joblog.sh`/`watchjobs.sh` job watchers, hand-run archive.org imports,
- hard-linking another site's `export/out` aside, two OOMs from concurrent heavy work.
-- Precedents to reuse: `editor/app/api/ops/_lib.ts` (`ops`, `opsAuth`, field readers, `jobResponse`), route unit
- tests (`editor/app/api/ops/{fetch-windows,transcribe,rename-channel}/route.test.ts`), `scripts/archilyzer-ops.mjs`
- (`ACTIONS`, `GETTERS`, `--wait`), the views (`common/views/names.ts`, `/api/view/*`), `mcp/src/fetchClip.ts`.
-- Tests: the editor e2e is 130 specs / ~709 tests / ~40 min, serial, behind a machine-wide lock; the editor has 29
- unit-test files. No CI, no root `test` / `typecheck`; the editor's `lint` has no config.
-- **Precondition (Wave 0, release 18's rollout):** `main` fast-forwarded to `r18/integration`, the release 18 rollout
- run, the `r18-*` worktrees pruned. Every `editor/app/api/ops` or `archilyzer-ops.mjs` change merges after it.
-
-## Rulings (operator, 2026-10-09; do not re-open)
-
-- **The MCP gains archival writes through the editor** — the `fetch_clip` pattern: the MCP server asks the editor
- (editor URL + `WORKER_TOKEN`), the editor writes. Settings, storage and deletes stay CLI/ops-only.
-- **Three parallel tracks**: A owns the e2e slot (code over ops/CLI/MCP, sequential), B is machine safety and tooling
- (no editor e2e; one umtool run), C is docs and plans (no e2e).
-- **Release 18 lands first**, by a session that may touch the primary checkout.
-- **e2e budget:** one editor/umtool/export e2e run at a time machine-wide; the full editor suite only at a release's
- end. Every slice carries its class: `[none]` docs/plans only, `[unit]` unit tests are its gate, `[spec]` one or
- two named specs, `[suite]` the full suite.
-- Polite scraping applies to every import and listing: one stream, real gaps, back off on 429.
-
-## Slices
-
-### Track A — release 19 (owner: the Track A implementer; sequential; owns the e2e slot)
-
-| slice | class | what | after |
-|---|---|---|---|
-| **A1** `pnpm ops` finds its token | `[unit]` | read `WORKER_TOKEN` / `ARCHILYZER_EDITOR_URL` from `editor/.env` when unset; `--wait` polls a real authed route instead of the `/api/jobs/active` rewrite | Wave 0 |
-| **A2** jobs over ops | `[unit]` + `[spec ops-api]` | `get jobs [--active\|--failed\|--kind\|--slug]`, `get job <id> [--tail]`, `job cancel\|retry\|retry-failed\|drain\|promote\|force-release <id…>`, `--wait` on many ids with queue position; wraps `editor/app/jobs/actions.ts` | A1 |
-| **A2b** ops routes to unit tests | `[unit]` | the `ops-api.spec` route cases move to `route.test.ts` beside each route (moved from B6 on 2026-10-09: Track A owns the ops routes) | A2 |
-| **A3** read side | `[unit]` | `get settings\|storage\|sites\|workers\|auto-queue\|scheduler\|cleanup <slug>` over the existing view builders/readers; `/api/auto-queue/control` gated behind `opsAuth` (unauthenticated today) | A2 |
-| **A4** archival writes | `[unit]` | `settings` patch (through `saveSettings` + the schema); `lane` start/stop/drain for every lane incl. `publish`; `clear-platform-hold`; `workers enable\|disable`; per-video `transcribe-one\|delete-file\|do-not-clean`; cleanup buckets; `relocate {dryRun}`; `archilyzer storage report` (tierable bytes per channel) | A3 |
-| **A5** fetch queue hygiene | `[unit]` | the editor dedupes identical fetch-window requests (same slug/id/window → the existing job); `fetch-via-editor.mjs` waits without a timeout, printing queue position; small fetch-window jobs get their own queue key / priority instead of waiting behind a multi-hour `persist-videos` | A4 |
-| **A6** imports | `[unit]` | `import-archive-org {items:[…] \| query}` with the polite inter-item gap, a `dryRun` that flags restricted (401) items, skip-if-held; `get remote-listing <slug>` for Odysee/BitChute (paced, one stream) diffed against held videos | A5 |
-| **A7** cues without an index | `[unit]` | `pnpm ops build-cues --slug [--ids]` (normalize → `transcript.cues.json`); MCP `get_transcript` falls back to the VTT | A6 |
-| **A8** publish edges | `[unit]` | `POST publish {verb:"build"}` takes `allowMissingMedia`; `pnpm ops lane` covers `publish`; `archilyzer publish build <id> --out <dir>` for a private build served elsewhere (cheap on release 18's bundles) | A7 |
-| **A9** MCP archival writes | `[unit]` | on the `fetch_clip` pattern: `get_job` (status + log tail), `enqueue` for sync / download-missing ids / transcribe-bucket / fetch-posts / import-video (each → the existing ops route), `channel_coverage` (held videos by date, gaps), notes `list\|read\|reply` (umtool `/api/notes`, `UMTOOL_URL`); instructions in `mcp/src/instructions.ts`; the README tool table | A8 |
-| release end | `[spec ops-api]` + `[suite]` | one `ops-api.spec` run, then the full editor suite once | A1–A9 |
-
-### Track B — release 19 (owner: the Track B implementer; no editor e2e)
-
-| slice | class | what | after |
-|---|---|---|---|
-| **B1** heavy-work gate | `[unit]` | `scripts/queue-lock.mjs` generalized into `pnpm heavy -- <cmd>`: one heavy slot machine-wide + a ≥ 6 GB free-memory floor; used by e2e, `next build` (publish stages, `build-site.sh`), `build-video.mjs` renders; a render may hold the transcription lane for its duration (ops `lane`); documented in WORKTREES.md + AGENTS.md | — |
-| **B2** report-to-video robustness | `[unit]` | prune `*-frames` after the final mux (`--keep-frames` keeps them); `--chrome-only` builds missing segments; a manifest lint before render (teaser > 34 chars, image src relative to the manifest, a QR legible at 720p). Track B's, after B5; the Candace session reviews it before merge (ruled 2026-10-09) | B5 |
-| **B3** report CLI | `[unit]` | `archilyzer reports check <site> [--reports …]` (compose without a build); `reports verify-quotes <report.json>` (quote vs cue span, the en-orig check); `reports attach-video` encoding to fit the 24 MiB compose limit | — |
-| **B4** ops transcribe | `[unit]` | `durationMs` excludes queue wait; a priority for short one-file jobs over long auto jobs | Wave 0 |
-| **B5** umtool small debts | `[unit]` → `[spec umtool]` | per-worktree umtool e2e ports (`portFor`); `mix.spec` order dependence; `umtool window` writes edit notes; a selection spanning two blocks gets a Note button; the CLI finds `SITES_DIR` from the repo, not the cwd; umtool's /sites heading becomes "Articles" (naming hazard vs the editor's /sites). ONE umtool e2e run | B1 |
-| **B6** test economy | `[unit]` | pure/API e2e moves to unit: `audio-check-classifier.spec` → common; `view-route`, `worker-unit`, `media-file-abort`. Root `pnpm test` and `pnpm typecheck`; the editor gets an eslint config or loses its broken `lint` script | — |
-
-### Track C — docs and plans (owner: the Track C implementer; no e2e)
-
-| slice | class | what |
-|---|---|---|
-| **C1** plans hygiene | `[none]` | STATE "Now"; PLAN.md's release index; this file and `release-20.md`; the "landed without a plan" record ([`landed-2026-10.md`](landed-2026-10.md)); one-core Phase 4, `editor-operations-ia.md`, `stats-cache-key.md` statuses |
-| **C2** OPERATING.md + `archilyzer docs cli [--check]` | `[unit]` | recipes (add a channel; sync and download; import from archive.org / Odysee / BitChute / Wayback; fetch and capture posts; transcribe; tag; prepare and export reports; publish) over `pnpm ops`, `archilyzer` and the MCP; a generated command reference from `common/bin/_cli.ts` `usage()` and `scripts/archilyzer-ops.mjs` `usage()` on the `env-docs.ts` / `file-schemas-docs.ts` pattern; linked from AGENTS.md, README, CONTRIBUTING (its hand-picked commands replaced by the link). Regenerated after Track A's actions land |
-| **C3** doc fixes | `[none]` | `mcp/README.md` lists every tool; README's docs table adds AGENTS, SETTINGS, SITE, CHANNEL, REPORT, CITATIONS; RUNNING_IN_DOCKER's ops list points at the generated reference |
-| **C4** homepage docs | `[unit]` | `homepage/content/docs/operate.md` gains the CLI/ops/MCP overview; gates `build:nodata` + `pnpm --filter homepage test` |
-| **C5** FACTS refresh | `[none]` | verified facts for main's last ~70 commits (notes store, articles kind registry, ops transcribe word timings, fetch-windows pacing, metadata refresh) |
-
-### File ownership
-
-| track | owns |
-|---|---|
-| A | `editor/app/api/ops/**` (except B4's transcribe route), `scripts/archilyzer-ops.mjs` + its test, `mcp/src/**`, `editor/app/jobs/actions.ts`, `common/controller/fetchWindows.ts`, `fetch-via-editor.mjs`, the `ops-api.spec` cases A2b moves |
-| B | `scripts/queue-lock.mjs` and the heavy gate, `umtool/**` (`umtool/report-to-video/*` for B2 only, the Candace session reviewing before merge), the e2e specs B6 moves, the report CLI, `common/controller/transcribeFile.ts`, `editor/app/api/ops/transcribe/**` |
-| C | `plans/**` (except the records others append), root `*.md` docs, `homepage/content/docs/**`, `mcp/README.md`, the `archilyzer docs cli` generator |
-| shared, append-only | `editor/CHANGELOG.md`, `AGENTS.md`, `common/bin/_cli.ts` (rows only) |
-
-### Graph and merge order
-
-```
-Wave 0 (release 18 lands) ──► A1 ──► A2 ──► A2b ──► … ──► A9 ──► release-end suite (Track A is sequential: A1–A5, then A6–A9)
- └─► B4
-now: B1 ──► B5 ──► B2 (Candace session review); B3; B6 (B6 touches no release-18 file)
-now: C1, C3 ──► C2 ──► C4, C5; C2 regenerated after A's actions land
-```
-
-- **Merge order:** Wave 0 before any `editor/app/api/ops` or `archilyzer-ops.mjs` change (they conflict with release
- 18). C1, C3 and B6 touch no release-18 file and may merge first. Track A merges slice by slice in its own order;
- B and C merge whenever a slice is green. The parent regenerates the command reference (C2) after each Track A merge
- that adds an ops action or CLI row.
-- **Do not touch:** `umtool/report-to-video/*` except B2, which the Candace session reviews before merge; `transcripts/**` except through the
- writers; the working sessions' `~/reports/*` workspaces.
-
-## Verification
-
-- Every Track A slice: route unit tests (the `route.test.ts` pattern) + `scripts/archilyzer-ops.test.mjs`; MCP tools
- via `pnpm --filter yt-dlp-transcript-mcp test` and one live `/ask`-style session against the editor; one
- `ops-api.spec` run per release; the full editor suite once at release end.
-- B1: a unit test of the lock + a manual two-build collision showing the second waits. B6: the moved tests pass and
- the editor suite shrinks by the moved count. B5: one umtool e2e run.
-- C2: `archilyzer docs cli --check` in the gates beside `docs env --check` and `docs files --check`; every command a
- recipe names exists (grepped against the generated reference). C4: homepage `build:nodata` + unit.
-- Every track: `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` clean per commit; counts-only privacy
- greps (home paths in added lines 0, no `transcripts/` content).
-
-## Record
-
-(Each slice adds a "#### Slice <X>, as shipped" section under its track, in merge order.)
-
-### Track A
-
-Branch `worktree-agent-a103bef2ee4055362` (worktree `.claude/worktrees/agent-a103bef2ee4055362`, ports editor 4101,
-test 4111, export 4110) off `4cffda3f`, one Opus implementer, A1–A5 in order, one commit each; `r19/integration`
-merged in before this record. Scratch files `a-*` in the job's `tmp`.
-
-| commit | slice | one line |
-|---|---|---|
-| `988b282c` | A1 | `pnpm ops` reads `WORKER_TOKEN` / `ARCHILYZER_EDITOR_URL` from `editor/.env(.local)`; `--wait` asks `GET /api/ops/job/<id>` |
-| `5f86b10a` | A2 | `GET /api/ops/jobs`, `POST /api/ops/job {verb, ids}`; `get job`, `get jobs`, `job <verb>`, `job wait` |
-| `e065bd2d` | A2b | 19 of `ops-api.spec`'s request/response tests become route unit tests |
-| `30111658` | A3 | the read side (`get settings|storage|sites|workers|auto-queue|scheduler|cleanup`); `/api/auto-queue/control` behind the token |
-| `5f442885` | A4 | archival writes (settings patch, the publish lane, platform holds, workers, one video, cleanup, relocate dryRun); `archilyzer storage report` |
-| `c261b64a` | A5 | clip windows on `clips:<platform>`; an in-flight window answers its job |
-| `e53f3169` | — | `r19/integration` merged in |
-| `cde0e759` | A2b | the test corpus helper's paths opt out of tracing (`next-build-trace.test.mjs`) |
-
-#### Slice A1, as shipped — `pnpm ops` finds its token
-
-- `scripts/archilyzer-ops.mjs` `loadEditorEnv()` fills `WORKER_TOKEN` and `ARCHILYZER_EDITOR_URL` when unset — a
- variable already set, even to `""`, wins — from `editor/.env.local` then `editor/.env` of the checkout the SCRIPT is
- in (`REPO_ROOT` from `import.meta.url`, never the cwd), then of the main worktree when it runs in a linked one
- (`mainWorktreeOf`: `.git` file → `gitdir` → `commondir`, read off disk, no git process). Only those two keys are
- taken; the files also hold deploy credentials. A 401/503 prints `tokenHint`: where the token came from, never its
- value. `parseDotenv` reads `KEY=value`, `export`, quotes, comments.
-- **What `--wait` polled and why it was a rewrite.** After three failed log polls it asked `/api/jobs/active`, which
- since one-core phase 3 slice 2 is a `next.config` rewrite onto `/api/view/activeJobs` — kept at its old path for the
- pages and pinned widgets that poll it — and that view builds the whole live payload (channel stats, the disk gate,
- every runner's status) to answer "is job X still there". It now asks `GET /api/ops/job/<id>` (behind the token: one
- registry record or `.meta.json` sidecar). An `archived` log status (an id the registry forgot) resolves to the
- sidecar's terminal status instead of exiting 1 for a job that ended `done`; a 404 `{ok:false}` is "gone". While a
- job waits, `followJob` prints `queued — position N on <queue>` once per change.
-- `GET /api/ops/job/<id>[?tail=N]` (`editor/app/api/ops/_jobs.ts`): the `getJobEntry` row without `logPath`, `queue:
- {key, position, queued, head}` while queued or running, the runner's `progress`; `tail` (≤ 500) is
- `common/jobs/listJobs.ts` `readLogTail` — the last N lines read from the end (256 KiB window, a partial first line
- dropped).
-
-#### Slice A2, as shipped — jobs over ops
-
-- `GET /api/ops/jobs` — `?active` (registry queued/running, queue order, each with its place), `?failed`, `?kind`,
- `?slug`, `?limit` (50, ≤ 500); a filtered history list reads the newest 2000 jobs (`JOBS_SCAN`); `active` with
- `failed` is a 400; unknown query keys are a 400.
-- `POST /api/ops/job {verb, ids}` — `cancel | drain | promote | force-release | retry` per id through
- `editor/app/jobs/actions.ts` (the row buttons' own actions), each answered in `results`; one refused id makes the
- answer `ok: false` (400, naming it) without stopping the others. `retry-failed` (no ids) is Retry all;
- `retryAllFailedAction` now also returns `jobIds` and cancels the new jobs' unread streams. `jobIds` = the jobs a
- retry started, which `--wait` follows.
-- CLI: `get job <id> [--tail [N]]`, `get jobs [--active|--failed] [--kind] [--slug] [--limit]`, `job <verb> <id…>`,
- `job wait <id…>` (no request; `followAll`, the `--wait` loop factored out). A read's flag on the wrong noun or on an
- action is refused, not ignored.
-- `ops-api.spec` gains "jobs over ops": two `/api/test/stuck-job` holders on one queue — the live list, one job's
- place and head, `?tail`, a promote refused ("already at the front"), a cancel of one known and one unknown id,
- `force-release` of the head. The success paths revalidate `/jobs`, which only a running server can.
-
-#### Slice A2b, as shipped — the ops-api spec's request/response tests are unit tests
-
-- 19 of `ops-api.spec`'s 33 tests (32 at base + A2's) exercised only a route's request and response; they moved,
- assertion for assertion, to `editor/app/api/ops/_door.test.ts` (the 401, the 503, unknown keys, the traversing slug
- on fourteen routes) and route tests for retry-bucket, tag-videos, persist-videos, build-site (+ build-deploy),
- deploy-site (+ build-deploy), deploy-hub, deploy-homepage and publish; fetch-posts and capture-posts gain one each.
- **ops-api.spec: 33 → 14 tests.** What stays needs the running server: writes that revalidate, jobs that run, the
- publish queue's runs, the jobs verbs.
-- `editor/app/api/ops/_testCorpus.ts` (imported only by tests): copies the named e2e fixture into a temp dir, sets the
- e2e test server's environment (fake yt-dlp, gallery-dl, ffmpeg/ffprobe, whisper, chough, parakeet, diarize, claude,
- findmnt, udisksctl, wrangler, next; the fake Cloudflare token; `ARCHILYZER_BRANCH=main`; `E2E_LIVE_CHECK=skip`) and
- `holdPublishQueue()`s as e2e did, so a refusal that regresses can only queue a fake.
-- The 503 no longer needs `/api/test/worker-token`: the unit process unsets its own `WORKER_TOKEN`. That test route now
- has no e2e caller (left in place).
-
-#### Slice A3, as shipped — the read side; the lane control route needs the token
-
-- `GET /api/ops/settings[?key]` (getSettings, migrated and defaulted), `storage` (`buildStorage`), `sites`
- (`listSites`: id, title, `siteUrl`, Pages project, audience, `isListedSite`, search, publish policy, channels),
- `workers` (`buildWorkersPayload`), `auto-queue` (`buildAutoQueueStatusPayload`), `scheduler`
- (`buildSchedulerStatusPayload`), `cleanup/<slug>` (new `loadCleanupRow` — `loadCleanupSummary`'s row for one channel,
- id lists as counts). One door, `editor/app/api/ops/_read.ts` `readRoute` (token, unknown query keys refused) and
- `redactSecrets` (any string under a key naming a token/secret/password/api key/credential → `"<redacted>"`; a remote
- worker's `token` is the one that exists today). CLI `get settings [<key>]`, `get storage|sites|workers|auto-queue|
- scheduler`, `get cleanup <slug>`.
-- **`/api/auto-queue/control` answers `opsAuth`.** Its one UI caller — `RunnerOperationView`'s Start/Drain/Stop on
- /operations — calls `startAutoQueueAction` / `stopAutoQueueAction` / new `drainAutoQueueAction` instead: `opsAuth`
- has no exemption for the UI (the UI never called an ops route; it uses server actions, which carry Next's origin
- check), and a page holds no token. The six e2e specs that post to the route (auto-queue, auto-subs-replace,
- disk-space, lane-runner, pacing, rate-limit) send the test token.
-
-#### Slice A4, as shipped — archival writes
-
-- `POST /api/ops/settings {patch}` → `saveSettings` (one-level merge). Refused before anything is written
- (`settings/patch.ts`): an unknown top-level key; **a key another writer owns** — `channelPriority` (compiled with the
- lanes' trees in one write), `autoQueue`, `workers`, `storage` — naming that writer; and a value the schema would not
- keep as sent (it coerces, never throws), every leaf of the patch compared with the schema's reading of the merged
- settings and each difference named ("minFreeDiskGB: sent -5, would be saved as <the clamp>"). Answers `{changed, value}` read
- back, redacted.
-- `lane` takes `publish`: `enabled` through `savePublishSettingsAction` with the stored fields, `held` through the
- pause gate, Start/Drain/Stop the publish page's actions; the ingest lanes' drain goes through
- `drainAutoQueueAction`.
-- `clear-platform-hold {platform}` (`clearPlatformHoldAction`, answers its sentence); `POST /api/ops/workers {op:
- enable|disable|drain, ids}` (the live pool, per id); `transcribe-one {slug, id, file?}` (`transcribeOneAction` with a
- file, else the video page's `whisperVideoAction`, which fetches audio through the managed path when there is none;
- the file name is checked as one path segment); `delete-file {slug, id, file}` (`deleteVideoFileAction` —
- `removeMediaFile`, refused while the media drive is not answering); `do-not-clean {slug, id, keep?}` (set, not
- toggled); `POST /api/ops/cleanup {slug, sweep: transcribed|extra-formats|wrong-format|failed-transcriptions}` (the
- channel page's four actions, as jobs); `relocate {dryRun}` (`previewRelocationAction` per slug — which, as on the
- panel, tiers a never-tiered channel in place first; a slug with no channel is the bulk path's "channel not found").
-- `archilyzer storage report [<slug>…] [--json]` (`common/bin/storage-report.ts`): per channel the tierable media,
- text and clip bytes off its report (`totalMediaBytes` is `isTierable`'s share) and where its media is — corpus disk,
- a location (`config.mediaDir` under its root, longest match), a custom path, or legacy — with totals per place; a
- missing figure is unknown (`—` / `null`), never 0; social channels left out; no drive touched, no editor needed.
-
-#### Slice A5, as shipped — fetch queue hygiene
-
-- **Its own queue.** `common/lib/queueKeys.ts` `clipWindowQueueKey`: a window job runs on `clips:<platform>` (from the
- platform queue it would have used, so `platform:vimeo.com` → `clips:vimeo.com`) — single (`fetchWindowAction`) and
- batch (`fetchWindowsAction`). A queue runs one job at a time and a tier orders only the waiting ones, so priority
- alone could not get a window past a running multi-hour persist; the queue key can. **Ruling recorded:** one window
- may now run beside one download on the same platform; windows stay one at a time per platform with the batches'
- `clip-window:<platform>` gap, and the platform's hold, cooldown and 429 backoff are shared with the downloads.
-- **Deduped.** `common/jobs/windowJobs.ts` `windowInFlight`: a queued or running `fetch-window` whose window contains
- the asked one, or a `fetch-windows` batch with such an item — same channel, video and height cap — read off the job's
- replay spec. `/api/media/fetch-window` answers that job (202, `existing: true`, its window and file); a batch lists
- such windows in `inFlight` and queues nothing for them, and the ops route adds their jobs to `jobIds` so `--wait`
- follows the windows asked for. Retry (`stream: true`) is not deduplicated.
-- **Not done: `fetch-via-editor.mjs`.** It is `umtool/report-to-video/fetch-via-editor.mjs` — under the directory no
- track touches — so its 10-minute poll timeout and its wait output are unchanged. The editor half covers its retry
- loop (a re-run after its timeout gets the job already fetching), and `pnpm ops job wait <id>` waits with no timeout,
- printing the queue position.
-
-#### Slices A6–A9, as shipped (2026-10-10, overnight Track A)
-
-Branch `r20/a6-a9` (worktree `r20-a6-a9`, ports editor 4001, test 4011, export 4010) off `r20/integration`
-`5b690d2e`, one Opus implementer, A6–A9 in order; `r20/integration` (release 20 D1) merged in before A9. Scratch
-files `a-*` in the job's `tmp`.
-
-| commit | slice | one line |
-|---|---|---|
-| `cf0bb7a6` | A6 | `import-archive-org {items \| query}`: one job over many items, held records skipped, RESTRICTED flagged, 401/403 storms stop; `remote-listing` / `get remote-listing <slug>` for Odysee/BitChute |
-| `f83d17b1` | — | a `usage()` paragraph for the twelve actions that had none (C2's found-and-left) |
-| `890b3355` | A7 | `build-cues {slug, ids?, force?}`; `GET /api/ops/transcript` / `get transcript <id>`; the MCP's `get_transcript` falls back to the editor |
-| `1b08ccc0` | A8 | `publish {verb: "build", allowMissingMedia}`; `archilyzer publish build <id> [--allow-missing-media] [--out <dir>]` |
-| `79b62feb` | — | `r20/integration` merged in (release 20 D1's `recordedDate.ts`) |
-| `d9318dbe` | A9 | MCP `get_job`, `enqueue`, `channel_coverage`, `notes`; `GET /api/ops/coverage` / `get coverage <slug>`; instructions, README, ENVIRONMENT |
-
-#### Slice A6, as shipped — imports and remote listings
-
-- **`import-archive-org` takes three shapes** (route, `importArchiveOrgAction`): `{item, files | match}` as before;
- `{items: ["<id>" | {item, files? | match?}, …]}` (at most 500; a bare id takes the top-level `match`, else every
- media original, each one record); `{query, limit?}` — archive.org's advanced search (`archiveOrgSearchUrl`: `q`,
- `fl[]=identifier,title`, `sort[]=identifier asc`, `rows` ≤ 500, one request through the polite client's chain,
- gap and backoff), its first `limit` (100) items. Every item is validated before any job; a stray shape is refused
- by name.
-- **One job, the politeness shared** (`runArchiveOrgBatchImport`, `controller/archiveOrgImport.ts`): the download
- gap (`archiveOrgGapMs`) before every download after the first across the whole batch, the consecutive-failure
- count, the rate-limit stop (the rest `notReached`; a re-run resumes), plus **an inter-item gap**
- (`ARCHIVE_ORG_ITEM_GAP_SECONDS` = 3 s, up to half again at random) before each item's metadata request, on top of
- the client's 2 s. An item archive.org has no record of is `missing` and passed over. `runArchiveOrgImport` (one
- item) is the batch of one, with its old result shape plus `restricted`.
-- **Held is skipped**: `isHeldArchiveOrgRecord` = `destinationExists` (what every download path asks) **or** a
- saved-video pointer (`isSavedVideo`) — a record whose media lives in the saved-container tier is never fetched again.
-- **Restricted** (`archiveOrgRestriction`): an item carrying `access-restricted-item`, else each file marked
- `private` — both answer a download with 401/403. A dry run lists each file as `held`, `RESTRICTED` or
- `would get`; an import skips restricted files. A download answered 401/403 (`isRefusalError`: the client's
- "archive.org answered HTTP 40[13]") marks the rest of its item restricted and is not a failure streak; **three
- such items in a row stop the job** (`refusedStorm`) and back the platform off as a rate limit does. The log ends
- with `summary: {dryRun, items, planned, imported, held, restricted: [{identifier, files}], failed, missing,
- notReached, stopped?}`. A dry run is refused, as an import is, while archive.org is held or cooling down (it asks
- archive.org for metadata and searches).
-- **`remote-listing {slug}`** (`controller/remoteListing.ts`, job kind `remote-listing`: platform queue, `needsText`,
- not ingest): an Odysee or BitChute channel's own URL, one `fetchFlatPlaylistUrls` read (the platform's paced args)
- on `platform:<p>` — one stream with every other request there — refused while the platform is held or cooling
- down, after the platform's import floor (`waitForPlatformGap`), noting the floor after; an
- `EnumerationIncompleteError` (429) backs the platform off. **Nothing is written** (no roster merge, no
- maybe-missing). The log ends with `@@remote-listing {slug, platform, url, listedAt, listed, unparsed, held,
- notHeld: [{id, url}], heldNotListed: [id]}`; `pnpm ops get remote-listing <slug>` posts it, waits and prints that
- JSON on stdout (the transcribe result-marker path). Any other platform is refused, naming its sync.
-
-#### Slice A7, as shipped — cues without an index
-
-- **`build-cues {slug, ids?, force?, queueKey?}`** → the digest card's `normalizeChannelAction` (now `{ids, force}`;
- `normalizeAllTranscripts` gains `videoIds` and `force`), on the channel's queue; every id must be held — a stray is
- refused, named, before any job.
-- **`GET /api/ops/transcript?id[&slug]`** (`controller/videoCues.ts`, `pnpm ops get transcript <id> [--slug]`): one
- video's cues off disk, nothing written — a fresh `transcript.cues.json` (`isCuesJsonFresh`), else what normalize
- would write (`buildNormalizedTranscript`, factored out of `normalizeTranscript`, which now calls it), else the
- English VTT alone when there is no metadata. Without `slug` the channel holding `data/<id>/` is found; two
- holders are a 409 naming them. Text-guarded (503 when the drive is not answering).
-- **The MCP's `get_transcript`**, for a video its archive does not hold and no `track` asked, asks that route
- through the configured editor (`mcp/src/editorOps.ts`, the fetch_clip env and timeout) and renders the cues headed
- `NOT IN THE ARCHIVE — read from the local editor's disk`, with no moment links. No editor, or a 404, keeps
- "video not found".
-
-#### Slice A8, as shipped — publish edges
-
-- `POST /api/ops/publish {verb: "build", allowMissingMedia: true}` carries the flag through `TargetAsk.build` →
- the plan step → the stage request (`--allow-missing-media`); the docker runner refuses it (its builds do not take
- it).
-- **`pnpm ops lane` covers `publish`** — shipped in A4 (`lane` takes `publish`); nothing added.
-- **`archilyzer publish build <id> [--allow-missing-media] [--out <dir>]`** (`common/bin/publish.ts`
- `layOutBundle`): after the build — or the no-op of a fresh one — the bundle is laid out in `<dir>` with **hard
- links** where the filesystem allows (a build installs a new bundle and never edits one in place), else copies;
- symlinks kept. `<dir>` is emptied first (its contents) and refused **before any build** where a local deploy's
- destination would be (`localDestProblem`); `--out` with `all` is refused. Not a deploy: nothing recorded.
-
-#### Slice A9, as shipped — MCP archival writes
-
-- On the fetch_clip pattern, one existing route each (`mcp/src/archivalTools.ts`): **`get_job`** (`GET
- /api/ops/job/<id>?tail=N`: status, times, exit code, queue place and head, the log tail); **`enqueue`** (`kind`:
- `sync` (`full`), `download-missing`, `retry-bucket` (`bucket`, `ids` — the way to download chosen videos),
- `transcribe-bucket` (`ids`), `fetch-posts` (`full`, `older`), `import-video` (`url`); a key a kind does not take
- is refused before any request; answers the job id and how to follow it); **`channel_coverage`** (`GET
- /api/ops/coverage`); **`notes`** (umtool via `UMTOOL_URL`: `list` from `/api/browse/decisions`, `read` from
- `/api/notes/context`).
-- **`GET /api/ops/coverage?slug[&gapDays][&from][&to][&list]`** (`controller/channelCoverage.ts`, `pnpm ops get
- coverage <slug>`): every held video dated off disk with `coverageDate()` — the recorded date when the channel has a
- `recordedDate` title rule and the title yields one, else the upload date — a small `metadata.info.json` parsed
- whole, a big one read at both ends (16 KB head for `title`, 8 KB tail for `upload_date`); `undated` named, never
- guessed; per year and month; gaps longer than `gapDays` (30). Text-guarded; nothing written.
-- **Ruling recorded: a notes reply is not written by the MCP.** umtool's `/api/notes` stamps every write as the
- operator's (its own rule: no way to claim to be an agent there), so `notes` `reply` answers with the `umtool
- notes reply <id> "<text>" [--resolve]` command instead of posting.
-- Settings, storage and deletes are not reachable from the MCP (ruled). `mcp/src/instructions.ts` gains the
- archive-work step (both plans; only when asked; report the job, do not wait it out) and both heads say the MCP
- changes nothing itself; README tool table; `UMTOOL_URL`, `WORKER_TOKEN`, `ARCHILYZER_EDITOR_URL` name their MCP
- readers (ENVIRONMENT.md regenerated). `channel-config`'s help names `recordedDateTitlePattern`.
-
-**A9 follow-up (release 23 F3) — notes get an agent write path.** Ruled 2026-10-10: agents get their own write path,
-attributed "agent", never as the operator. **This supersedes A9's ruling above** that the MCP does not write notes.
-- umtool's `POST /api/notes` (`umtool/lib/annotations/agentAuth.mjs`, `postNoteOp`): no `Authorization` header →
- "operator" (the page, unchanged); `Authorization: Bearer <WORKER_TOKEN>` → "agent"; any other `Authorization`
- header — a wrong token, another scheme, or any bearer while umtool holds no token — → 401, nothing written. `by` is
- never read from the body. umtool's `WORKER_TOKEN` is read per request: the environment (an explicit value, even
- empty, wins), else the first of this checkout's `editor/.env.local` / `editor/.env`, then the main worktree's
- (A1's `loadEditorEnv` order).
-- The MCP's `notes` `reply` (`note_id`, `text`, `resolve`, optional `target` — else found from the open notes'
- `?note=<id>` links) POSTs `{op: {op: "reply", id, text, resolve}}` with its `WORKER_TOKEN` and answers `Replied to
- <id> on <target> as the agent; the note is <status> (N replies).`; a 401 names the token mismatch. No stale-write
- token is sent (the CLI's way); the page's 409 re-read covers a write in between.
-- `mcp/src/instructions.ts`, `mcp/README.md`, `umtool/docs/notes.md`, `common/lib/envVars.ts` (ENVIRONMENT.md
- regenerated). umtool's notes UI already badged an agent's note and reply (`NoteCards`, `NoteThread`); unchanged.
-
-| Commit | What |
-|---|---|
-| `1b909c89` | `umtool:` F3 — the bearer → "agent" route, the MCP reply through it, docs |
-
-Gates: tsc clean; `umtool/lib/annotations/agentAuth.test.mjs` 7 (no token → operator; token → agent for a note, a
-reply and its resolve; wrong/malformed/no-umtool-token → 401 with nothing written; `by` in the body ignored both ways;
-no op → 400; the token read order), annotations 23/23; mcp 305/305 (`archivalTools.test.ts` +2: the POST with the
-bearer and the body pinned, an explicit project target; no token, a bad id, no open note, umtool's 401);
-`docs env --check` clean; umtool e2e `article-notes.spec.ts` 9 passed, 14.7 s (+1: an agent's reply over HTTP is
-stamped agent and badged on the page, a wrong token is a 401); umtool `next build` with the corpus linked (5 GB
-scope) green.
-
-#### Track A gates (A1–A5, on the merged tip)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean before every commit and on the merged tip
- (the A2/A2b/A3 commits under the 12:35 throttle ran the editor package's tsc alone; A1, A4, A5 and the tip ran the
- whole workspace).
-- **editor unit** 205/205 (159 at base: +5 A1, +4 A2, +19 A2b, +7 A3, +9 A4, +2 A5). **test:scripts** 693: 689
- pass, 3 skip, 1 fail — `next-build-trace.test.mjs`'s cwd-path check on the new test helper, fixed by `cde0e759`
- (the rerun's one failure is `queue-lock.test.mjs` "prints a banner naming the holder", run while another session's
- e2e held the machine lock; it passed in the gate run). `archilyzer-ops.test.mjs` 46 → 59. **common** 3473: 3469
- pass, 4 fail — `fetchPosts.test.ts` and `relocateDir.test.ts` pass alone (load); `autoRunner.test.ts`'s two
- ("computeLeafPending takes its channel listing from `shared`", "a channel with a move marker projects no work…")
- fail the same way on an extracted `4cffda3f` tree: not this branch's. +8 here (listJobs 1, windowJobs 3,
- storage-report 4). **mcp** 292/292.
-- **`pnpm --filter editor exec next build`** (5 GB scope) — ok.
-- **e2e** (detached, queued, memory-gated; `export/public` linked to the composed fixture as `r18-integration`'s is —
- the primary's no longer has `summaries/`, so the export server never answered and the first launch timed out
- waiting for it): `ops-api jobs fetch-window auto-queue lane-runner disk-space pacing rate-limit auto-subs-replace` —
- **65 passed, 5 failed, 19.0 min**, at load average ~26–32. ops-api (14/14), fetch-window (9/9), lane-runner,
- pacing and auto-subs-replace passed. The five failures are 30-s test timeouts before any code this branch changed ran: auto-queue's "UI:
- build a policy…" (the Start click its own comment calls a race against the poll — it lost, the button went disabled
- under it), "Drain completes when … parked" (timed out polling for the manual whisper job, before the Drain click),
- disk-space's "prevents a download…" (the channel page's Download click), jobs' "kicks off the index update" (the
- index stage still running at 30 s), rate-limit's "an overdue hold…" (`ECONNRESET` from the dev server on a control
- POST; the same POST with the token passed in the other specs). **Recheck of the five alone** (load ~22, 2.0 min):
- **4 passed, 1 failed** — the UI Start and the UI Drain (the two buttons A3 moved to server actions), disk-space and
- rate-limit pass; jobs' index test hit its 30-s test timeout again while its own page snapshot shows the stage's log
- ending `[stage] update-index _index: Done` — the index stage, which this branch does not touch, finishing late
- under load.
-
-**Tonight, A6–A9 (on `d9318dbe`):**
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean before every commit (A6 94 s, A7, A8, A9).
-- **common** 3672/3672 (+15 in the files this track added or extended: archiveOrgImport 7 → 12, remoteListing 4,
- channelCoverage 3, publish-out 3; `_cli`'s publish-row case updated). **editor unit** 237/237 (+9 here:
- import-archive-org 1, remote-listing 2, build-cues 3, publish +1, coverage 2). **test:scripts** 732: 729 pass, 3 skip
- (`archilyzer-ops.test.mjs` 59 → 63). **mcp** 303/303 (298 → 303: editorOps 5, archivalTools 5, protocol's tool
- list). `docs env|files|cli --check` 0.
-- **e2e** `ops-api.spec` alone, start mode (first build here 41 s, after a 1 min 37 s wait for the heavy slot):
- **13 passed, 27.7 s**.
-- Not run (the brief): the full editor suite (the orchestrator's); an editor build of its own beyond the e2e start
- build; a live `/ask`-style MCP session against the live editor.
-
-### Track B
-
-Branch `worktree-agent-a8b654c51bf472562` off `4cffda3f` (r18/integration with main merged), one Opus implementer,
-its own worktree under `.claude/worktrees/`. Scratch files `b-*` in the job's `tmp`. Slices in the order shipped:
-B6, B1, B4, B3, B5. **B2 did not ship** (below). No editor e2e was run, as planned.
-
-#### Slice B6, as shipped — test economy
-
-- **Pure and route-handler e2e moved to unit tests; the editor suite shrinks by 19** (`playwright test --list`, which
- boots no server: 733 tests in 132 files → 714 in 130). `audio-check-classifier.spec` (6) →
- `common/ytdlp/ffmpegStreamClassify.test.ts`. `worker-unit.spec` (2) → `editor/app/api/worker/unit/route.test.ts`:
- the four handlers in-process, a temp corpus, an ollama stub. `view-route.spec` 12 → 1; the rest →
- `editor/app/api/view/[name]/route.test.ts`: the rewrite table in `next.config.ts` read as data (each old path a
- rewrite to its view, every view one; the test sets a global `__dirname` for the config, which uses it), the
- dispatcher's 404 for unknown names and for every `/api/test/*` directory, and `/api/widget/presets` untouched. The
- test that stays e2e is the query string surviving a rewrite (`/api/pulse?rev=`): only a running Next shows that.
-- **`media-file-abort.spec` stays e2e.** Cancelled bodies run against the handler in-process pass even with
- `Readable.toWeb` or a naive enqueue-after-cancel wrapper (both tried), so the race happens in the server's
- response pipeline, and only the HTTP round trip tests it. Added beside it: `files/[name]/route.test.ts` (a range, a
- suffix range, a bad range returns the whole file, traversal is a 400, a missing file a 404) and
- `common/lib/safeStreamController.test.ts` (a raw controller throws `ERR_INVALID_STATE` once it is closed; the guard
- goes quiet).
-- **Root `pnpm test`** runs every package's unit suite and then `test:scripts`, and is non-zero if either fails.
- **Root `pnpm typecheck`** runs the tsc sweep. Both pass `--no-sort`. Under pnpm 11, `--no-bail` alone still SKIPS
- every dependent of a failed package: a red `common` ran no editor, export, homepage or mcp test, and no `tsc` in
- them. **The documented gate `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` has the same hole.** Not
- changed here: it is gate text in the plans and the rules (Track C's). `pnpm typecheck` is the corrected spelling.
-- **The editor's `lint` script is removed.** The editor had no eslint config. With export's config, eslint finds 35
- errors in 25 editor files (17 `react-hooks/set-state-in-effect`, 7 `react/no-unescaped-entities`, 4
- `react-hooks/purity`, 4 `react-hooks/refs`, 3 `@next/next/no-html-link-for-pages`). Each fix would change how a UI
- file behaves.
-
-#### Slice B1, as shipped — the heavy slot (`pnpm heavy`)
-
-- `scripts/queue-lock.mjs` adds a second machine-global lock, `<git-common-dir>/heavy-queue.lock`, and a memory floor.
- Once the slot is held, the run waits until `/proc/meminfo` MemAvailable ≥ `HEAVY_MIN_FREE_MB` (6000). The slot is
- taken first and the floor checked second, so no one slips in while the holder waits for memory. `pnpm heavy --
- <cmd>` is `queue-lock.mjs --heavy`, and pnpm's own `--` is accepted.
-- **Decision: e2e takes the heavy slot too, FIRST, then the e2e queue.** With one order everywhere, nesting cannot
- deadlock. `HEAVY_HELD` lets a heavy command inside one pass through, as `QUEUE_LOCK_HELD` does. `E2E_QUEUE=0` skips
- both locks and keeps the floor. The e2e queue's own banner, semantics and bypasses are unchanged. Covered entry
- points: every package's `e2e` scripts (the CLI) and `run-sharded-e2e.mjs` (`withQueue`).
-- **The publish stages' real `next build`** (a site, the hub, the homepage) runs through the slot (`build.ts`
- `heavyGated`). The e2e fake `EXPORT_NEXT_BIN` does not. A heavy run forwards SIGTERM/SIGHUP to its command, so a
- stage's Cancel, which signals the wrapper, still stops the build. **`docker/build-site.sh` is not edited.** Inside
- a docker-runner container the gate runs through the same code (`nextBuildStep`). The slot there is the container's
- own, and the floor reads the host's meminfo, so a fan-out slows down when the host runs low but is not serialised.
-- **Renders:** documented as `pnpm heavy -- node umtool/report-to-video/build-video.mjs …`. The in-file wiring was B2
- (not shipped). **"A render holds the transcription lane"** is a documented recipe (WORKTREES.md) with `pnpm ops
- lane` hold/release, which exists. It is not automated.
-- A waiter is told who it waits behind and what they are running. A machine whose MemTotal is under the floor runs
- with a note. With no usable `flock`, the gate warns and enforces the floor only. Bypasses: `HEAVY=0`,
- `HEAVY_MIN_FREE_MB`, `HEAVY_TIMEOUT`. Test seams: `HEAVY_LOCK_FILE`, `HEAVY_MEMINFO_FILE`, `HEAVY_POLL_MS`.
- ENVIRONMENT.md is regenerated (`docs env`), and WORKTREES.md and AGENTS.md each get a section.
-- **Manual collision on the real lock:** a second `pnpm heavy` printed `waiting for the heavy slot — held by
- agent-a8b… (…, pid …) for 4s: sleep 6` and ran when the first finished. The floor seen live: while the parent's
- suite was up, `pnpm heavy -- echo` waited at 2.8 GB available.
-
-#### Slice B4, as shipped — `ops transcribe`: the engine's time, and a short file first
-
-- `durationMs` now runs from the moment a worker takes the job (`onWorker`, the last attempt's) to the transcript. A
- new `waitedMs` is the queue time. The job's log gives both.
-- A cut of ≤ 15 min of audio (`URGENT_MAX_AUDIO_SEC`, measured from the cut WAV's size) acquires a worker in the
- pool's existing `urgent` tier. It goes ahead of parked manual batches as well as the lane (which was already
- `background`). A longer file keeps `foreground`. The tier orders waiters only, so nothing running is interrupted.
- `transcribeWithWorker` takes `tier`.
-
-#### Slice B3, as shipped — `reports check`, `verify-quotes`, `attach-video`
-
-- `archilyzer reports check <site> [--reports a,b] [--allow-missing-media]` is `resolveSiteReports` with nothing
- written. It exits 1 and prints compose's own problem lines. `--reports` covers drafts that are not in site.json.
-- `archilyzer reports verify-quotes <report.json> [--json]` runs compose's quote check on each citation and prints
- the best track plus the `en-orig` track's score. It reports `en-orig-drift` when a served `en` track matches the
- quote and en-orig does not. The span check is now ONE function, `checkSpanQuote`, which compose also calls.
-- `archilyzer reports attach-video <report.json> <video> [--poster] [--caption]` (`publish/reportVideo.ts`) remuxes
- an H.264 mp4 that is under 24 MiB. Anything else is encoded to fit, re-encoded smaller if it overshoots (≤ 3
- passes). A video too long to stay watchable is refused with its length. `video` is written to report.json only if
- its own fields validate.
-
-#### Slice B5, as shipped — umtool debts
-
-- **Per-worktree umtool e2e ports.** umtool's `e2e` script now runs through the worktree injector. The injector's
- index was also wrong for nested worktrees: it took the FIRST root that contains the cwd, and every
- `.claude/worktrees/<agent>` sits inside the main checkout. So every agent worktree got offset 0, the main
- checkout's ports, for every suite. It now takes the most specific root (`indexForPath`, tested). This worktree's
- umtool suite ran on 4251/4252 instead of 3051/3052.
-- **mix.spec's order dependence is fixed.** The file moves the fixture corpus's clip windows aside for its own tests
- and puts them back afterwards. Its render-scratch test now matches an exact option label. In the full run all 12
- mix tests passed; `:166`/`:201` had failed in every full run since FACTS recorded it.
-- **`umtool window` runs through the routes' edit guard.** On a generated manifest, each change is also an `edit`
- note. The guard is now `lib/report/edit-guard.mjs`, and `guard.ts` only types it.
-- **A selection that spans two sections gets a Note button.** The note is anchored in the section where the
- selection starts, up to that section's end. A spec covers it.
-- **The CLI finds SITES_DIR and CHANNELS_DIR from its own checkout:** `REPO_ROOT` comes from the entry script when
- that script is `<repo>/umtool/bin/*.mjs`. The app keeps the cwd walk. `umtool/lib/*.test.mjs` joins
- `test:scripts`.
-- **/sites appears as "articles"** in the nav and the crumbs, lowercase like every other umtool nav entry. The URL is
- unchanged. sites.spec asserts the new name and that no "sites" link is left.
-
-#### Track B gates
-
-| gate | result |
-|---|---|
-| tsc (`pnpm typecheck`) | clean at every commit |
-| common unit | 3489 tests, 3486 pass, 3 fail. All 3 fail at the base `4cffda3f` (autoRunner ×2, jobKinds ×1; jobKinds is fixed by r19's `ac5832de`, now merged) |
-| editor unit / export / homepage / mcp | 168 / 116 / 23 / 292, all pass |
-| `test:scripts` | 698 tests, 696 pass, 2 skipped (queue-lock 11 → 23 tests) |
-| umtool build (capped, corpus linked) | ok, 71 s |
-| umtool e2e, full | 284 tests: 250 passed, 20 failed, 14 skipped, 26.5 min (after a queue wait). Ours: article-notes `:77` (a race in the new spec) and projects `:208` (a kind id in a new test), both fixed in `dd149861`. Environment: triage ×9 (the song data is present this time, so these specs ran; they expect a visible `sort` link that the `song ▸` nav group has folded away since 2026-08-25) and faces ×4 (`facedet: false`, so the venv is missing (503); these four do not check that capability). Load: browse `:15` (page load timeout), deliver `:250`, usage `:78`/`:112`, video-notes `:69` |
-| umtool e2e, focused rerun | 74 tests (article-notes, projects, browse, deliver, usage, video-notes), 69 passed, 5 failed, 12.1 min: article-notes (with the new two-section test), projects and video-notes all pass. Still failing: browse `:15`/`:34` (`/browse` page-load timeouts), deliver `:250` (this time the progress never showed within 5 s of the click), usage `:65` (ECONNRESET from the dev server) and `:112`. No Track B change touches those pages or jobs. Track B's only shared-code change on their path is `REPO_ROOT` from the entry script, which resolves to the same checkout for `cut-from-cache.mjs`. A baseline run was NOT made, so "environment/load" is a judgement, not a measurement |
-| editor e2e | none (Track B rule) |
-
-**Not done:**
-- **B2 (report-to-video robustness and the build-video heavy wiring).** The permission system refused writes to
- `umtool/report-to-video/` ("modify shared resources"), even though the Candace session had handed the slice over.
- The partial work is kept OUTSIDE the branch in the job's `tmp/b2-partial/`: `lint.mjs` (the manifest lint: teaser
- house style as a warning; image src not relative or missing as an error; QR px/module at 720p, below 1.5 an error
- and below 2.0 a warning; the threads and flips validators), `prune-frames.mjs` (prune `chrome/*-frames` and
- `chrome/work-*` after the mux, recorded in `chrome/pruned.json`), a `verify-build.mjs` patch (pruned sequences
- read from the record), and the build-video edit script (`--keep-frames`, `--lint`, `--chrome-only` builds missing
- segments from the cache and never writes an existing one, the heavy slot around a render). None of it has been run.
-- `docker/build-site.sh` gets no gate of its own (see B1).
-- triage.spec and faces.spec, found failing above, are not ours to fix here.
-
-#### Slice B2, as shipped — report-to-video robustness (overnight 2026-10-10)
-
-Branch `r20/b2` off `r20/integration` `585be292`, one Opus implementer, worktree `r20-b2`. Started from the partial
-work in the job's `tmp/b2-partial/`, read and corrected before use. **Held for the Candace session's review before
-merge** (ruled 2026-10-09).
-
-- **The lint** (`lint.mjs`; `node umtool/report-to-video/lint.mjs <manifest> [--variant] [--json]` and
- `build-video.mjs <manifest> --lint`, exit 1 on an error). Errors: an image `src` that is absolute or `~`, or names
- no file beside the manifest (a timeline image, each of its `panels`, and under the deck a post's `shot`/`logo`); a
- QR below 1.5 px/module at 720p, or a link past a version-20 code; every manifest validator a build runs first
- (`validateThreadEntries`, `validateFlipEntries`, cut edits, teasers, claims, posts). Warnings: a QR below 2.0 px/module;
- a teaser line past 34 characters. **A title's first tier is not warned about**: `TEASER_LIMITS.fit.title` is already
- 34, so validateTeasers refuses it as an error; the warning covers an overline's or kicker's first tier and any
- break. The QR measure: version by byte capacity at `render.qr.ecc`, modules `17 + 4v + 2·quiet`, the deck's and the
- posts' codes resized to their `size` and the rail's to `rail.qrSize` on a `render.height` frame, the corner code at
- qrencode's `scale`. Before the build a deck QR under `links: "original"` is measured as the archive link, and a
- post's as the longer of its url and its archive page under the manifest's channel.
-- **Every build runs the lint** after its validators and before anything renders: an error refuses it, a warning is a
- note. `--no-lint` builds anyway; `--only <id>` lints that entry (and the posts attached to it); a bench fetch, the
- thumbnail and `--chapters-only` are not held up.
-- **The prune** (`prune-frames.mjs`): after the final mux of a full build or `--chrome-only`, the directories
- `chrome/<name>-frames` and `chrome/work-*` are removed, each sequence's frame count and key written first to
- `chrome/pruned.json`. `--keep-frames` keeps them. Not after `--no-chrome` (it rendered none), not under the legacy
- chart band (its frames are an input). `segments/` and the compositions are never touched, and a symlink named like
- a sequence is neither followed nor removed. `verify-build.mjs` counts a pruned sequence (deck, feed, stamps, posts,
- teasers) and reads a teaser's key from the record, unless the cut file is newer than the prune.
-- **Linked segments.** `--chrome-only` builds a MISSING segment from the cache (skipFetch), after every refusal, and
- never writes an existing one; `--chrome-preview` still refuses a missing one. Before an entry is rebuilt
- (`--only`, a full build, a missing one), `detachSegmentFiles` unlinks that entry's files in `segments/` that are hard
- links or symlinks; a clip does so only once its source is in hand. A teaser re-encode writes beside its segment and
- renames over it, its record too. So another take's linked-in segments are never written through.
-- **The heavy slot.** The rendering runs (a full build, `--chrome-only`, `--chrome-preview`, `--rail-only`) run in
- `scripts/queue-lock.mjs` `withHeavy` through `heavy-gate.mjs`. A fetch, `--only`, `--chapters-only`, `--thumbnail`
- and `--lint` do not. The lock is pinned to this checkout's git common dir unless `HEAVY_LOCK_FILE` is set. The gate
- is loaded by a run-time URL beside `argv[1]`, so umtool's bundle never imports it. `HEAVY=0` / `HEAVY_HELD` pass
- through; compose-chrome's `rendererEnv` (DISPLAY and WAYLAND_DISPLAY stripped) is unchanged.
-- **fetch-via-editor.mjs** (release 19 A5's ruling): no 10-minute timeout, nor the 6-hour one under `--all`. While a
- job is queued its place (`GET /api/ops/job/<id>` `job.queue`) is printed when it changes. A dropped poll is retried
- with a back-off, 10 in a row end the wait; a refusing answer still ends it. Ctrl-C exits 130, naming the job that
- keeps running.
-- `setProgressMode` also takes a function (the tests read events without stdout, which node's test reporter uses).
-
-| commit | what |
-|---|---|
-| `42343b9b` | fetch-via-editor waits without a timeout, printing the queue place |
-| `b23206fd` | the lint, the prune, linked segments, the heavy slot; README, CHANGELOG |
-| `18da0c58` | umtool e2e: `onscreen.spec` and `onscreen-posts.spec` read the frame counts from `chrome/pruned.json` and require the sequences gone (scope extended by the orchestrator) |
-
-**Gates**
-
-| gate | result |
-|---|---|
-| `node --test umtool/report-to-video/*.test.mjs` | 474 tests: 472 pass, 2 skipped (base 445: 443 + 2 skipped). New: lint 10, segment-links 5, prune-frames 4, heavy-gate 5, fetch-via-editor +5 |
-| `pnpm test:scripts` | 740 tests: 737 pass, 3 skipped |
-| tsc (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) | clean |
-| umtool build (capped, corpus linked, through `pnpm heavy`) | ok; compiled in 11.4 s, 273 s with the waits for the slot and the memory floor. `next-build-trace.test.mjs` 10/10 on its traces |
-| umtool e2e, `onscreen.spec.ts` + `onscreen-posts.spec.ts` only (after `18da0c58`) | 17 passed, 0 failed, 2.6 min (after a wait for the heavy slot) |
-
-**Found and fixed:**
-- **umtool e2e expected frames on disk after a build.** `onscreen.spec.ts` (`frameFiles()` on `chrome/deck-frames`,
- after the full build and after the re-render) and `onscreen-posts.spec.ts` (the feed build's `feed-frames` and
- `deck-frames`) now read the counts from `chrome/pruned.json` and require each sequence gone (`18da0c58`).
-
-**Found and left:**
-- A comment holding `chrome/*-frames` opens a block comment for `next-build-trace.test.mjs`'s scanner and tainted all
- of `build-video.mjs`. The comments say `chrome/<name>-frames`.
-- The umtool build traces `heavy-gate.mjs` and `heavy-gate.test.mjs` as files (from the `new URL("./heavy-gate.mjs",
- …)`). They are not bundled, and the trace test passes.
-
-**Review (2026-10-10):** the Candace session reviewed `r20/b2` at `db96bf7e`. **Verdict: SHIP.**
-- **Constraints, checked in the code:**
- - (1) The prune removes only real `chrome/<name>-frames` and `chrome/work-*` directories. It follows no symlink,
- leaves `segments/` alone, and `pruned.json` keeps a pruned cut verifiable.
- - (2) `--chrome-only` builds only missing segments. Every segment write unlinks a hard link or symlink first, so
- nothing is written through another take's file.
- - (3) The lint's errors and warnings are as ruled, and it runs the thread and flip validators.
- - (4) The heavy gate is re-entrant (`HEAVY_HELD`), and fetch-via-editor waits on the job instead of re-queuing.
-- **Evidence:**
- - The branch's `report-to-video` tests, run from a scratch export: 472 pass, 0 fail.
- - `--lint` over the session's 76 existing manifests: 0 errors.
- - A deliberately broken copy got the three expected errors (absolute src, missing shot, unknown thread).
- - The two changed umtool e2e specs were left to the orchestrator's gate.
-- **Follow-up (the Candace session's own, not a blocker), closed 2026-10-10:** its post QRs at `qrSize` 110 linted
- at 1.88 px/module (a warning); its generator now sets `qrSize` 120, from the next render.
-
-Merged `--no-ff` into `r23/integration` at `a57b2090` (release 23's step 0).
-
-### Track C
-
-#### Slices C1–C5, as shipped (2026-10-09)
-
-Branch `worktree-agent-ad0ba0d0eda014c20` from `4cffda3f`; C1 and C3 merged into `r19/integration` at `e5e7c55e`.
-
-| commit | what |
-|---|---|
-| `11cb1b09` | C1: STATE "Now" (2026-10-09; older "Now" entries read "Previously"); this file and `release-20.md`; PLAN.md "Beyond the AI track: releases"; [`landed-2026-10.md`](landed-2026-10.md) (main's first-parent `39abec18..e921f82f`, 70 entries); one-core Phase 4 DONE 2026-09-28; `editor-operations-ia.md` COMPLETE (slice 9 = one-core Phase 1 slice 1.3); `stats-cache-key.md` merged `10cefd15`, rolled out with release 15; `plans/README.md` names the release and landed files |
-| `2010600d` | C3: `mcp/README.md` lists `list_tags` (now every tool in `TOOLS`); README's docs table adds SETTINGS, SITE, CHANNEL, REPORT, CITATIONS, AGENTS |
-| `86e4e436` | C2: `archilyzer docs cli [--check]` (`common/bin/cli-docs.ts` + test) → `COMMANDS.md`; `OPERATING.md`; links from AGENTS.md, README, CONTRIBUTING, RUNNING_IN_DOCKER |
-| `d9564923` | C5: FACTS "Main's October work, outside release 18"; this file's A2b / B2 scope change |
-| `e35523a4` | C4: `homepage/content/docs/operate.md` "From a shell or an agent"; homepage changelog |
-| `b064c835` | merge `r19/integration` (release 21's plan, the jobKinds test fix) |
-
-**How the reference is made.** `COMMANDS.md` is a whole generated file, as ENVIRONMENT.md and SETTINGS.md are;
-OPERATING.md links it. The `archilyzer` rows come from `COMMANDS` (`common/bin/archilyzer.ts`, where the table
-lives — the `docs cli` row is there, not in `_cli.ts`). The `pnpm ops` rows come from the exported `usage()` of
-`scripts/archilyzer-ops.mjs`, read by dynamic import, and from its header comment's `// pnpm ops <action> …`
-example lines; the script is not changed. A help paragraph that opens with action names is that row's text; the
-other paragraphs print as they stand. `--check` (and a plain run) also fails when OPERATING.md names a
-`pnpm ops …` or `pnpm archilyzer …` that does not exist.
-
-**Gates** (logs `$T/c-gates-*.log`, `$T/c-homepage-build.log`): tsc clean (before C2's commit and after the
-merge); `docs env|files|cli --check` 0; `bin/cli-docs.test.ts` 9/9; after the merge `bin/cli-docs.test.ts`,
-`bin/_cli.test.ts`, `architecture.test.ts` and `jobs/jobKinds.test.ts` 49/49; homepage unit 23/23; homepage `build:nodata` ok (45 s, 5 GB scope, after the e2e run
-ended). The whole common suite was started once and stopped on the parent's throttle (the editor suite was
-running); only the changed files' tests ran. No e2e (class `[none]`/`[unit]`).
-
-**Found and left:**
-- 15 ops actions have no help paragraph in `usage()`: `channel-priority`, `metadata-scan`, `import-video`,
- `import-archive-org`, `feed-metadata`, `refresh-report`, `sync`, `download-missing`, `relocate`,
- `relocate-back`, `evict-clips`, `lane`, `tags`, `tag-videos`, `keep-videos`. COMMANDS.md lists them with their
- header examples (none for `download-missing`, `relocate-back`, `evict-clips`, `keep-videos`); OPERATING.md's
- recipes cover the common ones. A paragraph each in `usage()` is Track A's file.
-- `pnpm ops transcribe`'s `durationMs` includes the wait for a worker (FACTS; B4).
-- fetch-windows: the cross-run platform gap is in memory, and dedupe is within one request (FACTS; A5).
-- C2 is regenerated after each Track A merge that adds an action or a CLI row (`pnpm archilyzer docs cli`).
-
-## Landing, as it went (2026-10-09 evening)
-
-`r19/integration` from `8eabed56` (releases 19 A1–A5/B1/B3–B6/C1–C5, 21 D1/D3/D4b, 22 E1–E6, the timeline feeds,
-the session-link hotfix, the X `--post-range` fix), gated in one quiet window (peers asked to hold renders, builds,
-e2e and lanes; the live editor's transcription lane held through `pnpm ops lane`).
-
-**Light gates** (`$T/r19-*.log`): `pnpm typecheck` clean (108 s). `pnpm test` 2 red of 3,634 in common, both real:
-- `fetchOlderPosts` "a limit stops the walk part-way" — its inline fake gallery-dl, and the editor e2e's
- `fake-gallery-dl.mjs`, still capped on `--range` after `8eabed56` moved the cap to `--post-range`;
-- `architecture.test.ts` — `lib/report/exportSlides.test.ts` imported `components/report/slides/Slide`, a new
- lib → components back-edge. The test moved to `components/report/exportSlides.test.ts` (it is the parity test
- between the string slides and `Slide.tsx`); the allow-list stays as it was.
-
-Both fixed in `904b3d91`; common then 3,634/3,634. Editor 218, scripts 708 (+3 skipped), mcp 293, export 118,
-homepage 23. `docs env|files|cli --check` and `settings example --check` 0.
-
-**Builds** (each through `pnpm heavy`, 5 GB scope): editor 121 s, export 32 s (over the committed fixture
-compose), homepage `build:nodata` 24 s, umtool 40 s (corpus linked).
-
-**e2e:**
-- Editor suite, **`E2E_MODE=start`** on the editor built at the tip: 681 passed, 3 failed, 12 skipped, **23 min
- 56 s** (Wave 0's dev-mode run: 71 min). The three — `channel-work.spec:208` (`resetData`'s EEXIST race),
- `sites-crud.spec:392`, `whisper.spec:184` — pass alone in start mode (13 s) and in dev (54 s): load flakes.
- Measurements and the plan that follows from them: [e2e-speed.md](e2e-speed.md).
-- Export report suite: 42 passed, 3 failed; umtool article specs: 18 passed, 3 failed — release 22's first run.
- The fix round (release-22.md, "Fix round"; the operator ruled the view switch sticky) merged at `3c445f6e`, plus
- `09f1a7d1` (the last places near a report's end). On `09f1a7d1`: **export report suite 46/46, umtool article
- specs 21/21**, export unit 118/118. The editor imports none of the files changed after its run.
-
-**Privacy, counts only, `main..r19/integration`** (diff added lines / commit messages): the operator's name,
-email local part and guarded suffix 0/0; home paths 0/0; the scrubbed deployment hash 0/0; corpus data paths 0/0; author and
-committer one identity. Session trailers: 0 in any file; 40 commit messages written before the rule (11:19–14:07)
-carry one, as 2,060 of main's 2,720 do — the mirror strips them (`SESSION_LINK_RULES`) and its audit refuses any
-left, so the source check after the fast-forward is the gate.
-
-## Rollout
-
-`main` fast-forwarded to `7bd1d5fe` by the operator (2026-10-09 evening). The transcription lane stays held (operator).
-
-- **Editor** — build `T0fToESnKRSHUisz1lY4v` → `OcKGZ7ufxOBKRo8FQoUGs` (46 s, 5 GB scope), restart: `/` 200, `UV_THREADPOOL_SIZE=16`,
- no ZodError, queued jobs 0 → 0; one running `import-archive-org` closed as interrupted at boot (its session told to
- re-queue). Smoke `SMOKE_FAIL=0`. The lane hold survived the restart; `pnpm ops get jobs` reads the token itself (A1).
-- **umtool** — build `tnCD4m8m-xpZKplJ40o_L` → `Ygl5WMxAtVHKUqkPguFBI` (through `pnpm heavy`; it waited ~27 min on the
- 6 GB floor), restart on :3050: `/` 200.
-- **Source mirror + homepage** — `source publish --check` on `7bd1d5fe`: audit clean (32,087 objects, 2,793 commits,
- 6,039 files, 14 denied literals), gitleaks clean. Homepage built and deployed to production: live check ok. A
- fresh clone of the live mirror: head `eee10ca9`, 2,793 commits; name, email local part, guarded suffix, session
- links and trailers 0; one identity. (A first clone within five minutes got the previous `info/refs` from cache —
- `max-age=300`.) The scrub file still has 9 rules, so older history keeps 11 mentions of one deployment hash; the
- operator's 10th rule and a republish remove them.
-- **Sites** — the release's export changes are report-only (slides, overview, timeline, feeds); no public site has
- reports, so none was rebuilt; all six answer 200 on `/` and `/corpus.json`. `jeralyzer-private` (the co-host
- timeline, private only) is rebuilt by its session's `build-site.sh`.
diff --git a/plans/release-20.md b/plans/release-20.md
@@ -1,259 +0,0 @@
-# Release 20 — the data model and the index (recorded dates, Twitch ids, the caption-track bug closed)
-
-Written 2026-10-09 from the "next batch" plan (releases 19–22), against `r18/integration` `4cffda3f`. Track A's, after
-release 19 ([`release-19.md`](release-19.md)); small. Rules: `plans/tools/implementer-rules.md` and release 19's
-rules line, unchanged. Record file: this file (shape of `plans/release-18.md`).
-
-## Context
-
-- A VOD-mirror channel's videos are dated by their upload to the mirror, not by the stream they copy; coverage
- ("held videos by date, gaps", release 19 A9 `channel_coverage`) reads the wrong date for them.
-- A Twitch video's directory is `<n>` while its record carries `v<n>`; readers that join the two miss.
-- The `en` track → 0 cues bug (an `en` VTT that parses to 0 cues preferred over `en-orig`) was filed 2026-10-01.
- Main's caption-track merges since (`200a3105` transcripts/en-track-fallback: en-orig first, empty tracks fall
- through, cue-block VTTs parse, a one-shot index re-read; `e506f738` transcripts/multi-track) are the candidate fix.
-- `plans/stats-cache-key.md`: merged `10cefd15` (2026-09-28); the recount rolled out with release 15 (verified by
- release 19 C1).
-
-## Slices
-
-| slice | class | what | after |
-|---|---|---|---|
-| **D1** recorded dates | `[unit]` | `recordedDate` for VOD-mirror channels, derived from the title by a per-channel rule; coverage reads it before the upload date | release 19 |
-| **D2** Twitch ids | `[unit]` | one normalization of the Twitch id (`<n>` directory vs `v<n>` record) at the index boundary | D1 |
-| **D3** the caption-track bug | `[unit]` + `[spec]` for the index | verify against the tree and a fixture that the `en` → 0 cues case is closed by `200a3105`; close it in STATE and FACTS, or fix what remains | — |
-
-**Owner:** the Track A implementer. **Merge order:** D3 may go first (verification); D1 → D2. Release end: the index
-spec(s) D3 names, then the full editor suite once if any editor code changed.
-
-## Verification
-
-- Unit tests per slice; the index spec for D3; tsc clean per commit; `docs files --check` if a schema changes.
-- Counts-only privacy greps before each merge.
-
-## Record
-
-(Each slice adds a "### Slice <X>, as shipped" section here, before "## Rollout".)
-
-Track D of the overnight batch (2026-10-10), on `r20/d2-r20` off `r20/integration` (`585be292`), after release 21
-D2 on the same branch; D3 first, then D1; D2 built, then held (below). Every fixture is synthetic; nothing read the
-corpus beyond config.json key names and shapes, and a count of two Twitch channels' directories (below).
-
-### Slice D3, as shipped — the caption-track bug, closed
-
-**Verified against the tree.** The `en` → 0 cues bug (filed 2026-10-01) is closed by `200a3105`: one rule in
-`common/lib/videoStatus.ts` (`CAPTION_TRACK_RULE_VERSION` 1) — pin > `en-orig` > `en` > regional > `en-en-*` by name,
-then the first track that parses to at least one cue (`readEnglishVttCues`) — and `parseVtt` reads a document with no
-inline timing tag as plain cue blocks, the livestream `en` shape that used to parse to nothing. Every cue reader goes
-through the rule: the index, normalize, report compose, the editor's track reader, and umtool's `cues.mjs` copy (held
-equal by `captionTrack.test.ts`); `buildIndex.ts`'s other `parseVtt` call is the non-English and live-chat tracks. An
-index built under the old rule is re-read once for the records the rule reaches.
-
-**Added:** `controller/buildIndexCaptionTrack.test.ts` +1 through the real `buildIndex` — an empty `en-orig` before an
-`en` with text, and an empty `en` before an `en-US` with text (no `en-orig`), both read the track with text. FACTS
-gains "The caption-track rule" (and a superseded note on the old "a caption fixture must carry timing tags" line);
-STATE closes the bug.
-
-**Found and left (report only, as ruled): the stats cache does not see the caption-track pass.** `buildStats` keys a
-video's stat on its index `mtimes` record (`indexSignature`; `plans/stats-cache-key.md`, merged `10cefd15`, in the
-tree unchanged: schema 6, the whole record plus `indexKey`). The caption-track pass re-reads a record's cues and writes
-the SAME `mtimes` record back (no input file moved), so a record the pass took from no text to text keeps
-`hasTranscript: false` and its old `cueCount` in the stats until something else moves its record.
-
-### Slice D1, as shipped — recorded dates for VOD-mirror channels
-
-**What it does.** `common/lib/recordedDate.ts` (pure, client-safe): a channel's `recordedDate: {titlePattern}` is a
-case-insensitive regex source naming the groups `year` (four digits, or two read as 20YY), `month` (1–12, or an English
-month name, whole or cut to three or more letters) and `day`; it must compile, name all three, and pass the download
-filter's safety check (at most 200 characters, no nested quantifier), or the config reader drops the whole rule.
-`deriveRecordedDate` gives `YYYYMMDD` for a real day no later than the upload date (a later title date is one the
-title mentions, not the recording's), else nothing. `coverageDate(summary)` is `recordedDate ?? uploadDate`, the hook
-coverage reads.
-- **Config:** `ChannelConfig.recordedDate` through `CHANNEL_CONFIG_COERCIONS` / `channelConfigSchema`, with a nested
- key table; CHANNEL.md regenerated (`archilyzer docs files`).
-- **The index** (`buildIndex.ts`): after a record's summary is settled (from metadata or a fresh `transcript.cues.json`),
- `recordedDate` is set from the channel's compiled rule or deleted. `recordedDateRule:<slug>` in the index meta holds
- the pattern a channel's records were derived under; a build that finds another re-processes that channel's records
- once (`Recorded dates: <slug>: its rule changed; N record(s) re-derived.`), a held channel left for a later build.
- No channel has a rule today, so the first build after the rollout re-processes nothing.
-- **`TranscriptSummary.recordedDate?`**, omitted when absent: it reaches a channel's published transcript pages only
- once that channel has a rule, and no page changes until then.
-- **Setting it:** the Configure form's Advanced section gains "Recorded date from the title (regex)"
- (`recordedDateTitlePattern`, refused with why when it could not be a rule; in `CHANNEL_FORM_FIELDS`, so clearing it
- clears the key), and `pnpm ops channel-config {"slug":…,"patch":{"recordedDateTitlePattern":…}}` sets it through the
- same parser.
-- **Coverage** (release 19 A9's `channel_coverage`) is not on this branch; `coverageDate` is what it reads at merge.
-
-**Which channels are mirrors** was read from config.json shapes only: no key marks one; the candidates are the
-channels whose name or URL says VODs, mirror or archive (listed in the track report). No channel's config was changed;
-the patterns are the operator's to write.
-
-### Slice D2 — one Twitch id: held, operator ruling owed (superseded: ruled option (b), shipped as release 23 F1 below)
-
-Built as `433815d4` and reverted on this branch; the build is kept on `r20/twitch-ids` (orchestrator, 2026-10-10:
-it changes published URLs, which is the operator's ruling).
-
-**What is there.** A Twitch VOD's directory is the canonical id, the URL's `/videos/<n>` (`extractVideoId`);
-`summarize` takes yt-dlp's native `meta.id`, `v<n>`, so the record's id and slug say `v<n>`. Two channels carry
-Twitch VODs: `hasanabi` (180 directories) and `shondo-twitch` (37). No curated tag or site report references a `v<n>`
-id (counts 0).
-
-**Readers that miss the join today** — each opens `data/<record id>/` with the record's `v<n>`:
-- MCP `fetch_clip` → the editor's fetch-window (`data/v<n>/` holds no metadata, so no URL and no cache);
-- the evidence-clip tiers (`common/lib/evidenceClip.mjs`, `videoDirOf`) behind reports prepare and report-to-video's
- local sources, and `publish/reportMedia.ts`'s per-record availability read;
-- umtool's local cue lookup (`report-to-video/cues.mjs`, `data/<videoId>/transcript.cues.json`).
-
-**The two options:**
-- **(a) Records take `<n>`** (what `r20/twitch-ids` does: `canonicalTwitchVideoId` in `summarize` and in
- `readNormalizedTranscript`, a one-shot index re-key, the player still given `v<n>`). 217 public transcript URLs move
- from `…/v<n>` to `…/<n>` (hasanabi 180, shondo-twitch 37); the hub needs tombstones for the old ones.
-- **(b) The published `v<n>` stays**, and the join normalizes on the directory side (a reader maps a Twitch record id
- `v<n>` to `data/<n>/`). No URL moves.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `04a075b3` | `common:` D3 — the fall-through index test; FACTS "The caption-track rule"; STATE closes the bug |
-| `96409e24` | `common:` D1 — the `recordedDate` rule, its derivation, the index pass, the form field; CHANNEL.md |
-| `433815d4` | `common:` D2 — `canonicalTwitchVideoId`, `normalizeSummaryId`, the one-shot re-key, the player (kept on `r20/twitch-ids`) |
-| `949f7e41` | `common:` revert of D2 — held for an operator ruling |
-
-**Gates.** `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` clean at each commit. New tests:
-`lib/recordedDate.test.ts` 7, `controller/buildIndexRecordedDate.test.ts` 2 (derived, absent without a rule, a date
-after the upload dropped; a changed rule re-derives once, a removed one drops the field from the pages),
-`controller/buildIndexCaptionTrack.test.ts` +1, editor `app/channels/components/parseChannelForm.test.ts`
-3 (D2's 6 left with its revert and live on `r20/twitch-ids`). The whole common suite 3,661/3,661 with D2 in
-(release 21 D2's tests included), and after the revert the touched index, normalize, caption-track and architecture tests 54/54, tsc clean; editor unit 228/228; export unit 118/118;
-mcp 293/293; `archilyzer docs files --check` and `docs env --check` clean. E2E, one run in the foreground (start of the queue after the heavy slot freed): `transcript-source.spec.ts` (D3's index spec, 4) and `ops-api.spec.ts` (13, the channel-config round trip among them) — 17 passed, 1.5 min. Release end per the plan: the full editor suite once, the orchestrator's.
-
-### Slice D2, as shipped — option (b) (release 23 F1)
-
-**Ruled 2026-10-10: option (b).** The published `v<n>` stays; the join normalizes on the directory side. Built on
-`r23/fixes` (release 23 Lane 1); the held build on `r20/twitch-ids` is not used (its test cases are, without its
-re-keying of records).
-
-**The helper.** `common/lib/videoDirId.mjs` (pure, client-safe; re-exported by `lib/videoId.ts`):
-`twitchVodDirId` (`v<n>` → `<n>`), `twitchVodRecordId` (the reverse), `channelConfigPlatform` (config `platform`, else
-its `url`'s host), `pickVideoDirId`. Its disk half, `lib/videoDir-server.mjs`: `resolveVideoDirId` /
-`resolveVideoDir(channelsDir, slug, recordId, {platform?})`. Plain JS for umtool's bare-node scripts (the
-`detectPlatform.mjs` precedent; both exported by exact path from common's `package.json`).
-- An id that is not `v<digits>` passes through with no read.
-- A `v<digits>` id maps only for a Twitch record: the platform the caller passes, else the channel's config. Any other
- platform's `v`-id (a Rumble slug, a YouTube id that reads `v` + ten digits) is never mapped.
-- The directory that exists wins, `<n>` first, then `v<n>`; with neither, `<n>` (so a fetch-window creates the
- canonical one).
-
-**The join points** (release 20 D2's list, found in the tree):
-- the editor's fetch-window: `fetchWindowAction` and `fetchFullSourceAction` (`videoActions.ts`) name the video by
- its directory from the config read on (cache, saved container, job, revalidated page); the in-flight dedupe asks
- under both ids. The batch planner (`videos/fetchWindowsAction.ts`) and `controller/fetchWindows.ts` resolve each
- item's directory and keep the item's record id in every result;
-- the evidence-clip tiers (`common/lib/evidenceClip.mjs`, a new async `recordDirOf`; `TierContext.platform`
- optional) and `evidenceClip-server.ts` `recordDuration`, behind reports prepare and report-to-video's local
- sources;
-- `publish/reportMedia.ts`'s per-record availability read (one line);
-- umtool `report-to-video/cues.mjs`'s local cue lookup.
-
-Records and published ids are unchanged; no index re-key.
-
-**Live corpus, offline and read-only** (a script over the channels' data dirs, and a key-only `byChannel` scan of
-the LMDB index opened `readOnly`; counts only): hasanabi 180 records, all `v<n>`, none equal to its directory; the
-plain join finds 0, the helper maps 180 to an existing `data/<n>/`, 0 unmatched. shondo-twitch 37: plain 0, helper 37,
-0 unmatched.
-
-**Found and left (other owners or outside D2's list):** these still join a record's id to `data/<id>/` directly and
-miss a Twitch citation: `publish/composeReports.ts` `readCitedRecord` (Lane 2's file this release: a report citing a
-Twitch `v<n>` record reads no record), `lib/report/convert-server.ts` (report convert's cue read), umtool
-`lib/projects/report.mjs` (`cuePathFor`, and the duration probe in `clipWindowDirs`) and
-`report-to-video/check-availability.mjs` (`cueMeta`). Each is one `resolveVideoDir` call.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `5f1f4c0a` | `common:` F1 — the helper, the join points, the tests |
-
-**Gates.** tsc clean (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`). New tests:
-`lib/videoDirId.test.ts` 6 (D2's id cases, the platform rule, the pick order, the disk resolver over a temp corpus),
-`lib/evidenceClip-server.test.ts` +1 (every tier and the duration clamp through `data/<n>/`; a non-Twitch channel's
-`v`-id is not mapped), `publish/reportMediaTwitch.test.ts` 1 (cached, gone and missing citations; ids as cited —
-fails without the availability line), `controller/fetchWindows.test.ts` +1 (cache hit and fetch under `<n>`),
-editor `videos/fetchWindowTwitch.test.ts` 2 (both editor doors), umtool `cues.test.mjs` +1. Common suite 3,681: 3,670
-pass, 11 fail — the same 11 fail on `d3296bab` without this change (`attachMedia.test.ts` 8, `preparePlayable.test.ts`
-2 — environment — and `fetchPosts.test.ts` 1, a drain timing that passes alone). Editor unit 239/239;
-`test:scripts` 759 pass, 3 skipped, 0 fail (the cwd-join trace guard among them).
-
-#### F1b (release 23) — the four remaining readers
-
-F1's found-and-left list, closed after both lanes merged into `r23/integration` (`88c767ec`; `r23/fixes`
-fast-forwarded to it). Each joined a record's id to `data/<id>/` directly; each now resolves the record's
-directory, and every record keeps the id it is cited by:
-- `publish/composeReports.ts` `readCitedRecord` — compose's read of a cited record (Lane 2's file; one call);
-- `lib/report/convert-server.ts` `diskCuesOf` — the report converters' cue read;
-- umtool `lib/projects/report.mjs` `cuePathFor` and `clipWindowDirs`' cue-duration probe (`cuePathFor` is
- synchronous and has seven callers, so `lib/videoDir-server.mjs` gains `resolveVideoDirIdSync` /
- `resolveVideoDirSync`, the same rule);
-- umtool `report-to-video/check-availability.mjs` `cueMeta` (now exported, for its test).
-
-| Commit | What |
-|---|---|
-| `70ed4ae5` | `common:` F1b — the four readers, the synchronous resolver, a test per reader |
-
-**Gates.** tsc clean. New tests, each a Twitch `<n>` directory read through a `v<n>` record, ids asserted unchanged:
-`publish/composeReportsTwitch.test.ts` 1 (and a non-Twitch channel's `v`-id is not mapped), `bin/reports-convert.test.ts`
-+1, umtool `lib/report/raw-cache.test.mjs` +1 (`cuePathFor`, and `clipWindowDirs`' window and saved source with its
-cue duration), umtool `report-to-video/check-availability.test.mjs` 1, `lib/videoDirId.test.ts` +1 (the synchronous
-resolver). The compose, convert and umtool cases fail with the joins taken out (2 + 1). Common suite with
-`TMPDIR` on `/home`: **3,702/3,702** — the 10 `attachMedia`/`preparePlayable` reds of F1 and F4 were `/tmp`'s 1.7 GB
-tmpfs against attachMedia's 2 GiB free-space margin, not code. `test:scripts` 771 pass, 3 skipped.
-
-### D3's found-and-left, as shipped (release 23 F4) — the stats cache sees the caption-track pass
-
-Release 23 Lane 1, on `r23/fixes`. D3 left it: the caption-track pass re-reads a record's cues and writes the same
-`mtimes` record back, so `buildStats` (keyed on that record, `indexSignature`) kept `hasTranscript: false` and the
-old `cueCount` for a record the pass took from no text to text.
-
-**What it does.**
-- `buildIndex.ts`: the `mtimes` record gains `cueFingerprint` (`cueFingerprint(list)`: `"<count>:<last cue end>"`,
- `"0"` for none — the two cue facts a stat is made of, `cueCount` and coverage), written on every (re)process. Any
- pass that re-reads a record with no input moving (caption track, alt tracks, platform labels) moves it when the
- cues it stores differ.
-- `buildStats.ts`: `indexSignature` appends `cues=<fingerprint>` only when the record has one. A record written before
- it gives the old string exactly, so the rollout recomputes nothing by itself; a record the index rewrites from then
- on (the pass's included) recomputes once.
-- **The records a pass already left stale** (the v1 caption-track pass ran on records before this): a cached stat that
- says no transcript while the index holds a non-empty cue list under its key is recomputed (`statMissesStoredCues`,
- the stored value's length, no decode — `storedCuesEmpty`'s test), asked only of stats that say no transcript. It
- heals the no-text-to-text case at the first stats build after the rollout; a text-to-other-text change the v1 pass
- already made (a cue count that moved) is not reached by it.
-- Not chosen: the caption-track rule version in the signature — it would recompute every stat when the rule moves,
- and a rule bump also marks every caption `transcript.cues.json` stale to umtool and normalize.
-
-| Commit | What |
-|---|---|
-| `e43f6e4c` | `common:` F4 — `cueFingerprint` in the index record and the signature; the stale-stat heal |
-
-**Gates.** tsc clean. `controller/buildStats.test.ts` 17/17 (+4, through the real `buildIndex` and `buildStats`):
-(l) a record the pass takes from no text to text (stored cues empty, the pass due) recomputes, once; (l2) a pass that
-changes a two-track record's cue count (1 → 2, `hasTranscript` true both times) recomputes — red with the fingerprint
-taken out of the signature; (m) a stale cached stat (no transcript, cues held, the same key) is healed, a video with
-no cues is not asked again, then nothing; (n) an old record's signature is unchanged by the field's absence. Common
-3,690: 3,680 pass, 10 fail — the same `attachMedia` 8 and `preparePlayable` 2 that fail on `d3296bab` (environment:
-`/tmp` is a 1.7 GB-free tmpfs here). Editor unit 243/243; `test:scripts` 767 pass, 2 skipped; export unit 118/118;
-homepage unit 23/23.
-
-## As it went
-
-**The whisper red: "Clear failure list" unmounted its own log** (`r20/whisper-fix`). `whisper.spec.ts:184`
-failed 3/3 as a whole file on `r20/integration` in start mode (it passed alone with `-g`, and in release 19's dev
-runs). Not a release 20/21 regression and not the harness: `FailedTranscriptionsSection` (TranscribeStage.tsx)
-rendered the clear controls — the `StreamActionLog` among them — only while `ids.length > 0`, so the refresh
-`StreamActionLog` fires at the end of its own run re-rendered the section with an empty list and dropped the log
-with "Cleared 2 entries" in it, the case plans/FACTS.md's "A run log lives in the panel's React state" rules out.
-Under `next dev` the slow refresh left the text up long enough for the assertion; `next start`'s fast one did not.
-The fix is DiagnosticsStage's: a `ran` flag set on click keeps the block mounted for the page's life, its button
-disabled at (0). Whole file 10/10 three runs in start mode; tsc clean; editor unit 237/237.
-
-## Rollout
diff --git a/plans/release-21.md b/plans/release-21.md
@@ -1,434 +0,0 @@
-# Release 21 — playable archives: local media for held videos, WebTorrent playback on the sites
-
-Written 2026-10-09. Pilot: the TISM (The Incredible Salt Mine) v1 torrent archive →
-`the-incredible-salt-mine` (a Jeralyzer member channel). Two outcomes:
-
-1. **Agents can clip TISM** — every held TISM video gets its media on disk, through the editor, so
- `fetch_clip` / `fetch-windows` / `reports prepare` / report-to-video cut it locally.
-2. **Readers can play TISM** — the site plays the video in the transcript page (click-to-seek works) from a
- torrent. Nothing is hosted on Cloudflare: the bytes come from peers, and a home seeder behind a VPN is the
- **peer of last resort** — it seeds a torrent only while no other seeder has it.
-
-## Rulings (operator, 2026-10-09)
-
-- **Pilot on `jeralyzer-private` first**; public Jeralyzer is a later, separate ruling.
-- **No web seed, no R2.** A **home seeder only**, behind a VPN, with an app layer that seeds a torrent only when no
- other seeder exists (peer of last resort). Accepted consequence: a torrent with no other seeder plays only while
- the home seeder is up.
-- **ASR for the 3 new videos only** (`pnpm ops transcribe-one`); the other 161 keep their YouTube captions.
-- *Open:* the attribution line for the archived copy on the video page (the archive's README names its maker and
- sources). Records state facts; the wording is the operator's.
-
-## What is there (measured 2026-10-09)
-
-| | |
-|---|---|
-| Archive | `<archive drive>/v1-torrent/`: `Uploads/YouTube.zip` (36.5 GB, **stored**, 183 folders), `SoundCloud.7z` (2 mp3: TISM001/002), `3rd-party-Odysee.7z` (2 mp4, solid LZMA2), `Images.7z`, `Official-page-archives.7z`, `README-v1.html` |
-| YouTube.zip folders | 183: **169 with media** (36.4 GB, **222.7 h**), 10 `[LOST]` (source.txt only), 4 others without media; 33 carry an archive.org `youtube-<id>_archive.torrent`; each folder has yt-dlp `.info.json`/`.description`/thumbnail, or `description.txt` + `source.txt` |
-| Codecs (ffprobe, in place) | 124 mp4 h264/aac with the **moov at the back**, 21 mp4 h264/aac faststart, 9 webm vp9/opus, 11 mkv vp9/aac, 2 mkv h264/opus, 1 mp4 av1/aac, 1 mkv av1/opus. Heights: 109×360p, 35×720p, 21×1080p, 4×144p |
-| Corpus | `the-incredible-salt-mine` (handling youtube, the channel is deleted): 171 videos, each `metadata.info.json` + cues (161 YouTube VTT, 10 `transcript.json`), **no media**. All 171 ids are in the archive. 3 archive videos with media are **not held**: `6ijPdSuZdws`, `VcFA_LOnQoc`, `xLgf_MGQzXk` |
-| Disk | the archive drive has 849 GB free; the saved-video store already lives on it (`archilyzer-media/saved-videos`) |
-
-## Gaps in the code (verified)
-
-- **No local-file ingest.** Every import takes a URL or an archive.org identifier (`import-one`,
- `import-archive-org`); `sourceKind` is `video | social`. Only the downloader attaches a container to a held
- record (`persistSourceVideo`, `common/lib/savedVideo-server.ts:102`).
-- **A clip window never reads a saved container.** `fetchWindowAction`
- (`editor/app/channels/[slug]/videos/[id]/videoActions.ts`, ~1080) asks `findContainingClipWindow`, then the
- network; only `full: true` returns the saved container (~1259), and only `evidenceClip-server.ts` (reports
- prepare, report-to-video) cuts from it. For a deleted channel, a window request fails every time today.
-- **The sites already play files and seek**: every player behind `PlayerProvider.tsx` exposes `seekTo`, and cue
- rows call it (`TranscriptModal.tsx` `CueRow`), so click-to-seek needs nothing new.
-- **No torrent code beyond archive.org ingest** (aria2c, `archiveOrgTorrent*.ts`). No WebTorrent anywhere.
-- **The export site ships a root-scope service worker** (`export/service-worker/site-sw.js`). WebTorrent 2's
- browser streaming needs a service worker (`client.createServer({ controller })`), so the two must be one worker.
- The site sends no CSP, so wss trackers and blob media are not blocked.
-
-## Slices
-
-### D1 — attach local media to held videos `[unit]` (clippability; nothing public)
-
-- `common/controller/attachMedia.ts` + job kind `attach-media` (drainable, `needsMedia`), ops action
- `attach-media {slug, source, items?:[{id, path}], match?, createRecords?, dryRun?}`, CLI `archilyzer media attach`.
-- **Sources:** a directory, or a **zip read in place** (a stored entry is copied straight out, no temp dir; a
- deflated or 7z entry is extracted to a scratch dir on the target disk first). The id comes from the folder's
- trailing `(<11-char id>)`, else the media file's `-<id>.` suffix, else an explicit item. `dryRun` lists matched,
- unmatched, already attached, not held and `[LOST]`.
-- **Writes** through `persistSourceVideo` (the one writer): the container into the saved-video store as
- `source-media.<ext>`, `keepReason: "pin"`, a new `origin: {kind: "local-archive", archive, entry, sha256,
- attachedAt}` (which archive, which entry, its hash). Refuses over an existing pointer unless `replace`; never
- modifies the archive. Guards: `assertSavedVideosStoreWritable`, the media-reachable guard.
-- **Not held** (the 3): `createRecords: true` writes `metadata.info.json` from the folder's yt-dlp `.info.json`
- (else from `description.txt`/`source.txt`, the title from the folder name), then `pnpm ops transcribe-one` for each.
-- `[LOST]` folders are listed, never attached.
-
-### D2 — clip windows cut from a saved container `[unit]` + `[spec ops-api]`
-
-- In `fetchWindowAction`, after the clip-window cache and BEFORE the network: when the video has a saved container
- covering `[from − pad, to + pad]`, cut the window locally (evidenceClip's ffmpeg path), write it into
- `data/<id>/clips/` like a fetched window with provenance `{source: "saved-video"}`, and answer `cached: true`.
- `fetch-windows` batches then use no network for such videos. Helps every persisted video, not only TISM.
-- `mcp/src/instructions.ts`: a video held locally is cut without a fetch.
-- Starts after release 19's A5 merges (A5 edits the same fetch-window code: dedupe + queue key).
-
-### D3 — streamable copies + torrents `[unit]`
-
-- `common/lib/playableMedia.ts` picks a **lossless** remux (`-c copy`) per container: h264/vp9/av1 + aac/opus → mp4
- `+faststart`; vp9/av1 + opus in webm stays webm. 169 copies, ~36 GB, on the archive drive under
- `archilyzer-media/playable/<slug>/<id>/<id>.<ext>`, keyed by the source's sha256 (a re-run is a no-op).
-- One **single-file torrent per video** (`create-torrent`, from the WebTorrent ecosystem): piece length scaled to the
- size (256 KiB–1 MiB), no `urlList`, `name` = `<id>.<ext>`, no `comment`/`createdBy` naming a person or a private
- URL. The announce list is not in the info dict, so the infohash depends only on the bytes. The pilot announces
- only to a **self-hosted tracker**, so nothing public learns the infohashes. Going public later means adding public
- WSS trackers (browsers) and UDP trackers (desktop clients) to the magnet: same infohash, no re-hash.
-- Job kind `prepare-playable` (heavy: runs in release 19 B1's `pnpm heavy` slot once that lands).
-
-### D4 — publish the torrents `[unit]`
-
-- `site.json` gains `playable: { channels: string[], trackers: string[] }` (schema + SITE.md regenerated): the
- channels whose records carry a torrent, and the announce URLs that site's magnets name (the pilot: the
- self-hosted tracker only).
-- The index stage writes `.export-index/sites/<id>/playable.json` (id → infohash, magnet, mime, bytes). The site's
- `inputSig` includes it, so adding a torrent makes the build stale. No media bytes leave the machine.
-- Compose: records of a playable channel gain `playable: {magnet, infoHash, mime, bytes}` in the published JSON;
- each `.torrent` ships in the bundle (`/t/<id>.torrent`, ~170 small files, within the 15,000 cap).
- `corpus.json` / `llms.txt` name the field.
-
-### D4b — the seeder: peer of last resort, behind a VPN `[unit]` + a manual network test
-
-- `archilyzer seed`, a long-running node service: WebTorrent 2 in node, with WebRTC via `node-datachannel` so it
- serves browsers, and TCP/uTP for desktop clients. It seeds the playable manifests of the sites named in settings
- (`seeder: { sites, maxUploadKiBps, maxConnections, pollSeconds, standbyAfterSeconds }`, SETTINGS.md regenerated).
-- **Last resort**, per torrent: the seeder polls the trackers' scrape (`complete`, minus itself) and its own peer
- view.
- - Other seeders present for `standbyAfterSeconds` → **standby**: stop announcing, close peers, keep the data.
- - No other seeder (`complete` = 0) while a leecher announces, or a connected leecher with no other source → resume.
- - Both edges have hysteresis, so it does not flap, and the log names each transition and why.
- - Known cost: if the last other seeder leaves mid-stream, the viewer stalls for up to `pollSeconds` until the
- seeder resumes.
-- **Behind a VPN, with no way around it:** the seeder runs in its own network namespace or container whose only
- route is the VPN tunnel (a docker compose profile `seeder` with a WireGuard sidecar). Kill switch: tunnel down
- means no network, never the home connection. ICE gathers candidates only from the tunnel interface, so WebRTC
- never offers the home address (the classic WebRTC leak). `archilyzer doctor` reports the seeder's egress IP
- against the host's and refuses to call the seeder healthy if they match.
-- **The risk to measure first:** whether the VPN's NAT lets browser peers connect directly (UDP hole punching).
- If it does not, the options are a VPN with port forwarding or a TURN relay. That is a ruling, not a default.
-- Manual network test (recorded): a browser on another network plays a torrent through the seeder, and the
- seeder's candidates and the tracker's view of its address show only the VPN exit.
-
-### D5 — the player `[unit]` + `[spec]` (export e2e)
-
-- `common/components/TorrentPlayer.tsx`: WebTorrent 2 (npm, bundled, dynamically imported only on a playable record),
- `client.add(magnet)` → streamed into a native `<video>` through the service worker; the same
- `seekTo`/`onReady`/`onProgress` shape as `FilePlayer`.
-- **One service worker:** `site-sw.js` gains WebTorrent's stream handler on its own path prefix (no second
- registration); sites with `pwa: false` register a minimal worker for it alone.
-- **Choice rule in `PlayerProvider`:**
- - A playable record whose platform copy is gone (`isDeleted`/unavailable, as for all of TISM) plays the archived
- copy by default.
- - A record whose embed still works shows "Play archived copy".
- - There is no file fallback: with no peer after a timeout, the player says no one is seeding it right now and
- offers the magnet and `.torrent` ("seed this").
- - A status line shows peers and download rate.
-- e2e: a fixture torrent (a few seconds of video) seeded by a node WebTorrent peer the export e2e starts, announced
- to a local tracker the e2e starts. Checks: it plays, a cue click seeks, and the no-peer state shows once the seed
- is stopped.
-
-### D6 — the rest of the archive `[none]` → `[unit]`
-
-- SoundCloud TISM001/002 (audio) and the two Odysee mirrors: a dryRun maps them to held episodes by title and
- duration; each is attached as alternate media or skipped, by operator ruling. `Official-page-archives.7z` and
- `Images.7z` are out of scope.
-
-## Graph and order
-
-```
-D1 (attach) ──► D2 (window cut; after release 19 A5) ← agents can clip TISM from here
-D1 ──► D3 (copies + torrents) ──► D4 (publish torrents) ──► D5 (player) ──┐
- └──► D4b (seeder + VPN) ─────────────────────┴► pilot on jeralyzer-private ──► public ruling
-```
-
-D1, D3 and D4b touch no file owned by tracks A/B/C and may start now. D2 waits for A5. D4 and D5 wait until release
-19 merges (the ops routes, `_cli.ts`, the `site.json` schema docs).
-
-## Record
-
-### Track D
-
-One Opus implementer, branch `worktree-agent-a4b4aebbb6c0d28bb` off `5bc20d32` (`r19/integration` with this plan),
-`r19/integration` merged in before this record (`2e3a9395`: tracks B and C — the docs cli, the heavy slot). Slices
-D1, D3, D4b, in that order; D2, D4, D5 are not this track's. Nothing ran against the real corpus or the real
-archive beyond read-only listings of the archive's central directory (`unzip -l`, `zipinfo`, and the new zip
-reader over it); every fixture is synthetic.
-
-#### D1, as shipped — attach local media to held videos
-
-**What was found before building.**
-- The archive is ZIP64 (790 entries, 36.45 GB, every entry stored): its later offsets do not fit 32 bits. No zip
- library is in the workspace, so `common/lib/zipReader.ts` reads the central directory itself (EOCD, the ZIP64
- locator and record, the 0x0001 extra, the Info-ZIP Unicode-path extra) and copies a stored entry as a byte range
- of the archive, a deflated one through `inflateRaw`, checking the size and CRC32 against the central directory.
- Over the real archive (read-only) it lists the 790 entries and their byte total matches `zipinfo`'s exactly.
-- One media file name in the archive is non-ASCII (a full-width `|` and `?`); the folder's `(<id>)` names it.
-- The archive's folder classes, from the listing alone (no corpus read): 182 folders with files, 169 with media,
- 10 `[LOST]`, 2 with an id and no media, and the archive's root (no media, no id).
-- `persistSourceVideo` MOVES `<videoDir>/<sourceFilename>`. Copying a 36 GB archive into the corpus SSD first would
- be the wrong disk twice, so it gains `sourcePath` (the file to move, a staging file beside the store dir on the
- store's disk — a same-filesystem rename) and `sha256` (recorded when the caller hashed while copying).
-- Every consumer of `SavedVideoOrigin` reads `requestedBy` as required (the video page's "Requested by", the clip
- requester line in `videoActions.ts`, which this track may not touch). So the local-archive origin keeps
- `requestedBy: "attach-media"` and adds `kind: "local-archive"`, `archive`, `entry`, `sha256`, `attachedAt`;
- `parseOrigin` reads them only under that kind, and a pointer without `kind` parses exactly as before.
-- The non-yt-dlp writer of `metadata.info.json` for a new record is `withMetadataHistory` around
- `writeJsonAtomic(…, {indent: 0, newline: false})`, as `archiveOrgDownload` writes its records; a new writer
- `local-archive` joins `METADATA_HISTORY_WRITERS`.
-
-**What it does.** `common/lib/attachMediaPlan.ts` (pure): folders grouped by parent; the id from the folder's
-trailing `(<11-char id>)`, else the file's `-<id>.`, ` [<id>].` or bare `<id>.`; classes `attach`, `create`,
-`already-attached`, `not-held`, `lost`, `no-media`, `unmatched`, `ambiguous` (two video files in a folder, or two
-folders claiming one id), plus the held videos no folder supplied (only when the whole archive was considered).
-`common/controller/attachMedia.ts`: sources are a directory, a `.zip` read in place, or a `.7z` (listed with
-`7z l -slt`, one entry extracted with `7z e -so -spd` into the staging file); the store's root must exist (an
-unmounted drive is never materialised), `assertSavedVideosStoreWritable` before each copy, size plus 2 GiB free
-on the store's disk or the run stops (a re-run resumes); drain and cancel between videos, a cancel aborts the copy
-and removes its staging file; `keepReason: "pin"`; refuses over a pointer unless `replace` (a replaced container of
-another name is removed after the new pointer is written). `createRecords` writes the folder's own yt-dlp
-`.info.json` (refused when its `id` is another video's) or one built from `description.txt` ("Published on …" →
-`upload_date`, last key) and the folder name, the duration from ffprobe, and appends `youtube <id>` to the
-channel's `archive`. The log ends with `summary: {…}`. Job kind `attach-media` (drainable, `needsMedia`, an ingest
-kind — its pointers and records are what the index reads; not replayable; the channel's queue). The action is
-`editor/app/channels/[slug]/attachMediaActions.ts` (a new file); `POST /api/ops/attach-media` on the `_lib.ts`
-precedent; one `ACTIONS` entry and one usage paragraph in `scripts/archilyzer-ops.mjs`; `archilyzer media attach
-<slug> <source>` (offline; asks the channel's media guard itself).
-
-#### D3, as shipped — playable copies and torrents
-
-`common/lib/playableMedia.ts` (pure) is the decision table: h264/vp9/av1 with aac/opus/mp3 (or no audio) → mp4
-`+faststart`; vp9/vp8/av1 with opus/vorbis in a `.webm` → webm with `-cues_to_front 1`; anything else (HEVC,
-MPEG-4 Part 2, AC-3 audio, no video) is listed as not playable, never re-encoded. Only the first real video stream
-(`0:V:0`, not cover art) and the first audio are kept; subtitles, data, global metadata and chapters are dropped;
-`+bitexact`, so the same source remuxes to the same bytes (tested). The measured mix in this plan is every row of
-the table's playable half. `common/controller/preparePlayable.ts`: copies, torrents and `playable.json` under
-`playable/<slug>/<id>/` beside the saved-video store's real directory (or `root`); keyed by the source's sha256 (a
-pointer with none is hashed once and the hash recorded on it), so a re-run with the files on disk at their size is
-a no-op; each copy written to a `.part` and renamed; the manifest rewritten after each video. Each remux takes the
-heavy slot (`scripts/queue-lock.mjs --heavy`, release 19 B1) per video, so a long run interleaves with builds and
-e2e; a checkout without the gate runs ffmpeg directly. **The torrent:** `create-torrent` with `name` `<id>.<ext>`,
-piece length a power of two in 256 KiB–1 MiB scaled to ~2,048 pieces, a fixed creation date, the announce list from
-the `trackers` parameter (an explicit empty list, never create-torrent's default public trackers), and NOT passed:
-`createdBy`, `comment`, `urlList`, `private` — even `private: false` would put `private: 0` inside the info dict and
-move the infohash. Tested: same bytes and piece length → same infohash whatever the path or the trackers; another
-piece length → another; the .torrent byte-identical across runs. Job kind `prepare-playable` (drainable,
-`needsMedia`, ingest — D4's build reads the manifest; one `playable` queue machine-wide), `POST
-/api/ops/prepare-playable`, one ops row, `archilyzer media playable <slug>`.
-
-#### D4b, as shipped — the seeder of last resort, behind a VPN
-
-- **The state machine** (`common/lib/lastResortSeeder.ts`, pure): a torrent starts seeding; other seeders (the
- scrape's `complete` minus itself, or connected seeds, whichever is more) on every poll for `standbyAfterSeconds`
- → standby; in standby, no other seeder and a leecher waiting (the scrape's `incomplete` or a wire) → seeding at
- once, or no other seeder on every poll for the resume window → seeding; trackers silent for the window while in
- standby → seeding (a last resort assumes it is the only one). A transition restarts both clocks. The resume window
- is `standbyAfterSeconds` (no separate key). 13 tests against a scripted scrape: both edges, hysteresis on each,
- a flapping swarm that never flaps it, the plan's rollout step 7 as a script.
-- **The service** (`common/controller/seeder.ts`): WebTorrent 3 in node — TCP, and WebRTC through
- `webrtc-polyfill` → `node-datachannel` (WebTorrent's own dependency chain). Standby removes the torrent from the
- client with its data kept (`stopped` announced, peers closed); seeding adds it back with `skipVerify` after a
- size check of the copy. No DHT, LSD, UPnP/NAT-PMP or web seeds. Scrapes are one request per tracker for every
- infohash, merged per torrent by max; wires are counted by peer (two peers that dialled each other hold two
- wires — found by the integration test, which first saw "2 other seeders"). `bindInterface` held: the seeder
- waits for it and drops every torrent when it disappears. Targets are re-read each poll from the playable
- manifests of every channel of `settings.seeder.sites`.
-- **The tracker** (`archilyzer tracker`): bittorrent-tracker, HTTP + WebSocket, no UDP, no stats page, bound to
- `--host` (default 127.0.0.1), refusing every infohash not in the manifests (re-read at most once a minute).
-- **Settings** `seeder: {sites, trackers, maxUploadKiBps, maxConnections, pollSeconds, standbyAfterSeconds,
- bindInterface}` (`common/lib/seederSettings.ts`, SETTINGS.md and settings.json.example regenerated); not
- configured = `sites: []`, and `archilyzer seed` refuses to start.
-- **The VPN** (`docker-compose.seeder.yml`, profile `seeder`, an overlay on `docker-compose.yml`): gluetun
- `v3.41.3` (custom provider, WireGuard; its firewall is always on in v3 — there is no switch, and the file names
- none), the seeder and the tracker with `network_mode: service:seeder-vpn`, no networks or ports of their own,
- waiting for a healthy tunnel, the corpus read-only. The WireGuard config is the operator's: `${SEEDER_WG_CONF:?…}`
- mounted read-only — compose refuses the file without it (checked with `docker compose … config`). Inbound only
- through `SEEDER_VPN_INPUT_PORTS` (empty by default). `lib/seederCompose.test.ts` pins that construction.
-- **Doctor** `seeder` section: "seeder not configured" (a note, no network) while `sites` is empty; else the host's
- egress address and the seeder container's (`docker exec archilyzer-seeder-1 node -e fetch(…)`, one echo URL):
- the same address FAILS, either unanswered warns, different is ok.
-- **Measured (localhost, the integration tests):** a TCP leecher completes from the seeder; it then seeds, the
- seeder logs `seeding → standby — 1 other seeder(s) on every poll for 1s`; the leecher leaves and it logs
- `standby → seeding — no other seeder on every poll for 1s`. A WebRTC leecher completes through the WebSocket
- tracker over a `webrtc` wire (node-datachannel). Two node peers that announce in the same instant each answer the
- other's offer and each keep the connection the other dropped; the test starts the leecher after the seeder's
- announce is in, as a browser arriving at a running seeder does.
-- **Not measured, owed to the rollout:** whether the VPN's NAT lets browser peers connect (the plan's risk), and
- the manual network test. WebTorrent's default `rtcConfig` asks public STUN servers for the seeder's address:
- inside the profile that address is the VPN exit; on a bare host it would be the home address — run it in the
- profile.
-
-**New dependencies (common):** `create-torrent` 6.1.3, `parse-torrent` 11.0.24 (D3: the torrent and its
-infohash), `webtorrent` 3.0.21 (node ≥ 22; the repo runs 22.23), `bittorrent-tracker` 11.2.3 (D4b). Types for the
-four are `common/types/webtorrent-modules.d.ts` (they ship none). `pnpm-workspace.yaml` `allowBuilds`:
-`node-datachannel: true` (its prebuilt binary); `bufferutil`, `utf-8-validate`, `utp-native`, `ip-set` false (pure-JS
-fallbacks, optional uTP, a package-manager check).
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `9686fe67` | `common:` attach-media — zip reader, plan, controller, origin kind, `sourcePath`, job kind, ops route + action, ops row, CLI; 33 tests (31 common, 2 editor) |
-| `f1370406` | `common:` prepare-playable — decision table, remux, torrents, manifest, job kind, ops route + action, ops row, CLI; 13 tests (11 common, 2 editor) |
-| `2f704bc6` | `common:` the seeder — state machine, service, tracker, settings, compose profile, doctor; 26 tests |
-| `2e3a9395` | merge `r19/integration` |
-| `0f79dd6e` | `common:` each remux takes the heavy slot (per video; 1 test); COMMANDS.md regenerated |
-| `c066fb37` | `common:` the plan test's titles and ids synthetic throughout |
-
-**Gates.** `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` clean at each commit and after the
-merge. Common 3,530 / 3,533 at `2f704bc6` (+68 over the base, 3,465): the three failures are two `autoRunner.test.ts`
-cases (`computeLeafPending …`, `a channel with a move marker …`) that fail identically with the base's
-`jobKinds.ts`, and `fetchPosts.test.ts`'s drain case, which passes alone (load). Editor 163/163 (+4 route tests).
-`test:scripts` 676 + 3 skips at `2f704bc6`, one `queue-lock` banner case failing under load and passing alone (11/11).
-No builds, no e2e (none in this track's budget). After the merge, an operator hold (no heavy runs) left only tsc
-and single test files: preparePlayable 5/5 (the heavy-slot gate included), cli-docs + jobKinds 21/21, and (before the merge) the settings/doctor/CLI/env tests 95/95.
-
-**Left.** `COMMANDS.md` gains the four rows (`media attach`, `media playable`, `seed`, `tracker` — regenerated
-after the merge brought `docs cli`). The rollout's dryRun on the live editor is the parent's. Transcription of
-the three new records is the operator's (`transcribe-one`), as ruled. D2, D4, D5 are other slices.
-
-**Landed with release 19** (2026-10-09 evening; release-19.md, "Landing, as it went"): D1, D3 and D4b in
-`r19/integration`, under its gates — the whole common suite 3,634/3,634 (the `fetchPosts` drain case among them),
-`test:scripts` 708 + 3 skipped, four builds, the full editor suite (start mode) green after re-running three load
-flakes alone. The pilot below waits for D2.
-
-#### D2, as shipped — clip windows cut from a saved container
-
-Release 21's D2, on `r20/d2-r20` off `r20/integration` (`585be292`), overnight 2026-10-10 (Track D, part 1).
-
-**What it does.** `common/lib/savedVideoWindow-server.ts`: `savedWindowSource` reads the video's saved-video
-pointer (any pointer — a persist, a `full: true` fetch, a D1 `local-archive` attach), stats the container through
-the drive watchdog (`onDrive`) and probes it once (`probeMedia`), answering `none` (no pointer), `unreadable`,
-`not-covering` (the window ends past the container's duration, to `WIN_EPS`) or `covers`; `cutSavedVideoWindow`
-cuts with evidenceClip-server's `evidenceCutArgs` (input-seeked, H.264 + AAC mp4 fitted inside 1280×720; a container
-with no picture is cut as sound) to a temp name, renames it to `clips/<from>-<to>.mp4`, and writes the fetched
-sidecar shape (`requestedBy`, `manifest`, `clipId`, `reason`, `requestedAt`, `pad`, `bytes`, `fetchedAt` = when it
-was cut) plus `source: "saved-video"` — a new optional `ClipProvenance.source` that `parseClipProvenance` reads;
-absent on every fetched window.
-- **Single** (`fetchWindowAction`): the clip cache, then the in-flight jobs (A5), then the saved container, then
- the network. `covers` → the channel's text guard (`assertChannelTextReadable`, which a `fetch-window` job's
- `needsText` would have asked), the cut, `cached: true` with the window's probed `height`, no job. `unreadable` →
- 503 with the media guard's sentence (`Channel "<slug>": media is not reachable — its saved video <path> is not
- there (drive not mounted?)`, or `… could not be read by ffprobe`, or the watchdog's `drive not answering …`), or
- the store guard's (`SavedVideosStoreInTransitionError`) when the file is missing while the store's move marker
- is present. `none` and `not-covering` → the network path, unchanged. A failed cut → 500 with ffmpeg's last lines.
-- **Batch** (`fetchWindowsAction` → `controller/fetchWindows.ts`): after the cache and the in-flight check, a
- covered window joins one group of its own — platform `saved-video` on `clips:saved-video`
- (`SAVED_VIDEO_CLIP_QUEUE` / `SAVED_VIDEO_CLIP_PLATFORM`, `lib/queueKeys.ts`), which `groupRefusal` does not
- ask about a hold or cooldown; an unreadable one is `unresolved` with the guard's sentence; a not-covering one joins
- its platform's group. The controller asks the same tier for every item before the URL and the gap: a cut costs no
- pause and is not a network attempt (`result.cut`, logged `✂`, and "N cut from saved videos" in the summary);
- `unreadable` fails the item as `unreachable`; a failed cut is the new class `cut-failed` and the run carries on.
- A5's dedupe covers the new queue unchanged: a queued `saved-video` job's items are in its spec.
-- The video page's fetched-windows card adds "· cut from the saved video" to such a window. `mcp/src/instructions.ts`
- (the clip step): "A video the archive holds locally is cut from its saved copy without a fetch (cached at once)."
-
-**Rulings applied.** No pointer → the network exactly as before; a pointer whose container is unreadable → refused,
-never a fall-through; a container that does not cover the window → the network (orchestrator, 2026-10-10).
-
-**Found and left.**
-- A local cut is at most 1280×720 (evidenceCutArgs' box), whatever `maxHeight` asks; the answer carries the window's
- `height`, as a cached window's does. A smaller `maxHeight` gets a cut taller than it asked for.
-- `ops-api.spec` cannot reach a cut: the e2e server runs with `FFMPEG_BIN`/`FFPROBE_BIN` set to the fixture fakes
- (`editor/package.json` `dev:test`/`start:test`), whose ffprobe answers a bare duration, never `-of json`, so every
- saved container there probes as unreadable. The nearest tests run the real thing instead: the route test cuts
- over HTTP with real ffmpeg, and the action test runs the `saved-video` batch job through `runManagedFunction` to
- `done` (below). No e2e case was added.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `11753809` | `channels:` release 21 D2 — the saved-container tier in the single and batch window paths, `ClipProvenance.source`, the `clips:saved-video` queue, the card's marker, the MCP line; 18 tests |
-
-**Gates.** `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` clean. New tests, all real ffmpeg over
-8 s lavfi containers in temp dirs: `lib/savedVideoWindow-server.test.ts` 9 (no pointer; not covering; a missing
-container; an unmounted store dir; the store mid-move; a file ffprobe cannot read; the cut and its sidecar, read
-back by the clip cache; sound only; a failing ffmpeg leaves nothing), `controller/fetchWindows.test.ts` +2 (cut /
-unreadable / not-covering in one run with no request and no pause; a failed cut), `app/api/media/fetch-window/
-route.saved.test.ts` 4 (a covered window → 200 `cached: true`, `provenance.source` `saved-video`, height 90, no job,
-then a clip-cache hit; past the container's end → the network door, a YouTube cooldown's 409; a missing container
-→ 503 with the guard's sentence; no pointer → the network door), `app/channels/[slug]/videos/
-fetchWindowsAction.test.ts` 3 (the dry run's groups and unresolved; a real run whose `saved-video` job ends `done`
-with the window and sidecar on disk while the cooling YouTube group is refused; A5's dedupe on `clips:saved-video`).
-Editor unit 225/225; the touched common files (clipWindow, evidenceClip, savedVideo*, fetchWindows, windowJobs)
-61/61; architecture 6/6; mcp 293/293. The whole common suite runs once at the end of the track (part 2).
-
-### F2 (release 23), as shipped — Transcribe reads a saved container before it downloads audio
-
-Release 23 Lane 1, on `r23/fixes` (from `r23/integration` `d3296bab`). The pilot's step 2 (`transcribe-one` for the
-three videos with media but not held) downloaded audio for a video whose whole source was already in the store.
-
-**What it does.** `controller/transcribeOne.ts` `transcriptionContainer({paths, slug, videoDir, entries})` answers,
-in `resolveAudioFile`'s own order (`findSourceMedia(entries) ?? the saved-video pointer`):
-- `container` — a container with sound: a `source-media.<ext>` in the video dir, else the store's (read through
- D2's `savedWindowSource` over the window [0, 0], so its drive watchdog, store-move check and sentence are the
- same);
-- `no-audio` — the container has no sound stream (`probeMedia`);
-- `unreadable` — a pointer whose container cannot be read, with the guard's sentence (`Channel "<slug>": media is
- not reachable — its saved video <path> is not there (drive not mounted?)`, `… could not be read by ffprobe`, the
- watchdog's, or the store-move sentence);
-- `none` — no container. A `source-media.<ext>` ffprobe cannot read is passed over for the pointer.
-
-`whisperVideoAction` (the video page's Transcribe) asks it when no extracted audio is on disk, before the disk gate
-and the `download-one-audio` path: `container` → no download, the log line `No audio on disk for <id>; transcribing
-from the saved container <file> — nothing downloaded.` (`the source container` for one in the video dir), then
-`transcribeWithWorker` as before, which resolves the same file non-strict; `unreadable` → the job fails with the
-sentence, nothing downloaded; `no-audio` → `The container <file> has no sound; downloading the audio instead.` and
-the download path; `none` → the download path, unchanged.
-
-**`pnpm ops transcribe-one {slug, id}`** reaches this path unchanged: `api/ops/transcribe-one` calls
-`whisperVideoAction` when no `file` is given (with `file`, `transcribeOneAction`, that file through the pool).
-
-**Found and left.** The e2e server's fake ffprobe answers a bare duration, never `-of json` (D2's note above), so a
-saved container probes as unreadable there; the action is proven by an editor unit test with the real ffprobe and
-the e2e fake whisper-cli instead, and `whisper.spec` gets no new case.
-
-**Commits**
-
-| Commit | What |
-|---|---|
-| `1c5793e5` | `channels:` F2 — `transcriptionContainer`, `whisperVideoAction` asks it first; 9 tests |
-
-**Gates.** tsc clean. New tests (real ffmpeg/ffprobe over 1 s lavfi containers): `controller/transcriptionContainer.test.ts`
-5 (saved container with sound; a missing container → the exact sentence; none; a silent container; the video dir's
-container first, a silent one there → download, an unreadable one passed over), editor
-`videos/[id]/whisperFromContainer.test.ts` 4 through `runManagedFunction` (present → `done` with a transcript from
-the fake whisper-cli and no yt-dlp run; a gone container → `failed` with the sentence and no yt-dlp run; none and
-silent → the download path's yt-dlp, a fake that records its argv and fails). E2E, start mode (the editor's e2e
-build rebuilt through the heavy slot, so the editor build is green with F1 and F2): `whisper.spec.ts` 10 passed,
-25.4 s.
-
-## Rollout (pilot)
-
-1. `pnpm ops attach-media --json '{"slug":"the-incredible-salt-mine","source":"<archive>/Uploads/YouTube.zip","dryRun":true}'`.
- Expect about 166 held and matched, 3 with media but not held (`6ijPdSuZdws`, `VcFA_LOnQoc`, `xLgf_MGQzXk`) and
- 10 `[LOST]`; the dryRun gives the exact counts, including held videos with no media in the archive.
-2. The same without `dryRun`, plus `createRecords`, then `transcribe-one` for the 3.
-3. MCP `fetch_clip` on a TISM cue → `cached: true`, provenance `saved-video`, no network.
-4. `prepare-playable`.
-5. Start the self-hosted tracker and `archilyzer seed` in the VPN namespace, and check its egress IP.
-6. Build `jeralyzer-private` and deploy it locally.
-7. From a browser on another network: play and seek. A second browser that finishes and seeds sends the home
- seeder to standby; closing it makes the seeder resume.
-8. Public ruling → Jeralyzer (public trackers added to the magnets, same infohashes).
-
-## Verification
-
-- D1: unit tests over a fixture zip (stored and deflated entries, id matching, dryRun, refusing an overwrite,
- provenance).
-- D2: route/action unit tests plus one `ops-api.spec` case.
-- D3: the remux decision table, and torrent determinism (same input → same infohash).
-- D4: a compose test (the field, the `.torrent` files, `inputSig` moves).
-- D4b: the standby/resume state machine against a fake scrape source (both edges, hysteresis), a kill-switch config
- test, and the manual network test.
-- D5: the export e2e above.
-- Privacy: no personal identifier of the archive's maker (donation addresses and the like) in any published file;
- no private site URL in any torrent.
diff --git a/plans/release-22.md b/plans/release-22.md
@@ -1,260 +0,0 @@
-# Release 22 — one article, two shapes: slides, and the isometric overview
-
-Written 2026-10-09. An article (a `report.json`) can be read as the article it is, as a slide deck, or in an
-**isometric overview** that lays the two side by side in one tilted 3-D plane — each section beside its slide —
-so a reader sees the same article both ways and enters whichever they prefer at the same place.
-
-## Rulings (operator, 2026-10-09)
-
-- Articles may be **built a bit differently** to make this work: `report.json` gains authoring fields for slides.
-- **"Isometric render" is the overview described here** (operator confirmed 2026-10-09): a tilted plane pairing
- each article section with its slide; click either to enter that view.
-
-## What is there (verified)
-
-- An article is `report.json` (`common/lib/report/schema.ts`, `validate.ts`, REPORT.md): `kind` `factcheck | sweep`,
- title/subtitle/summary/method, `sections[]` → `claims[]` (`text`, `verdict`, `gist`, `findings`, `citations`),
- markdown bodies citing `[label](cite:<id>)`, `video`, `sources`, `citations`.
-- Two renderers of one view model (`ReportPageView`, `common/lib/report/views.ts`): the export site's
- `export/app/components/reports/ReportArticle.tsx` (route `export/app/reports/[reportId]/page.tsx`, static) and
- umtool's `ArticleReader.tsx`/`ArticleBody.tsx` (`umtool/app/sites/[site]/[report]/page.tsx`, with its own lenient
- resolver `umtool/lib/articles/article.ts` `articleView` for drafts).
-- Shared citation components: `common/components/citations/*` (`CitedMarkdown`, `InlineCite`, `CitationCard`,
- `ReferenceList`), `common/components/report/VerdictChip.tsx`; markdown via `markdown-to-jsx`.
-- Exports: `REPORT_EXPORT_FORMATS` (`views.ts`), `common/publish/reportExports.ts` (`report.html` self-contained via
- `common/lib/report/exportHtml.ts`, `report.pdf` by Chromium), `reportExportFiles.ts`, the downloads table in
- `ReportArticle.tsx`, the revision-history commit (`reportHistory.ts`).
-- View toggles: the transcript `vm`/`vt` URL params (`common/components/urlState.ts`; absent = the default view).
-- **Naming hazard:** "deck" means umtool's video chrome overlay (`umtool/report-to-video/deck.mjs`, `chrome-deck.mjs`)
- and several editor card stacks. This feature is **slides** everywhere: `slides`, `SlideView`, `?rv=slides`.
-
-## Design
-
-### The article gains slide fields (schema, backward-compatible, `version` stays 1)
-
-- `report.slides?`: `{ hide?: boolean, title?: string, closing?: string }` — the deck's own title-slide line and
- closing line; `hide: true` publishes no slides view.
-- `section.slide?` and `claim.slide?`: `{ title?: string, points?: string[], cite?: <citation id>, layout?:
- "points" | "evidence" | "quote" | "statement", hide?: boolean }`. `points` are the slide's own words (≤ 5, each
- ≤ 140 chars, may cite inline); `cite` picks the evidence the slide shows (a still, a post shot, a clip's poster
- and quote); `layout` overrides the default.
-- The validator checks them (counts, lengths, a `cite` that names a citation of that section/claim, inline cites
- that resolve) and REPORT.md is regenerated (`docs files`). An article with no slide fields still gets slides,
- derived as below; the fields make them good.
-
-### One builder: `buildReportSlides(view): SlideView[]` (`common/lib/report/slides.ts`, pure)
-
-Every slide carries an **anchor** (`{kind: "head" | "summary" | "found" | "section" | "claim" | "sources", id?}`)
-that is also an id in the article's DOM — the one mapping the toggle, the overview and notes all use.
-
-| slide | from | default layout |
-|---|---|---|
-| title | series, title, subtitle, dates, subject, `report.slides.title` | `title` |
-| the quick take | `summary`'s first paragraph (or `points`) | `statement` |
-| what the check found | the verdict tally (`foundGroups`) — factcheck only | `found` |
-| one per section | `section.slide.points`, else the body's first two sentences | `points` |
-| one per claim | claim `text`, `VerdictChip`, `gist`, the `cite`d (else first) citation's evidence | `evidence` |
-| sources | the reference count, the site link, `report.slides.closing` | `sources` |
-
-`hide` drops a slide; a claim with no citation renders `statement`. Long markdown never lands on a slide: a slide
-shows `points`/`gist`/one quote, and every slide links "Read this in the article" (its anchor).
-
-### The reader (export site and umtool, shared components in `common/components/report/slides/`)
-
-- **View switch** on the article header: `Article | Slides | Overview`, a segmented control in the transcript
- `modeStrip` pattern. URL param `rv` (`slides`, `iso`; absent = article) plus the anchor in the hash, so a shared
- link opens the same view at the same place. Switching keeps the place: the article's section in view ↔ that
- section's slide. The article HTML stays the statically rendered page (search engines and no-JS readers get the
- article); slides and the overview render client-side from the same `page.json`, loaded on demand.
-- **Slides** (`ReportSlides.tsx`): one 16:9 stage letterboxed in the viewport, scaled type; ←/→, PgUp/PgDn,
- Home/End, Esc (back to the article at this slide's anchor), swipe on touch; a progress rail; slide number in
- the hash (`#s-4`). Citations stay live (the `CitationsProvider` of the page): a cite opens its card. Per-site
- accent and light/dark from the existing tokens. Phones: the stage fits the width; portrait shows the slide's
- text at readable size with its evidence below.
-- **Overview** (`ReportOverview.tsx`): one plane tilted isometrically (CSS `rotateX(55deg) rotateZ(-45deg)`),
- the article's sections as a column of page-blocks on the left, the slides as a column of 16:9 cards on the
- right, a connector between each pair. Hover/focus a pair lights both; click the block to open the article at
- it, the card to open the slides at it; arrow keys walk pairs. `prefers-reduced-motion`, narrow screens and
- keyboard-first users get the same pairs flat (two columns, or stacked pairs on a phone) — the tilt is never the
- only way to read it.
-- **umtool** `ArticleReader` gets the same switch over its lenient `articleView`, so a draft can be checked in all
- three shapes before publishing; a slide shows the note count of its anchor, and the source tab's lint lists slide
- problems (a section with no `points` whose body's first sentences run long, an over-long point).
-
-### Exports
-
-- `slides.html` (self-contained like `report.html`: inline style + a few lines of inline script for keys, images
- inlined) and `slides.pdf` (Chromium, one 16:9 page per slide) join `REPORT_EXPORT_FORMATS`, the downloads table,
- `evidence-pack.zip` and the revision commit's `exports.json`. Same 24 MiB rule.
-
-## Slices (Track E)
-
-| slice | class | what |
-|---|---|---|
-| **E1** schema + builder | `[unit]` | the slide fields in `schema.ts`/`validate.ts`, REPORT.md regenerated; `slides.ts` `buildReportSlides` with a table of tests (every default, every override, `hide`, a sweep with no tally, a claim with no citation, anchors unique and matching the article's ids); the demo fixture report gains slide fields |
-| **E2** slides view | `[unit]` + `[spec]` | `common/components/report/slides/` (`ReportSlides`, slide layouts, `ViewSwitch`), wired into `ReportArticle.tsx` and the export route; article anchors on sections/claims; `rv` + hash state |
-| **E3** overview | `[unit]` + `[spec]` | `ReportOverview` (isometric + flat fallbacks), pair navigation |
-| **E4** umtool | `[spec umtool]` | the switch in `ArticleReader`, note counts per slide, slide lint in the source tab |
-| **E5** exports | `[unit]` | `slides.html`, `slides.pdf`, downloads table, evidence pack, history |
-| **E6** records | `[none]` | this file's record, changelogs (export, umtool), REPORT.md, PUBLISH.md's exports paragraph |
-
-E1 → E2 → E3; E1 → E4; E1 → E5. e2e: the export report suite (`pnpm --filter export run e2e:report`) gains slides
-and overview cases over the fixture (switch keeps the place, keys, a cite opens its card, the reduced-motion
-overview, a phone viewport) — run once at E3 and once at E5; umtool's article specs once at E4.
-
-## Do not touch
-
-`umtool/report-to-video/**` (the Candace session's); the editor; `transcripts/**`. Published reports change only
-when a site is rebuilt — nothing here rewrites a report.json in the corpus.
-
-## Record
-
-### Track E
-
-Branch `worktree-agent-a4ec71c7c593a80e5`, off `fdbdd370` (`r19/integration` with this plan). Not pushed, not merged.
-
-#### E1, as shipped — the slide fields and the builder
-
-`report.json` gains `slides` (`hide`, `title`, `points`, `closing` — `points` added to the plan's three: the
-plan's "the quick take: summary's first paragraph (or `points`)" needs a place for them) and a section's or
-claim's `slide` (`title`, `points`, `cite`, `layout`, `hide`); `version` stays 1. The limits are one pure module,
-`common/lib/report/slideRules.ts` (5 points, 140 visible characters each — a citation counts as its label —, 160
-for a line), with the report page's own anchor ids (`REPORT_PAGE_ANCHOR_IDS`: `report-head`, `in-brief`, `found`,
-`claims`, `references`, `downloads`, `report-end`). The validator checks lines (one line, not blank, not too
-long), points (count, length, inline cites that name a citation the report cites ELSEWHERE — a slide never brings
-evidence of its own, which would have no number), a `cite` of the slide's own section or claim, an
-`evidence`/`quote` layout with something to show, and refuses a section or claim id that is one of the page's own
-anchors (a counts-only scan of the 26 published `report.json` files: 0 of 322 ids collide). `lib/report/slides.ts`
-`buildReportSlides(view)` is the deck (title, In brief, What the check found, each section and claim, sources),
-each slide anchored to an id the article page carries (`reportPageAnchorIds`), plus `slideForAnchor`,
-`slideIndexForPlace`, `slideLint` (umtool) and the URL place (`parseReaderPlace`/`readerPlaceUrl`: `rv`, `#s-<n>`
-or an anchor). The page view carries the fields through `buildReportPageView` (compose) and umtool's lenient
-fallback (which also now gives a claim's `sourceQuote` as its id, as the strict view does). REPORT.md regenerated
-(a Slides section, the two key tables); the demo fixture report gains `slides`, a section's points and cite, a
-claim's title and points, a claim's quote layout.
-
-#### E2, as shipped — the slides view
-
-`common/components/report/slides/`: `Slide` (one slide per kind and layout; its left edge the colour of what it
-says — a claim's verdict, else the accent; "Read this in the article" to its anchor), `ReportSlides` (a 1280 × 720
-canvas scaled as one piece to its box, reflowed on a narrow portrait box; ← → PgUp PgDn Home End, Esc, swipe; a
-region with an `aria-live` "Slide n of N: <kind> — <title>" label; a rail), `ViewSwitch` (a `role="group"` of
-`aria-pressed` toggles), `SlidesHost` (what differs by host: markdown, a citation's marker, the way back, a badge),
-`useReaderPlace` (`rv` + hash; a switch pushes, a step replaces). Styles are plain CSS, `common/styles/slides.css`
-(`.rs-*`, unlayered so it wins over a shared component's utilities), coloured from the host's tokens through
-`--rs-*`. The export site's report header carries `ReportReader`: the other views are laid over the static page,
-built in the browser from `page.json` (fetched on demand); the article behind is `inert` and still; the place is
-kept both ways (the part in view opens its slide; Esc / "Read this" land on the anchor, scrolled to and focused); a
-citation number's click inside a slide opens its card instead of jumping to the reference list behind.
-`CitationCard`'s `heading` is exported as `citationHeading`.
-
-#### E3, as shipped — the overview
-
-`ReportOverview`: the pairs as one ordered list; tilted (`rotateX(55deg) rotateZ(-45deg)`, the plane's box sized
-from the tilt's geometry so it scrolls whole, the scroller alone moved to the pair in force — never the article
-behind) or flat (two columns; stacked under 780 px of box, a container query so umtool's column stacks too). Flat
-for reduced motion, a box under 900 px, a keyboard arrival, or the **Flat** toggle (localStorage, try/catch). ↑ ↓
-Home End walk, ← → block/card, Enter opens, Esc back to the article; roving tabindex (only the pair in force is
-tabbable); a thumbnail is the real slide, `inert`, its words as text. The e2e specs were split: `slides.spec.ts`,
-`overview.spec.ts`.
-
-#### E4, as shipped — umtool
-
-`ArticleReader` gets the switch over its lenient view; `ArticleShapes` renders the shared slides/overview in the
-reading column (the text stays mounted, hidden, its note marks with it; the notes rail beside). A slide's markdown
-is umtool's `Md` (a citation opens the evidence rail), its badge the open notes on its part (`openNotesBySlide`:
-a section's on its slide, title/subtitle on the title slide, a citation's on each slide showing it). The source
-tab lists slide lint and the validator's slide problems (`data-slide-lint`), each linked to its slide. umtool's
-globals.css imports slides.css, sources `common/components/report`, and maps `--rs-*` to its bench palette (`sel`
-the accent). The sites fixture's draft `polemic-beta` gains a long body (its slide lint's case).
-`umtool/e2e/article-slides.spec.ts` (4 tests).
-
-#### E5, as shipped — exports
-
-`slides` (`slides.html`) and `slides-pdf` (`slides.pdf`) join `REPORT_EXPORT_FORMATS` (order html, pdf, md,
-slides, slides-pdf, zip), so the downloads line, compose, the cited audit's allowlist (`REPORT_EXPORT_FILENAMES`),
-the revision commit's `exports.json`, the CLI and the ops job take them unchanged. `lib/report/exportSlidesHtml.ts`
-is the slides as one file (slides.css inline, the light base in the site's accent — `resolveAccent(site.accent)
-.light` —, every picture a data: URI, a few lines of script to fit and step, numbers to a reference list under the
-deck, each slide's way back to the site, the footer line on the sources slide). It is a STRING mirror of
-`Slide.tsx`: reportExports.ts is bundled into the editor's server (its "use server" export action), where
-`react-dom/server` is not imported; `exportSlides.test.ts` holds the two to the same `rs-` classes per slide and
-every class to a rule in the stylesheet. `slides.pdf` prints it at 1280 × 720 (`PdfPrinter.print(html, size?)`,
-`playwrightRuntime`'s `pdf` type gains width/height). A poster only the slides show is inlined or packed when local,
-never a problem. A report with `slides.hide` exports neither (a log line). CLI usage, ops usage and COMMANDS.md
-updated.
-
-#### E6 — records
-
-This section; `export/CHANGELOG.md` `[Unreleased]` (two bullets); PUBLISH.md's exports paragraphs and table row;
-the ruling line above reworded as on `r19/integration`. umtool has no CHANGELOG.md (none written); the editor is
-unchanged (no editor changelog).
-
-| commit | what |
-|---|---|
-| `2734b22b` | E1 schema, validator, slideRules, buildReportSlides + tests, REPORT.md, fixture |
-| `12691d03` | E2 shared slides components, slides.css, ReportReader, article anchors, slides.spec |
-| `75f0205d` | E3 ReportOverview, the switch's Overview, overview.spec |
-| `5d0b4fbc` | E4 umtool switch, ArticleShapes, note counts, source-tab slide lint, article-slides.spec |
-| `e9ea4cdc` | E5 slides.html / slides.pdf exports, downloads, pack, tests, CLI text |
-| (this) | E6 record, changelog, PUBLISH.md |
-
-**Gates.** `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` clean at E1 and at E5 (E2–E4 per
-package: common, export, umtool `tsc --noEmit` clean). Unit: `common/lib/report/*.test.ts` 111/111 (slides.test 26,
-exportSlides.test 6, report.test 17 with the new slide/anchor cases); `publish/composeReports.test.ts` +
-`reportMedia.test.ts` 23/23 (export expectations updated for the two new files and the second skipped-PDF note);
-`lib/builtExport.test.ts` + `bin/cli-docs.test.ts` + `bin/_cli.test.ts` + exportSlides 62/62;
-`pnpm --filter export test` 116/116; mcp 292/292 (at E1), `mcp/src/reports.test.ts` 5/5 (at E5);
-`scripts/archilyzer-ops.test.mjs` 46/46. **Not run — the operator's P1 hold (no e2e, no builds until the
-all-clear):** the export report suite (`e2e:report`, planned at E3 and E5: `slides.spec.ts` 10, `overview.spec.ts`
-3, the downloads/audit changes), umtool's article specs (`article-slides.spec.ts` + the three existing), the umtool
-capped build, and the full common suite. The views were checked visually instead, with no build: slides.html of the
-fixture rendered and screenshotted in headless Chromium (every slide kind), and the shared components bundled with
-esbuild over the fixture's page.json (slides at 1440 × 900 and 390 × 844, the overview tilted, flat under reduced
-motion, stacked on a phone, light and dark).
-
-**Found and left.** (1) A claim's slide shows its gist when it has no points; a claim with neither shows only its
-title and text. (2) The overview's thumbnails render every slide (fine at the fixture's 11; a report of 100+ claims
-would render 100+ small slides — not measured). (3) The keyboard-arrival heuristic is the last input before the
-overview mounted (a keydown anywhere counts). (4) `report.json`'s change summary (revision history) does not name a
-slide-field edit ("Other edits"). (5) slides.html's light base only (no dark variant), as report.html.
-
-#### Fix round, as it went
-
-Branch `r19/shapes-fix`, off `acda58f9`. The specs' first run (export report suite 42/45, umtool article specs
-18/21) and the operator's ruling of 2026-10-09: **the view switch is sticky** — Article | Slides | Overview stays in
-reach while the article scrolls, on desktop and phones, on the export site and in umtool. On the export site the
-switch leaves the report's `<header>` for a strip right after it (`[data-report-views]`, `sticky top-14` under the
-site header, within the article's box; frosted like the site header, no label); in umtool it sticks to the top of
-the reading column (`[data-article-views]`). Every anchor lands below the bars (`[&_[id]]:scroll-mt-32` on the
-export article, `scroll-mt-16` on umtool's blocks and claims). The failures:
-
-- `overview.spec.ts:15` and `slides.spec.ts:39` (the switch in the header scrolled away; a click scrolled to the
- top, so the head was the place) — fixed by the sticky switch. Under it a second cause showed: the part being read
- was the last place above the top third, so a jump to a section with a short lead (`#bridge`) and a switch opened
- its first claim. The line is now the top of the reading area — where a jump lands a place (its
- `scroll-margin-top`) plus 32 px — in both readers. Then `overview.spec.ts` pressed Enter before ArrowRight's focus
- move (next frame) had landed; it now waits for the card's focus, as after every other key.
-- `overview.spec.ts:68` (phone) — passes as fixed in `acda58f9`.
-- `article-slides.spec.ts:30` and `:62` — umtool's `ArticleShapes` never rewrote a slides URL naming a place to the
- slide's hash; it now does, replacing the entry, as `ReportReader` does.
-- `article-evidence.spec.ts:51` — not a regression (the walk is unchanged in release 22): the trace shows `j`
- pressed ~30 ms before the walk hydrated. The spec repeats the press until the walk moves (safe: `j` at the last
- citation stays there).
-
-Specs: `slides.spec.ts` asserts the switch in the viewport and the claim below it after the jump to `#claim-3`;
-`article-slides.spec.ts` the same after Esc lands on a section; `reports.test.ts` holds the switch after
-`</header>`, sticky. Export `CHANGELOG.md` one bullet. **Final: export report suite 45/45, umtool article specs
-21/21**, `pnpm --filter export test` 118/118, tsc clean (common, export, umtool).
-
-Merged into `r19/integration` at `3c445f6e`. Then, on the tip: near the end of a report the last places cannot
-scroll up to the reading line, so a switch from a jump to the last claim opened the slide before it. In both readers
-the place the URL names (a jump, Esc from a slide) now wins while it is on screen below the line; a reader scrolling
-by hand without one keeps the line rule. `slides.spec.ts` covers it (`#claim-5` in a 2400 px window → `#s-12`).
-The changelog's two bullets fold into E2's (the switch is unreleased; it reads as shipped).
-
-## Rollout
-
-Rebuild and deploy each site with reports (the slides view is in the bundle, and `reports prepare` re-exports to
-add `slides.html`/`slides.pdf`). Authors add `slide` fields at their own pace; an article without them still has
-derived slides.
diff --git a/plans/release-23.md b/plans/release-23.md
@@ -1,224 +0,0 @@
-# Release 23 — cited-only channels, and the overnight's owed fixes (daytime 2026-10-10)
-
-Written 2026-10-10 against `main` `43e684bb` (release 20 live), on `r23/integration`. Rules:
-`plans/tools/implementer-rules.md`, AGENTS.md (no session trailers or links, the 6 GB floor and `pnpm heavy`, no hand
-edits to `transcripts/**`, private stays private). Record file: this file for Lane 2 and the batch; Lane 1's slices
-record in the files their table names.
-
-## Context
-
-- Release 20 went live overnight. The B2 review (the Candace session: SHIP) and the Twitch-id ruling (option (b))
- came in since, as did rulings on the transcription lane, MCP notes and cross-site citations.
-- **Cross-site citations.** A private or polemics site that cites a critic's channel today has to pad its pool with
- that channel, which publishes the channel's browse pages, transcripts, search and corpus.json entry with it. A
- **cited-only channel** publishes only what the site's reports cite (moment pages, clips) on the citing site.
-- Step 0 (orchestrator): `r20/b2` merged `--no-ff` at `a57b2090`; the review is recorded in
- [`release-19.md`](release-19.md) B2.
-
-## Lane 1 — owed fixes (`r23/fixes`, sequential)
-
-| # | slice | what | gate | record |
-|---|---|---|---|---|
-| F1 | Twitch join, option (b) | one helper in `common/lib/videoId.ts` maps a record's `v<n>` to its `<n>` directory and back, used at the join points release 20 D2 names (editor fetch-window, `evidenceClip.mjs`, `reportMedia.ts` availability, umtool `cues.mjs`). Records and published ids unchanged | unit per reader; a Twitch `<n>` dir + `v<n>` record fixture through each; no index re-key | `release-20.md` D2 |
-| F2 | Transcribe from a saved container | `whisperVideoAction` looks for `findSourceMedia(entries) ?? resolveSavedVideo(videoDir)` before the disk gate and the audio download; an unreadable pointer is refused with the guard's sentence; an audio-less container takes the download path | action unit tests (present / unreadable / absent / no audio); `whisper.spec` | `release-21.md` |
-| F3 | Notes: an agent write path | umtool `/api/notes` POST stamps `by: "agent"` for a request bearing umtool's `WORKER_TOKEN`, "operator" without one, 401 for a wrong one; never `by` from the body. The MCP `notes` reply writes through it | route test; mcp tests; `article-notes.spec` | `release-19.md` (A9 follow-up) |
-| F4 | Stats cache sees the caption-track pass | the caption-track rule version or a per-record cue fingerprint joins `indexSignature`, so records the pass changed recompute once | unit; `buildStats` tests | `release-20.md` |
-| F5 | Test hygiene | umtool `triage.spec` nav group, `faces.spec` `facedet` capability skip, `find.spec:170` seam-twin skip; `timings.json` per run dir recorded from a `globalTeardown`; `import-video.spec:78` timeout in dev | umtool three files, `e2e-timings.test`, import-video in dev | `e2e-speed.md` |
-
-## Lane 2 — cited-only channels (`r23/cited-only`)
-
-**Schema (ruled 2026-10-10).** `citedChannels: [{slug}]` is a separate site.json key, documented as "channels in
-the cited scope". It fails closed: a reader or an older editor that does not know it drops it, and compose refuses a
-citation of the channel with `not-in-site`. It never publishes a channel's transcripts.
-
-- **Parse:** trim, dedupe, drop blanks; drop any slug already in `channels` (the pool wins). Written only when
- non-empty; absent parses to `[]`.
-- **Helpers** (`siteSchema.ts`, re-exported by `site.ts`): `siteChannelSlugs` stays pool-only; new
- `siteCitableChannelSlugs` (pool plus cited) and `isCitedOnlyChannel(site, slug)`.
-- **Naming hazard** (FACTS): "cited" means a cited site, a cited-only channel, `citedMoments`, and compose's local
- `cited` (renamed `citedSite`).
-
-| step | what |
-|---|---|
-| S1 | Schema + SITE.md: the type, docs, parser, `siteToDisk`, `fileSchemaDocs.ts`; the `channels`/`search` docs say "the pool its citations resolve against" |
-| S2 | Resolution + media: the citable set at compose's and `reportMedia.ts`'s membership checks; no `corpusUrl` for a cited site or a cited-only channel; `not-in-site` names both keys; X-post visibility unchanged. Proving compose test over `padded`, `padded-private`, `padded-cited` |
-| S3 | Staleness + leak guard: `inputSig` signs each cited-only channel's `transcripts`/`posts` trees; `builtCitedOnlyProblem` refuses a build/deploy whose out dir holds a cited channel's trees or lists it in corpus.json, chained beside `builtScopeProblem` |
-| S4 | Writers + editor: `renameChannel` rewrites `citedChannels`; ops `sites` read shows it; the site form's "Cited only: <name>" checkbox on rows outside the pool (`citedChannelsFromForm.ts`); `/sites` list "· N cited" |
-| S5 | Docs + record: REPORT.md, CITATIONS.md, `editor/CHANGELOG.md` ("rebuild each site that uses it"), this file "as shipped" |
-
-**Stays pool-only, unchanged by the separate key:** `publishedMemberSlugs` (and the per-site index, compose trees,
-archives, tombstones, publish state and plan), poolSummary and channel-sites.json, buildStats and curatedTags, the
-channel views, the seeder, the editor channel pages and the export offline page. Compose reads a cited record
-straight from `channels/<slug>/data` (`readCitedRecord`).
-
-**Out of scope (ruled):** moving any live site's padded channels; the owning sessions do it through the editor form.
-
-## Verification
-
-- Lane gates as tabled; tsc clean per commit; `docs files --check` after S1.
-- On the `r23/integration` tip: `pnpm typecheck`, `pnpm test`, `docs env|files|cli --check`, `settings example
- --check`; the four builds through `pnpm heavy` (5 GB scope); e2e one suite at a time (editor in start mode, export
- default + report + hub, umtool full, homepage); every red re-run alone, a red that stays red blocks. Counts-only
- privacy greps over `main..r23/integration`.
-- Live: the three TISM transcriptions read the saved container (job log) and end `done`; an MCP `notes` reply shows
- in umtool as "agent"; the Twitch helper maps every hasanabi record to an existing `data/<n>/` (offline count). No
- live `fetch_clip` on a Twitch video (expired VODs are never re-fetched).
-
-## Record
-
-(Lane 2 adds "### Step S<n>, as shipped" sections here; the orchestrator adds "As it went" and "Rollout".)
-
-Lane 2 (`r23/cited-only` off `r23/integration` `d3296bab`), S1 → S5, one commit each, tsc clean per commit. Every
-fixture is synthetic; nothing read the corpus.
-
-### Step S1, as shipped — the schema
-
-`citedChannels: [{slug}]` in `common/lib/siteSchema.ts`: `SiteCitedChannel` and its field docs, `parseSiteCitedChannels`
-(trim, blanks and repeats dropped), the object step dropping a slug the pool holds, `siteToDisk` writing the key only
-when non-empty (re-parsed and pool-filtered), and the nested table in `fileSchemaDocs.ts`. Absent parses to `[]`; the
-type is optional, so no existing `Site` literal changed. `siteChannelSlugs` (pool-only, unchanged) moved from
-`site.ts` to beside the new `siteCitableChannelSlugs` and `isCitedOnlyChannel` (all re-exported by `site.ts`). The
-`channels` and `search` docs say what the pool is; SITE.md regenerated. Tests in `siteSchema.test.ts`: the shape pins
-(the key in every parse), the parse rules, the round trip (the `everything` fixture carries dirty cited slugs),
-`writeSite`/`getSite`, `patchSite` keeping the key, `channelsOnlyOnUnlistedSites` ignoring cited slugs.
-
-### Step S2, as shipped — resolution and media
-
-Compose's membership check (`resolveSiteReports`) and prepare's and `missingEvidenceWindows`' (`reportMedia.ts`, the
-pool-membership lines only) take `siteCitableChannelSlugs`. `corpusUrl` is dropped when `citedSite ||
-isCitedOnlyChannel(site, channel)` (the four record views); compose's local `cited` is `citedSite`. `not-in-site`'s
-sentence is one helper, `notInSiteMessage` (siteSchema.ts): `channel "<slug>" is in neither this site's `channels` nor
-its `citedChannels``. `postsVisibleTo` still runs after the citable check, unchanged. **The proving test**
-(`composeReports.test.ts`): `padded` (pool both channels) publishes the video channel's corpus and links its moments;
-`padded-cited` and `padded-private` (pool `[SOCIAL]`, cited `[VIDEOS]`) publish its two moment pages and clips with no
-`corpusUrl` (the pool's post keeps its link), prune its `transcripts/`, `subs/`, `digests/`, `posts/`, `stats/`,
-`archives/` trees (a padded build and a stray digest left them in public/), no non-report file names it, corpus.json
-and site.json list the pool alone, and the sitemap lists the moment; `unpadded` (pool `[SOCIAL]`, nothing cited) is
-refused naming both keys. A mutation check (the `corpusUrl` drop disabled) fails it. `reportMedia.test.ts` +1 (a cited
-channel's clip is cut; a channel in neither key is `not-in-site`), `missingEvidenceWindows.test.ts` +1 and a message
-assertion.
-
-### Step S3, as shipped — staleness and the leak guard
-
-`siteInputSig` signs each cited-only channel's shared `transcripts` and `posts` trees (`cited/<tree>/<slug>`), and a
-`cited-only` line, only when the site has one: every existing site keeps its signature. `builtCitedOnlyProblem(site,
-outDir)` (`lib/builtExport.ts`) refuses an out dir holding a cited-only channel's `transcripts`, `subs`, `posts` (a
-tombstone tree aside — `isTombstoneChannelPostsDir`, split out of `isTombstonePostsTree`), `digests`, `stats` or
-`archives` tree, or listing it in corpus.json's or site.json's `channels`. Chained after `builtScopeProblem` in the
-build phase (`publish/build.ts`), the deploy stage's bundle guards and `deployAudienceProblem`. Tests: `inputSig.test.ts`
-+1, `builtExport.test.ts` +1, the deploy-stage bundle-guard test extended (refused before wrangler, nothing recorded),
-and the compose proving test asks the guard over a padded build (refused) and each cited build (clean).
-
-### Step S4, as shipped — writers and the editor
-
-`renameChannel` rewrites `citedChannels` beside `channels`; `get sites` (`/api/ops/sites`) carries `citedChannels`
-(slugs) and its help line says so (COMMANDS.md regenerated). The site form: a "Cited only: <name>" box on each channel
-row outside the pool (never "Include …"), ticking Include clears it; the save action reads the hidden
-`citedChannelsJson` through the pure `editor/app/sites/lib/citedChannelsFromForm.ts` (bare slugs or `{slug}`, a pool
-slug dropped, a non-array payload refused). `/sites` shows "· N cited". Tests: `renameChannel.test.ts` (a citing site
-retargeted in place), `citedChannelsFromForm.test.ts` (3), `_read.test.ts` (the ops row), and one `sites-crud.spec`
-test (save to `citedChannels`, the list's count, Include clears it).
-
-**Stays pool-only, verified, unchanged:** `publishedMemberSlugs` (and through it the per-site index, compose's trees,
-archives, tombstones, publish state and plan), poolSummary / channel-sites.json, buildStats, curatedTagsIndex, the
-channel views, the seeder, the editor channel pages and `siteChannelIndex` all read `site.channels` or
-`siteChannelSlugs`; none reads the cited scope. The channel page's membership writer (`siteMemberships.ts`) carries
-`citedChannels` through `writeSite`, and adding a cited channel to the pool there drops it from the cited scope.
-
-### Step S5, as shipped — docs and this record
-
-REPORT.md (what compose checks) and CITATIONS.md (the `channel` rows of video, audio and post) from their sources
-(`lib/report/docs.ts`, `lib/citations/schema.ts`), regenerated; FACTS "Naming hazards" gains "`cited` means four
-things"; `editor/CHANGELOG.md` `[Unreleased]` leads with the bullet ("rebuild each site that uses it").
-
-**Export e2e: not added.** The report suite's fixture is a cited (report-only) site staged from precomposed views, on
-which a cited-only channel is no different from any citation; the default export suite's fixture composes no reports.
-Carrying a full site with a report would mean new fixture machinery, so the compose proving test (S2) is the proof.
-
-**Found and left.** A channel moved from a site's pool to its cited scope is not tombstoned: its posts paths a public
-site served before stay at the edge until their TTL, as for any channel taken off a site today.
-
-| Gate | Result |
-| --- | --- |
-| tsc (`pnpm -r … tsc --noEmit`), each commit | clean ×5 |
-| common suite, whole, at the end | 3681 tests, 3671 pass, 10 fail — `controller/attachMedia.test.ts` (8) and `controller/preparePlayable.test.ts` (2), which fail the same on `r23/integration` (environmental) |
-| touched common files | siteSchema 31, composeReports 19, reportMedia + missingEvidenceWindows 10, inputSig 6, builtExport 22, deployStage 15, renameChannel 7 — all pass |
-| editor unit (`pnpm --filter editor test`) | 240/240 |
-| export unit / homepage unit | 118/118 / 23/23 |
-| `test:scripts` | 761: 758 pass, 3 skipped |
-| `docs files --check`, `docs cli --check` | clean |
-| `sites-crud.spec` (start mode; the editor rebuilt through the heavy slot, 40 s) | 18/18, 29.1 s |
-
-## As it went (2026-10-10, daytime)
-
-Orchestrator in the primary checkout; `r23/integration` in `~/Projects/r23-integration`, one Opus implementer per lane.
-
-- **Step 0:** `r20/b2` merged `--no-ff` at `a57b2090` (an `editor/CHANGELOG.md` conflict: both bullet sets kept); the
- Candace session's review recorded in `release-19.md` B2 (`16c7a13c`), its QR follow-up closed (`e9631af7`).
-- **Lane 2** (cited-only, `12a5ddbb`) merged first at `e67b40ba`; its touched common tests 110/110 and editor unit
- 240/240 on the merge. **Lane 1** (F1–F5, `73eafd37`) merged at `88c767ec`. It found that compose's `readCitedRecord`
- and three other readers still joined `data/<id>` directly, so **F1b** (`54e9e8bf`: compose, convert, umtool's cue
- paths and availability) followed on the same branch, merged at `70539aa2`.
-- **The 10 common reds were the machine.** `attachMedia.test` (8) and `preparePlayable.test` (2) fail on `main` too
- when `/tmp` (a tmpfs) has under attachMedia's 2 GiB margin free: eight stale `archilyzer-source-*` clones (~3.2 GB,
- left by the orchestrator's own `source publish --check --keep-scratch` runs on 10-09/10) filled it. The operator
- removed them; the r23 source check no longer keeps its scratch. The gate ran unit tests with `TMPDIR` on `/home`
- (`umtool/lib/articles/sources.test.mjs` then failed — it expects an absolute temp path, and a temp under `$HOME` is
- tildified; 2/2 with the default). Both test dependencies are release 24 H2.
-- **Memory.** The same tmpfs sat in zram (13.9 GB swapped into 4.9 GB of RAM); MemAvailable stayed at 3.9–4.6 GB and
- the e2e segments waited on the 6 GB floor (the export suite 37 min behind the MK session's renders, then the rest
- until the clones went). The release 24 implementers paused their runs meanwhile.
-
-### Gates (on `70539aa2`)
-
-| gate | result |
-|---|---|
-| privacy, counts only, `43e684bb..70539aa2` (29 commits; diff lines / messages) | name, email local part, guarded suffix, home paths, session links, session trailers, the scrubbed deployment hash, corpus data paths: all 0/0; one identity |
-| `pnpm typecheck` | clean (88 s) |
-| `pnpm test` (`TMPDIR` on `/home`) | common 3,702/3,702 · editor 246 · export 118 · homepage 23 · mcp 305 · scripts 770 + 1 red (`sources.test`, the temp path above; 2/2 on the default temp) + 3 skipped |
-| `docs env\|files\|cli --check`, `settings example --check` | all 0 |
-| builds (`pnpm heavy`, 5 GB scope) | editor 41 s · export 23 s · homepage 13 s · umtool 25 s (corpus linked) |
-| editor e2e (start mode) | 682 passed, 3 failed, 12 skipped — 21.6 min |
-| export default / report / hub | 276 / 46 / 39 passed |
-| umtool full | **283 passed, 6 skipped, 0 failed** (4.3 min) — release 20's 14 environment reds are F5's skips |
-| homepage | 106 passed |
-
-**The editor reds, re-run alone** (`site-scope.spec` + `sites-crud.spec`, start mode): 30 passed, 1 failed —
-`sites-crud.spec:491` (the hub form's transcript-downloads opt-out: "Saved." not visible within 5 s; the page shows it
-after). With `--repeat-each=3`: the tip 3/3, **`main` 43e684bb 2/3** — a flake that predates the release (the hub form
-is not touched by it). Not blocking; its fix is release 24 H5.
-
-## Rollout (2026-10-10)
-
-`main` fast-forwarded to `70539aa2` by the orchestrator (gates above).
-
-- **Editor** — build `TFP7ylMbfQgHatC_Rz5Yp` → `MedVVoEYdaiEvf3HlPCzW` (heavy slot, 5 GB scope; 242 s with the
- waits). Restart: `/` 200 after 3 s, `~/.local/bin` on PATH, `UV_THREADPOOL_SIZE=16`, no ZodError, queued 0 → 0; one
- job closed as interrupted (the MK session's `transcribe-file`, waiting since 13:30 on the held pool; that session was
- told before and after, and re-queues it). Smoke `SMOKE_FAIL=0`. The transcription lane's hold survived the restart.
-- **umtool** — build `Ygl5WMxAtVHKUqkPguFBI` → `kW9qK6OKB85bvnXeusF_y`, restart on :3050, `/` 200. F3 live: a wrong
- bearer token gets 401 "that bearer token is not umtool's WORKER_TOKEN" (so umtool holds the token), nothing written.
- The operator re-registered the `archilyzer` MCP with `UMTOOL_URL=http://localhost:3050` (verified, key names only).
-- **Source mirror + homepage** — `source publish --check` on `70539aa2`: audit clean (32,753 objects, 2,854 commits,
- 6,158 files against 14 denied literals), gitleaks clean. Homepage build `0mv2trts0-6a094cdb` deployed to production;
- live check ok (`https://archilyzer.pages.dev` serves it, HTTP 200). A fresh clone of the live mirror after the 5-minute cache: head
- `dd296e38`, 2,854 commits; name, email local part, guarded suffix, session links and trailers 0; one identity (the
- retired `source.archilyzer.pages.dev` alias is no longer probed).
-- **Public sites** — not rebuilt: `export/` changed only its Playwright configs; compose's changes reach report pages
- (no public site has reports), and `inputSig` signs cited-only trees only for a site that has some. All six answer
- 200 on `/` and `/corpus.json`.
-- **TISM (release 21 pilot, the three created records)** — `transcribe-one` ×3 queued 15:43 with the lane held; each
- log: "No audio on disk for <id>; transcribing from the saved container …", no `download-one-audio` job. The
- transcription lane released 15:43:24, held again 15:59:26 (by the script that waited on the three; workers
- `paused: true`); nothing else transcribed in the window.
-
- | id | ran | cues | audio |
- |---|---|---|---|
- | `6ijPdSuZdws` | 15:43:12 → 15:50:27 (7 m 15 s) | 1,071 | to 7,046 s |
- | `VcFA_LOnQoc` | 15:50:27 → 15:54:20 (3 m 53 s) | 770 | to 4,003 s |
- | `xLgf_MGQzXk` | 15:54:20 → 15:59:23 (5 m 03 s) | 778 | to 4,328 s |
-
- Each read back through `pnpm ops get transcript <id>` (source `cues.json`).
-- **Sessions told:** Super Jeralyzer, Super Hasanalyzer and the Candace session (cited-only is live; only
- citation-only padding moves, through the form — a `pnpm ops site-config` writer is release 24 H6). Super
- Hasanalyzer's pool is all its own channels: nothing moves. No Super Jasolyzer session was running.
diff --git a/plans/release-24.md b/plans/release-24.md
@@ -1,272 +0,0 @@
-# Release 24 — hygiene and e2e speed (daytime 2026-10-10, added by the operator mid-batch)
-
-Written 2026-10-10 on `r24/integration` from `r23/integration` `70539aa2` (release 23, being gated). Rules as release 23
-(`plans/tools/implementer-rules.md`, AGENTS.md). Lanes run while release 23 gates and rolls out; release 24 gets its own
-gate round and rollout. Record file: this file.
-
-## Lane A — hygiene (`r24/hygiene`, sequential)
-
-| # | slice | what | gate |
-|---|---|---|---|
-| H1 | Tombstones for a channel that leaves a site's scope | when a channel leaves a site's published pool (removed, or moved to `citedChannels`), the next build ships tombstones for the paths the site had published for it (its manifests and shards), and the hub likewise — the release 18 X-post machinery (`common/publish/tombstones.ts`, the live check's probes), not deletions. Found by release 23 Lane 2 | unit (compose + tombstones); the hub path; live-check probe list |
-| H2 | Temp-dir test robustness | `attachMedia.test` / `preparePlayable.test` inject free space instead of reading `/tmp`'s; `umtool/lib/articles/sources.test.mjs` passes wherever `TMPDIR` is (a temp dir under `$HOME` is tildified) | both suites with `/tmp` near full and with `TMPDIR` under `$HOME` |
-| H3 | persist-videos keeps provenance | a prefetch (`persist-videos`, `by: "prefetch"`) that rewrites `metadata.info.json` keeps the fields the Wayback/archive.org provenance refresh applied (title, upload date, …) instead of reverting them to the capture's own metadata | unit over a Wayback and an archive.org fixture; the metadata history entry still written |
-| H4 | umtool `mix.spec` order dependence | `mix.spec` passes after `clip-bench.spec` (whose editor fetch writes `testchan/vid1` 0–14 first), not only alone | the two specs in one run, both orders |
-
-## Lane B — e2e speed S4 → S5 (`r24/e2e-speed`)
-
-[`e2e-speed.md`](e2e-speed.md) S4 (suites side by side under a memory-weighted heavy slot; `pnpm e2e:all`), then S5's
-mechanical half (every spec's data paths through `testPaths()`; `dev:test`/`start:test` take them from the env; one
-worker, same results), then S5's per-worker servers if time allows. Record: `e2e-speed.md` "As it went".
-
-## Orchestrator
-
-- Publish policies (ruled 2026-10-10): `publish.auto: "build"` on the six public sites; the publish lane enabled;
- private sites, hub and homepage stay off. Through the editor's own writers after release 23's restart.
-- Prune merged worktrees and branches (ruled 2026-10-10): the merged `r18-*` and `r20-*` worktrees; `r20/twitch-ids`
- is kept.
-- The source verify no longer probes the retired `source.archilyzer.pages.dev` alias (a script outside the repo).
-
-## Record
-
-Lane A (`r24/hygiene` off `r24/integration` `72c44159`), H1 → H4, tsc clean per commit. Every fixture is synthetic;
-nothing read the corpus.
-
-### H1, as shipped — tombstones for a channel that leaves a site's scope
-
-**What the site published before is its last bundle**, `<exportBuildsDir>/<siteId>/out`
-(`tombstones.ts` `lastBundleDir`), read by compose before the build replaces it, and only when its `site.json` names the
-site. Ruling: the bundle is the one record of the exact paths and page counts a deploy of that build shipped. No stamp
-lists them: `built.json` and `deployed.json` carry ids, counts and live checks, the compose cache only signatures of
-member trees, and `public/` is shared by every site's compose.
-
-- **Site** (`compose-site.ts`, after the X tombstones): `servedChannelTrees` lists every `transcripts/`, `subs/`,
- `posts/` and `digests/<slug>/` the bundle served. `writeDepartedTombstones` writes a tombstone path for path for
- each tree this compose does not ship: the tree's manifest at `pageCount: 0` (`tombstoneTreeManifest`: no size, no
- `slugToPage`, `tracks: []` on subs, no `pageHashes`) and `[]` for each page the bundle held. A tree `public/` holds
- (a member's, or an X tombstone) is left alone. The trees are served no-store (`tombstoneNoStoreForSite(x,
- departed)`; `/posts/manifest.json` only when a posts tree is a tombstone). An empty site posts manifest is written as
- for X tombstones. **Carried:** a bundle's tombstones are served paths, so they are written again while the channel
- stays out. A channel back in the pool gets its real trees, and a tree it has none of stays a tombstone. A cited-only
- channel's `m/` and `media/` are not touched.
-- **Hub** (`compose-hub.ts`): the hub's channel paths are its tombstones (`builtHubProblem` allows nothing else). Its
- last bundle's posts tombstones are carried while the release 18 rule allows naming the channel
- (`hubNameableChannels`: a non-private site's pool; `withdrawnXChannels` now uses it). A channel moved to a cited
- scope, kept only by private sites, or on no site is never named, carried or not.
-- **Live check:** a site's deploy probes the trees its bundle's `_headers` declares withdrawn
- (`tombstonedTreesInHeaders` → `deployStage.ts` `siteTombstoneProbes`, manifest + first page, plain and busted). The
- bundle's own word: a real manifest-only tree reads like a tombstone on disk. This closes release 18's "a site's
- live check does not probe its tombstones".
-- **Guard:** `builtCitedOnlyProblem` accepts a tombstone of any of the four trees (`isTombstoneChannelDir`, renamed
- from `isTombstoneChannelPostsDir`; it now also refuses a non-empty `tracks` or `pageHashes`). The cited-only proving
- test asks it over the tombstoned `public/` (clean) and over the last bundle (refused).
-- PUBLISH.md: "Tombstones for a channel that leaves a site".
-
-**Found and left.** A docker-runner build sees no last bundle in its container (`EXPORT_BUILDS_DIR` is the
-container's), so it writes no departed tombstones. A site switched to `search: false` (a cited site) composes no
-corpus and writes none either (`citedBuildProblem` refuses every corpus tree). Archive zips (`archives/`) and per-site
-aggregates (summaries, stats) are rewritten at the same paths and are not tombstoned. Departed tombstones never
-expire.
-
-### H2, as shipped — temp-dir test robustness
-
-`attachMedia` and `preparePlayable` take `deps.freeBytes` (default `getFreeBytes`, as `probeDuration`/`probe` are).
-Their fixtures hand in 1 TiB. One test each judges the 2 GiB margin with a fake: the exact stop sentence, nothing
-copied or remuxed, and the disk asked. `umtool/lib/articles/sources.test.mjs` compares through the `tildify` the code
-applies. Product behaviour unchanged.
-
-### H3, as shipped — persist-videos keeps provenance
-
-**The mark is the history.** Nothing in `metadata.info.json` marks a provenance-applied field. Each
-`wayback-provenance`, `archiveorg-provenance` and `feed-backfill` entry in `metadata.history.json` names the key, the
-value written and the value replaced (`PROVENANCE_WRITERS`, the writers `refreshVideoMetadata.ts` already refuses
-over).
-
-- `withMetadataHistory` runs `keepProvenanceInFile` before it records the entry, after any writer that is not a
- provenance writer: prefetch, audio-check, download-one, archiveorg-import, refresh, local-archive.
-- Rule (`keepProvenanceFields`, pure): a key a provenance entry set comes back at the newest provenance value when the
- rewrite lacks it, or carries a value a provenance entry replaced. That is the capture's placeholder, or an earlier
- find a later one superseded. Any other value is the source's and lands.
-- A restored title goes right after `id` (the 16 KB head reader). Anything else absent goes at the end (`upload_date`:
- the 8 KB tail reader).
-- A record a pre-H3 prefetch already reverted heals on its next rewrite. The rewrite's own entry is still written,
- net of the kept fields.
-- A value the history holds only as a digest (over 16 KB) is not restored.
-
-**Found and left.** The history keeps 200 entries: a record rewritten 200 times after its provenance entry loses the
-claim. The records already reverted on disk heal only when next re-downloaded; `archilyzer wayback refresh --titles`
-still mends them offline.
-
-### H4, as shipped — umtool `mix.spec` order dependence
-
-**Already fixed by release 19 B5 (`10042c2d`), verified here: no code change.** `mix.spec.ts` moves the fixture
-corpus's clip windows (`channels/*/data/*/clips/`) aside in `beforeAll` and puts them back in `afterAll`. A run killed
-part-way is restored at the next start. The memory this slice was raised from predates B5's merge, and no full umtool
-run since B5 lists a `mix.spec` red (release 19's full run: all 12 passed; the overnight 2026-10-10 rounds: 14 reds,
-none of them mix).
-
-**How the config orders files:** `workers: 1`, `fullyParallel: false`. Files run in path order whatever order the CLI
-names them, so `clip-bench` always runs before `mix` in a run that holds both, as in the full suite. The reverse order
-was forced with an untracked copy of `mix.spec.ts` that sorts first (`a-mix-first.spec.ts`), deleted after the run.
-After the first run `testchan/vid1/clips/0.00-14.00.mp4`, clip-bench's editor-stub window, was back on disk: mix had
-set it aside and restored it.
-
-### H5, as shipped — `sites-crud.spec.ts:491`, the hub form's "Saved." (added by the orchestrator)
-
-**The race.** In the production build, a server action that calls `revalidatePath` makes the router refresh the page
-as the action lands. React commits the action's `useActionState` state together with that refresh. Now and then the
-refresh did not settle until the next router update, which is AutoRefresh's tick about 5 s after the page loaded, so
-"Saved." (and the button's "Saving…") waited with it.
-
-Measured with an untracked diagnostic spec. Across about 140 hub saves (start mode), the click was always hydrated
-(not a pre-hydration native POST), the action's POST answered in about 15 ms with its body complete, and "Saved." took
-about 110 ms. Five saves took 4.9–5.9 s, each ending just after a lone `/sites` RSC refresh. Without `revalidatePath`:
-0 slow in 18. With it, the control run had 1 slow in 18. The status of the previous save was not the cause: each save
-in the spec follows a fresh `goto`.
-
-A first suspicion was wrong: the sidebar prefetching `/sites` while on `/sites`. With that prefetch switched off, the
-stall still happened. The same stall hit SiteForm's saves (`:53` and `:588`) and the delete button (`:126`) in this
-file's own gate runs.
-
-**The fix** applies to the four `/sites` writers this spec drives. Each one saves without revalidating and refreshes
-the page itself once its result has landed, so the confirmation never waits on a page render:
-
-- **The hub form** (`saveHomepageConfigAction`).
-- **The site form** (`saveSiteAction`).
-- **Delete and migrate** (`deleteSiteAction`, `migrateToSitesAction`).
-- **What the forms do:**
- - A success hands back what was submitted (`values`), and the form seeds from it (`seedAfterSave`,
- `lib/formState.ts`). React's form reset after the action therefore shows what was saved.
- - `useRefreshAfterSave` (`lib/useRefreshAfterSave.ts`) calls `router.refresh()` once the state is in, so the h1
- above a site's tabs, the `/sites` list and the Publish rows follow.
-- **What delete and migrate do:** they call `router.refresh()` after their result.
-- **New test:** sites-crud holds every non-prefetch `/sites` RSC read for 6 s. It still expects "Saved." within the
- default 5 s, and the fields to show what was saved. `formState.test.ts` +1 covers `seedAfterSave`.
-
-**Found and left.**
-- Every other editor action that calls `revalidatePath` keeps the same exposure: the publish actions, the reports
- actions, release cuts, settings, and the channel and job actions. This release changes only the four writers above.
-- AutoRefresh refreshes every page about 5 s after it loads. The pulse's first poll counts as a change (`revCounter`
- 0 → 1). It is what ended each stall above, and it is a full server render per page load that its own comment says
- should not happen.
-- The underlying Next.js behaviour (16.2.3: the post-action navigation not settling) was not traced further than the
- reducer: `server-action-reducer.js` resolves the action early, and React holds the state for the entangled
- navigation.
-
-### H6, as shipped — `pnpm ops site-config` (added by the orchestrator)
-
-`POST /api/ops/site-config` (`editor/app/api/ops/site-config/route.ts`, behind the worker token through `ops()`, like
-`channel-config`) and the ops action `site-config`. The body is `{"siteId", "citedChannels"?: [slug…], "publishAuto"?:
-"off" | "build" | "preview" | "production"}` and needs at least one of the two. Only those keys for now.
-
-- **Written through `patchSite`** (`common/lib/site.ts`), so through `writeSite`, the validation the site form's save
- gets:
- - A slug the pool already holds is dropped from `citedChannels` (`siteToDisk` re-parses).
- - `[]` clears the scope; the key is not written.
- - A deploying policy on a site with no `cloudflareProject` is refused in `sitePublishProblem`'s words.
- - A private site's policy is clamped to `build`.
- - `"off"` removes the `publish` key.
-- **Refused before anything is written**, each as a 400 naming the problem:
- - an unknown key (the allow-list);
- - an invalid or unknown site id;
- - a slug that is not a valid channel slug, or not a channel (`channelExists`);
- - a policy outside the four;
- - a body with neither key.
-- **Answer:** `{ok, siteId, citedChannels, publishAuto}`, as saved.
-- **Docs:** the CLI's `usage()` paragraph and two header examples. COMMANDS.md is regenerated (`archilyzer docs cli`;
- `--check` clean). OPERATING.md "Publish" gains the recipe line, and the editor changelog gains a bullet.
-
-### Commits
-
-| Commit | What |
-|---|---|
-| `2fbb5fdc` | `common:` H1 — departed-channel tombstones on the site and the hub, the site live check's tombstone probes, `isTombstoneChannelDir`; PUBLISH.md |
-| `60cea572` | `common, umtool:` H2 — `deps.freeBytes` in attachMedia/preparePlayable and their tests; `sources.test.mjs` through `tildify` |
-| `198d4a8f` | `common:` H3 — `keepProvenanceFields` / `keepProvenanceInFile` in the history wrap |
-| — | H4: no commit (release 19 B5 `10042c2d` fixed it; verified above) |
-| `c2840cf1` | `plans:` this record; `editor/CHANGELOG.md` (two bullets at the start of `[Unreleased]`) |
-| `0e887173` | `editor:` H5 — the four `/sites` writers save without revalidating (`seedAfterSave`, `useRefreshAfterSave`); the sites-crud test; a changelog bullet |
-| `3cb4ad5f` | `plans:` the H5 record |
-| `d81b8aff` | `editor, scripts:` H6 — `POST /api/ops/site-config` + test, the ops action, COMMANDS.md, OPERATING.md, the changelog |
-| this commit | `plans:` the H6 record |
-
-### Gates
-
-| Gate | Result |
-| --- | --- |
-| tsc (`pnpm -r … tsc --noEmit`), each code commit | clean ×3 (this commit is docs only) |
-| H1 touched files | `compose-site.departed.test.ts` (new) 3/3; `tombstones.test.ts` 9/9 (+5); `compose-hub.test.ts` 8/8 (+1); `deployStage.test.ts` 16/16 (+1); `builtExport.test.ts` 22/22 (extended); compose-site + postsVisibility + composeReports + headers + liveCheck + build + lib/postsVisibility 68/68 |
-| H2 | `attachMedia.test.ts` 12/12 (+1) and `preparePlayable.test.ts` 6/6 (+1) with `/tmp` as is (tmpfs, 1.7 GB free; 8 + 2 failed before) and again 18/18 with `TMPDIR=$T/tmpdir` under `$HOME`; `sources.test.mjs` 2/2 both ways (1 failed before under `$HOME`) |
-| H3 | `metadataHistory-server.test.ts` 12/12 (+4: a Wayback prefetch, a reverted record healing, an archive.org re-import, superseded finds and no provenance); `metadataHistory.test.ts` 15/15 (+2); `forceMedia.test.ts` 9/9 (+1: a persist prefetch through `downloadOneManaged` with a fake yt-dlp); archive.org, feed, refresh, wayback, downloadOneManaged and persist tests 84/84 |
-| common, whole (after H3) | 3721 tests: 3720 pass, 1 fail — `relocateChannelMedia.test.ts` "reconcile: an extra and a changed file…" reported `./` as changed too (a directory-mtime timing flake; the file alone 44/44 twice; not touched by this lane). The two environmental files release 23 recorded (attachMedia 8, preparePlayable 2) pass |
-| `test:scripts` | 774: 771 pass, 3 skipped |
-| export unit | 118/118 |
-| umtool e2e `clip-bench.spec.ts mix.spec.ts` (`E2E_MODE=dev`) | 62 passed, 2.7 min (clip-bench first) |
-| umtool e2e, mix first (`a-mix-first.spec.ts` + `clip-bench.spec.ts`) | 62 passed, 2.4 min |
-| H5: tsc; editor unit | clean; 247/247 (+1) |
-| H5: `pnpm e2e sites-crud.spec.ts --repeat-each=3` (start mode) before the fix | 53 passed, 4 failed (a first, wrong fix); then 56 + 1 failed (`:588`); then 56 + 1 failed (`:126`): the same stall each time |
-| H5: the same, after `0e887173` | 57/57 (58.6 s), and again 57/57 (55.3 s) |
-| H5: the untracked diagnostic spec, 30 hub saves on the fixed build | 30 under 400 ms (before: 1 in 18 at ~5.9 s) |
-| H6: `site-config/route.test.ts` | 3/3. Covered: setting the cited scope, dropping a pooled slug, deduping and clearing with `[]`; `publishAuto` round-tripping all four policies; a deploying policy with no Pages project refused, nothing written; a private site clamped to build; both keys in one call; ten refusals with nothing written; 401 without the token |
-| H6: tsc; editor unit; `node --test scripts/archilyzer-ops.test.mjs`; `docs cli --check` | clean; 250/250; 63/63; clean |
-| counts-only privacy greps over `72c44159..` (home paths, the operator's names and email, session links and trailers) | 0 each |
-
-## As it went (2026-10-10, daytime, after release 23's rollout)
-
-Added by the operator mid-batch (13:30). Two Opus implementers, worktrees `r24-hygiene` and `r24-e2e-speed`, from
-`r24/integration` (release 23 + the plan). Lane A: H1–H4 `c2840cf1`, then H5 (`/sites` saves) and H6 (`pnpm ops
-site-config`, asked for by Super Hasanalyzer: cited-only had no non-UI writer) `6e81242f`. Lane B: S4/S5a/S5b `93b29061`,
-the 1/2/3-worker measurement recorded and five specs serial `d670a39d`, the `e2e:all` lane fix `13da3cc6`. H5 (the
-`sites-crud.spec:491` flake) was added after release 23's gate found it red on `main` too (1/3 alone).
-
-**Measurement (S5b, on `244ec496`):** the editor suite at 1 / 2 / 3 workers: 21.6 / 14.2 / 11.3 min; 4 reds at 2 and at
-3 workers (different ones), every one green alone (49/49) — five specs moved to the serial project, the default stays 1.
-
-**`e2e:all`, first run (on `0d3b1a47`):** homepage 106, export 276, hub 39, 2-origin 3, report 46, umtool 282 + 1
-(`browse.spec:342`, green alone 23/23) — but the editor suite 663 passed, 23 failed, **45m29s**: export's 2-origin lane
-composed the hub into the checkout's `export/public` while the editor suite's export server read it (20 reds:
-`export-search` / `export-player-platform-cache` `beforeEach` timeouts), and left it replaced (a later editor run could
-not boot its export server). Fixed in `13da3cc6`: the editor suite also takes the `e2e-export` queue lock, and
-`e2e:all` starts export's lane after the editor's. The four editor spec files, re-run alone after the fixture was
-relinked: 21/21 and 7/7.
-
-### Gates
-
-| gate | result |
-|---|---|
-| privacy, counts only, `7c478f4a..0d3b1a47` (27 commits) | all 0/0; one identity |
-| `pnpm typecheck` | clean (75 s; 91 s on `fe6b97a1`) |
-| `pnpm test` (default `/tmp`) | common 3,721 · editor 256 · export 118 · homepage 23 · mcp 305 · scripts 788 + 3 skipped — 0 failed (H2 holds) |
-| `docs env\|files\|cli --check`, `settings example --check` | all 0 |
-| builds (`pnpm heavy`, 5 GB scope) | all ok (the editor's waited ~28 min behind another session's job holding the slot for memory) |
-| `pnpm e2e:all` on `fe6b97a1` (40.3 min) | editor 685 passed, 1 failed, 12 skipped (23m57s) · then export 276 · hub 39 · 2-origin 3 · report 46 · beside them homepage 106 · umtool 282 + 1 |
-| the two reds, alone | `site-scope.spec` 13/13 (its `:424` red also in release 23's full run); umtool `browse.spec` 23/23 |
-
-**Found and left:** umtool `browse.spec:342` ("a new song gets the shape…") is red in both side-by-side runs and green
-alone — its first locator waits 5 s on a page that renders slower beside the editor suite (wait on the page's ready
-marker, or put it in umtool's serial set). Other editor actions that `revalidatePath` share H5's exposure; AutoRefresh
-refreshes every page ~5 s after load (its first poll counts as a change).
-
-## Rollout (2026-10-10 evening)
-
-`main` fast-forwarded to `fe6b97a1` by the orchestrator.
-
-- **Editor** — build `MedVVoEYdaiEvf3HlPCzW` → `dZWdaTKIUovXkw0S1ixiY` (44 s), restart 19:51: `/` 200, PATH and
- `UV_THREADPOOL_SIZE=16` ok, no ZodError, queued 0 → 0; the MK session's re-queued `transcribe-file` (waiting on the held
- pool) closed as interrupted — told before and after. Smoke `SMOKE_FAIL=0`; the transcription pool still paused.
- H6 live: `site-config` refuses an unknown key and an unknown channel by name, nothing written.
-- **umtool** — not rebuilt (release 24 changes only a test and its e2e script there).
-- **Homepage + source mirror** — the standalone `source publish --check` did not run (the r24 wrapper named a script
- that did not exist yet, and read the previous run's log); the homepage build's own source audit on `fe6b97a1` is the
- gate it always is: clean (33,118 objects, 2,885 commits, 6,201 files against 14 denied literals), gitleaks clean.
- Deployed to production 19:54:44, live check ok. A fresh clone of the live mirror after the cache window: head `21dafeb2`, 2,885 commits;
- name, email local part, guarded suffix, session links and trailers 0; one identity.
-- **Public sites** — not rebuilt by hand: `export/` changed only its dist-dir switch and e2e scripts.
-- **Publish policies (ruled 2026-10-10):** `publish.auto: "build"` on jeralyzer, rekietalyzer, hasanalyzer, anilyzer,
- bonnellyzer, jasolyzer (written through `patchSite` after release 23's restart; private sites off; hub and homepage
- off). **The publish lane enabled 19:54:51** (`pnpm ops lane {"lane":"publish","enabled":true}`), after release 24's
- gates and rollout so its first builds did not queue ahead of them. Its first check: "the index is stale; the next update is due 1 h
- from now" — the site builds follow that index update.
-- **Pruned (ruled):** the merged `r18-*` and `r20-*` worktrees (12) and 16 merged `r18/*`, `r19/*`, `r20/*` branches
- (`git branch -d`); `r20/twitch-ids` kept.
-- **Sessions told:** Super Hasanalyzer, Super Jeralyzer and the Candace session (`site-config`, H1, the lane).
diff --git a/plans/release-25.md b/plans/release-25.md
@@ -1,387 +0,0 @@
-# Release 25 — local text-to-speech: narration for report videos, and podcasts
-
-Drafted 2026-10-10 (evening) on the operator's ask ("good local AI text to speech for videos or podcasts made from
-Archilyzer"). Rulings: **bake-off first, then build; stock voices only** — no voice cloning of anyone, no reference-audio
-prompting with a real person's voice; every output discloses a synthetic voice. **Engine + voice (ruled 2026-10-11, by ear from the
-bake-off `~/reports/tts-bakeoff/index.html`): Kokoro-82M only, default voice `af_heart`.** Integration map: the Explore report (job tmp
-`tts-map`), summarized in "Where it plugs in".
-
-## The bake-off, in one paragraph
-
-31 engine/voice runs over four lines (a card, numbers, a quote, a 45-s podcast paragraph), stock voices only. Kokoro-82M
-(kokoro-onnx 0.6.1 on onnxruntime CPU, fp32 `kokoro-v1.0.onnx` + `voices-v1.0.bin`, Apache-2.0 weights; phonemizer
-espeak-ng): RTF 0.46 on 8 CPU threads, load 1.3 s, ≈ 1 GB RAM, UTMOS 4.41 (af_heart 4.52, the best of all 31).
-Piper's better voices are not licensed for publishing; Kitten mini weaker on numbers; Chatterbox RTF 7.5 on CPU (6.5 GB,
-watermarked); Orpheus 3B RTF 1.7 on Vulkan (GPU contention) — not adopted. Kokoro's known wart: it reads "2024" as "two
-thousand twenty-four" (a text pre-pass fixes it); it speaks briskly (speed is a setting).
-
-## Shape
-
-- **Like transcription, never by hand** (the "no ASR by hand" rule's twin): synthesis runs as an editor job,
- `pnpm ops tts`, through an engine registry. umtool asks the editor for it (as `fetch-via-editor` does).
-- **Its own serial queue, not the transcription worker pool.** The pool's workers are ASR apps (`sanitizeWorkers` forces
- a local worker's `appId` to a transcription app; an untagged worker takes any lease). A CPU engine on queue `tts`
- (one synthesis at a time) needs none of that. If the picked engine uses the GPU, the queue's lane `contendsFor: "gpu"`.
-- **Content-addressed cache**: sha256 of (engine, model version, voice, speed, normalized text) → `<ttsDir>/<sha>.wav`
- (48 kHz mono PCM) + `<sha>.json` sidecar (engine, voice, model, license, seconds, createdAt). Never in `transcripts/`;
- default `settings.tts.dir` under the checkout's gitignored data dir (implementer picks, documented). A re-ask is free.
-- **Disclosure** is data: the sidecar names the engine and voice; a narrated video's description export and a podcast's
- show notes carry "Narration: synthetic voice (<engine> · <voice>)".
-
-## Slices
-
-| # | slice | owns | gate |
-|---|---|---|---|
-| **T1** | Engine + job + ops: **`archilyzer tts setup`** (creates a venv at `settings.tts.home` — default `~/.local/share/archilyzer/tts/kokoro` — installs `kokoro-onnx==0.6.1`, and downloads `kokoro-v1.0.onnx` + `voices-v1.0.bin` once from the kokoro-onnx project's `model-files-v1.0` release, verified by size/sha, polite: one stream, no retries in a loop; `--check` reports what is missing), a Python helper `scripts/tts_kokoro.py` (text file in, WAV out; lang from the voice prefix: `b*` → en-gb, else en-us), a **text pre-pass** in common (years 1900–2099 read as spoken — "twenty twenty-four", "nineteen ninety-nine", "two thousand five"; keep numbers otherwise to the engine; unit-tested), `common/lib/ttsApps.ts` (registry: id, label, license, `build({textFile, outWav, voice, speed}) → argv/env`, `voices()`), `scripts/tts.mjs` (dual-use wrapper: text in, WAV out; engine kinds: `kokoro` (default) and `espeak-ng` (the zero-install fallback the tests use)), `settings.tts` (`engine` = kokoro, `voice` = af_heart, `speed` = 1.0, `home` (the venv + models), `dir` (the cache); SETTINGS.md), `paths`/envVars rows (ENVIRONMENT.md), `common/controller/ttsFile.ts` (`enqueueTtsFile`: body `{text | file, voice?, engine?, speed?, out?}`, the corpus fence from transcribeFile, cache hit = a `done` job with `cached: true` and no engine run, result marker `@@tts-result ` `{wav, seconds, engine, voice, cached, durationMs, waitedMs}`), job kind `tts-file` on queue `tts` (not ingest), `editor/app/api/ops/tts/route.ts` + test, `pnpm ops tts` + usage + marker (COMMANDS.md), doctor check (engine + voice present) | common, scripts, editor | unit: registry, body refusals, fence, cache hit/miss, marker; route test; ops test; one real synthesis through the job with espeak-ng; `docs env|files|cli --check`, `settings example --check` |
-| **T2** | Report-video narration: manifest `narration` on `card` entries (`{text, voice?}`; text explicit — never derived from the card: opt-in, the operator's "show, don't tell" stays the default), `render.narration` (`engine?`, `voice?`, `lufs` default −17.7 to sit with the clips (README "teaser level"), `lead`/`tail` ≥ the crossfade `D`), `validateNarration` in `build-video.mjs` AND `lint.mjs` (text non-empty, length cap), `narrate-via-editor.mjs` (one batch of `pnpm ops tts` asks, follows the jobs, NDJSON events; driver step + `busy.mjs` regex), `buildCardSegment` swaps `anullsrc` for the narration WAV (`apad`/`atrim`, leveled, at `render.audioRate`/`audioChannels`), card `seconds`: `"auto"` = narration + lead + tail, a number shorter than that is a lint ERROR; a narration record beside the segment (teaser-style) so rebuilds re-encode only on change; chapters/description export add the disclosure line | umtool/report-to-video, umtool/lib/report | unit: validator, seconds auto, record invalidation, the ffmpeg args; one fixture build with a narrated card through a fake editor (e2e fixture); `onscreen*.spec` untouched or updated |
-| **T3** | Podcast: `build-video.mjs <manifest> --audio-only` (or `build-podcast.mjs`) renders the same entry list as sound only — clips' audio, narrated cards, a short silence for an unnarrated card (or skip it: `render.podcast.skipSilentCards`, default true) — loudness-normalized (−16 LUFS, podcast norm), chapters from the same ffmeta, to `out/<variant>/podcast.m4a` (+ `podcast.mp3`), and `show-notes.md` (chapters with timestamps, every cited source's link, the disclosure). umtool's report page offers it beside the video export | umtool | unit on the entry→audio plan and notes; one fixture render; the umtool spec for the export button |
-| **T1b** | **Orpheus 3B as a second engine** (operator, 2026-10-11: "I want Orpheus too, but it needs to be used better"), after T1, by Lane A, from the tuning round `~/reports/tts-bakeoff/orpheus2/` (chunker of 1–3 sentences, the shared normalizer with numbers/ordinals spelled out, the swept sampler settings, best-of-3 takes by a non-ASR check, punctuation-aware joins). llama-server (Vulkan) started per batch and stopped after, so VRAM is free for transcription; the engine declares the GPU, and the `tts` queue yields while a transcription runs; the disclosure adds "Built with Llama" (Llama 3.2 licence). Expressive tags pass through for Orpheus; Kokoro strips them | common, scripts | unit (chunker, normalizer, lifecycle with a fake server); one real Orpheus synthesis through a test editor |
-| **T5** | **Writing for the ear** (operator: "if the text is written with a little storytelling and pre-baked emotion, Orpheus can shine"): a narration-script step. A writing guide (rules from the tuning round's "written for the ear" takes) in `mcp/src/instructions.ts` (where corpus discipline lives) and the report-to-video docs; a umtool surface to review a video's narration script card by card (approve / edit; persisted), before synthesis. **Hard rule:** storytelling and emotion live in the delivery, never in the claims — every factual statement stays exactly as the cited evidence supports | mcp, umtool | unit; a umtool spec for the review page |
-| **T4** (later) | Publishing a podcast: `reports attach-audio` + an RSS enclosure on the report feed; docker image TTS stage + `fetch_tts_voice()` | common/publish, export, docker | — deferred, not this release |
-
-**Order / lanes:** T1 ∥ T2 (T2 codes against T1's contract above and a fake editor in its tests), then T1b after T1 and T3 after T2; T5 after the tuning round's writing rules.
-Two Opus implementers. Gates as release 23/24 (tsc per commit; the four builds; `pnpm e2e:all`; privacy counts).
-
-## Where it plugs in (from the map)
-
-`transcribeFile.ts` (body/fence/marker/`runManagedFunction`, `:65–608`) is the template for `ttsFile.ts`;
-`transcriptionApps.ts` for `ttsApps.ts`; `scripts/diarize.mjs` for `scripts/tts.mjs`; `jobKinds.ts` `transcribe-file`
-(`:898–911`) for `tts-file`; ops `transcribe` (`archilyzer-ops.mjs:331,354,577`) and its route/test for `tts`;
-`settingsSchema.ts` diarization block (`:263–277`, `:1812`) + `settingsDocs.ts` for `settings.tts`; report-to-video
-`buildCardSegment` (`build-video.mjs:1398–1430`) — the `anullsrc` input is where narration goes; validators at
-`:4002–4022` and `lint.mjs:193–203`; `fetch-via-editor.mjs` + `driver.mjs:230–260` + `busy.mjs:29` for
-`narrate-via-editor`; `muxChapters` (`:3838–3871`) and `export.mjs` for the podcast's chapters and notes.
-
-## Not doing
-
-Voice cloning (ruled out); Orpheus as the default (Kokoro af_heart stays the default); narration derived automatically from card text; narration under clips (the join graph —
-bigger, later if wanted); a cloud TTS.
-
-## Record
-
-### T1, as shipped — the TTS engine, the `tts-file` job and `pnpm ops tts` (`r25/tts-core`)
-
-Synthesis is an editor job, never by hand: `pnpm ops tts` (`POST /api/ops/tts`) enqueues a `tts-file` job that runs one
-engine through one wrapper into a content-addressed cache, and `archilyzer tts setup` installs the engine.
-
-- **The contract (Lane B codes against it).** Body `{text | file, voice?, engine?, speed?, out?}` — exactly one of
- `text` / `file` (an absolute path to UTF-8 text), at most 20,000 characters; `engine` `kokoro` | `espeak-ng`;
- `voice` one of the engine's stock voices; `speed` in the engine's range (0.5–2); `out` an absolute `.wav` path
- outside the corpus. Unknown keys are a 400; every refusal comes before a job. The job's log ends with ONE line
- `@@tts-result {json}`: `{wav, seconds, engine, voice, cached, durationMs, waitedMs, sha, sampleRate, speed,
- disclosure}` — `wav` an absolute path the editor wrote (`out` when given, else `<cache>/<sha>.wav`), `sampleRate`
- 48000, `disclosure` "Narration: synthetic voice (<engine label> · <voice>)" plus the engine's attribution sentence
- when it has one. `durationMs` is the engine's time (≈0 on a hit), `waitedMs` the wait on the `tts` queue.
-- **Expressive tags.** `TTS_EXPRESSIVE_TAGS` (`common/lib/ttsText.ts`): `laugh chuckle sigh cough sniffle groan yawn
- gasp`. Stripped, with no stray or doubled space and no doubled comma, for Kokoro and espeak-ng; any other `<…>` is a
- 400 naming it (with "did you mean <laugh>?" for a case slip). Exported for umtool's validator.
-- **The pre-pass** (`normalizeTtsText`, each engine's `normalize` hook): tags, then years 1900–2099 spoken ("twenty
- twenty-four", "nineteen oh five", "two thousand five", decades "the nineteen nineties"; amounts, decimals, times,
- slashed dates, percentages and longer numbers left alone), then whitespace collapsed — the cache key is on the
- result, so a re-wrapped paragraph is a hit.
-- **The registry** (`common/lib/ttsApps.ts`): id, label, model (in the key), licence, `attribution?`, `device`,
- `runtime` (`process` | `server`), the stock voices, default voice, speed range, `normalize`, `setup`, and `build`
- → the argv of `scripts/tts.mjs` (TTS_BIN), which runs the engine (`scripts/tts_kokoro.py` for Kokoro) and leaves a
- 48 kHz mono 16-bit WAV, bare 44-byte header, atomically. Kokoro: its 28 English voices (`a*` en-us, `b*` en-gb),
- `af_heart` default. A voice is a name from that list — never a path.
-- **The cache**: sha256 of (`archilyzer-tts/1`, engine, model, voice, speed, spoken text) → `<dir>/<sha>.wav` +
- `<sha>.json` (`synthetic: true`, the disclosure, engine, model, licence, voice, speed, seconds, the spoken text). A
- hit at enqueue is a `done` job on queue `""` that runs no engine; a miss runs on queue `tts` (`TTS_QUEUE`) and checks
- the cache again at its turn.
-- **Settings**: `settings.tts` `{engine: "kokoro", voice: "af_heart", speed: 1, home: "", dir: ""}`. **`home` is the
- ROOT of all engines** (`~/.local/share/archilyzer/tts` when blank), each engine in `<home>/<id>` — so Kokoro is at
- `~/.local/share/archilyzer/tts/kokoro`, the plan's path, and Orpheus (T1b) gets its own dir beside it. `dir` blank =
- `<repo>/.tts/cache` (gitignored `/.tts/`); a cache dir inside the corpus is refused. Paths: `ttsBin` (TTS_BIN),
- `espeakNgBin` (ESPEAK_NG_BIN), `ttsHome`, `ttsCacheDir`.
-- **`archilyzer tts setup [--engine] [--from <dir>] [--python <py>] [--check]`**: a venv (`uv venv --python 3.12`
- when uv is on PATH), `kokoro-onnx==0.6.1`, the two model files from the `model-files-v1.0` release pinned by size and
- sha256 — one stream each, no retries, `.part` then rename; `--from` hard-links (else copies) verified files;
- `--check` imports the package and lists what is missing. Scratch under the install dir, never the OS temp dir.
- `archilyzer doctor`'s `tts` row: installed is ok, not installed is a note (never a failure).
-- **How T1b (Orpheus 3B) slots in**: a registry entry with `device: "gpu"`, `runtime: "server"`, `attribution: "Built
- with Llama"`, `normalize` with `tags: "keep"` and a new numbers/ordinals option on `normalizeTtsText`, and a `setup`
- of its own; in `runTtsSynthesis` (marked) a GPU engine waits for the transcription pool to be idle, and a server
- engine takes a per-engine holder (llama-server started for the batch on the `tts` queue, stopped once the queue has
- been idle) whose URL `build` receives as `server`; `scripts/tts.mjs` gains `--engine-kind orpheus`.
-
-| commit | what |
-|---|---|
-| `cebeaff9` | the registry, the pre-pass (tags, years, whitespace) and the wrapper + Kokoro helper |
-| `c44946b1` | `settings.tts`, the TTS paths and env vars; SETTINGS.md, settings.json.example, ENVIRONMENT.md |
-| `24ca5907` | `tts-file` on the `tts` queue, the cache and its sidecar, the install check |
-| `7d37f6b2` | `POST /api/ops/tts`, `pnpm ops tts`, COMMANDS.md |
-| `ee9c1cd8` | `archilyzer tts setup`, the doctor's `tts` row |
-
-#### Gates
-
-| gate | result |
-|---|---|
-| tsc (`pnpm -r … exec tsc --noEmit`) | clean at every commit |
-| common unit | 3748 pass, 0 fail (new: ttsText 5, ttsApps 5, ttsSettings 3, ttsFile 8, tts-setup 5, doctor +1, settingsSchema/jobKinds updated) |
-| editor unit | 260 pass (new: `api/ops/tts/route.test.ts` 4, one a real espeak-ng synthesis through the route) |
-| test:scripts | 798: 795 pass, 3 skip (new: `tts.test.mjs` 4, `archilyzer-ops.test.mjs` +1) |
-| one real synthesis through the job with espeak-ng | `ttsFile.test.ts`: engine run once, the same ask re-wrapped a cache hit with no engine run, `out` copied, a file at another speed a new synthesis |
-| `docs env\|files\|cli --check`, `settings example --check` | clean |
-| `archilyzer tts setup --from <bake-off models>` | real, into the default home: venv + kokoro-onnx 0.6.1 by uv, both files hard-linked and verified; `--check` 0; re-run idempotent |
-| one real Kokoro synthesis through the route | the route handler in-process (an isolated temp corpus and cache, the real default home; under `pnpm heavy`): 466 characters (years, numbers, a `<laugh>`) → 30.65 s of 48 kHz audio in 14.85 s engine time, model load included — **RTF 0.48** (the bake-off's 0.46 without load); the sidecar spoke "nineteen ninety-nine" / "twenty twenty-four", the tag gone; the same ask again a cached done job, `durationMs` 0, no engine run |
-
-Not done here: the four `next build`s and `pnpm e2e:all` (the orchestrator's); no e2e spec was added (the route test
-runs a real synthesis in-process). Found and left: a job's `done` settles when its log stream is ended, not flushed
-(`runManagedFunction`), so a near-instant job (a cache hit) can settle before its log is on disk — `pnpm ops --wait`
-polls over HTTP and does not see it; the unit tests poll for the marker.
-
-### T2, as shipped — report-video narration (`r25/tts-video`)
-
-A card may carry words spoken by a stock synthetic voice. Opt-in and explicit: the words are the author's, never
-derived from the card, and a manifest without narration builds byte-for-byte as before.
-
-- **Manifest.** A `card`'s `narration: {text, voice?, engine?}` and `seconds: "auto"`; `render.narration {engine
- (kokoro), voice (af_heart), speed (1, 0.5–2), lufs (−17.7, −30 to −10), lead (0.8), tail (0.8)}`. Engine
- `kokoro | orpheus | espeak-ng` (the editor refuses `orpheus` until T1b); the engine and voice are always sent, so a
- change of the editor's default never changes a cut that did not ask for it.
-- **`validateNarration`** (`report-to-video/narration.mjs`, pure; the build before a single fetch, and the lint):
- narration on cards only; text non-empty and at most 300 words, the tags not counted; the only `<…>` are the
- expressive tags, lowercase and exact (the editor's rule; a case slip gets "did you mean <sigh>?"; a test holds the
- list equal to `TTS_EXPRESSIVE_TAGS`); a stock voice's id, never a path; each setting in range; `lead`/`tail` at least
- the crossfade; `seconds: "auto"` only beside a narration.
-- **`narrate-via-editor.mjs`** asks `POST /api/ops/tts` `{text, engine, voice, speed}` once per distinct narration (a
- key over words, engine, voice, speed), as one batch, follows each job on `GET /api/ops/job/<id>` (its queue place
- said as it moves), reads the last `@@tts-result` line of its tail (re-read briefly when a done job's line is not on
- disk yet), and COPIES the WAV into `out/narration/<key>.wav` beside `<key>.json`: the words, engine, voice, speed,
- measured seconds and LUFS, the copy's sha256, the editor job, and the editor's `disclosure`, verbatim. `out` is
- never sent. A narration kept is never asked again. The driver runs it as a step before the build when the manifest
- carries narration (`options.narrate`, set by the build route); `busy.mjs` sees it. A build that finds one missing
- asks itself; `--skip-fetch` refuses, naming the card.
-- **The card's sound**: the WAV in place of `anullsrc` (`narratedCardEncodeArgs`, `narrationAudioFilter`): resampled
- to `audioRate`/`audioChannels`, levelled from its measured loudness to `lufs` (±24 dB), limited at −1 dBFS, delayed
- by `lead`, padded and trimmed to exactly the card's seconds. `cardEncodeArgs` is the un-narrated encode, argument for
- argument as before.
-- **`seconds: "auto"`** = lead + words + tail, up to the tenth, on the run's copy of the timeline. An authored number
- shorter than that is a lint ERROR (`narrationLengthErrors`): the build refuses before it renders; `--lint` judges the
- narrations already kept. The deck's estimate reckons 2.7 words a second (`estimatedDuration`); `verify-build`'s
- length floor takes no number from "auto".
-- **Rebuilt only on change**: `segments/<id>.narration.json` holds the key (the card as resolved, the render block,
- the nodes, the framing, the narration's sha256, the sound's filter, the encode); a match leaves the segment, a
- change writes a new file through a rename (a take's linked segment is never written through).
- `SEGMENT_FILE_SUFFIXES` gains `.narration.json`.
-- **Disclosure**: the editor's own lines from the kept records ("Narration: synthetic voice (Kokoro-82M · af_heart)"),
- each once — in the cut's `comment` metadata (muxed with the chapters), and at the end of the `description` and
- `chapters` exports (`readCutDisclosure`). A narration not kept says the line in the editor's form.
-- README "Narration" (with "Writing narration": for the ear, the drama never outrunning the sources); docs
- `report-video.md` "Narrated cards"; "Not done yet" now says narration is on cards only.
-
-| commit | what |
-|---|---|
-| `96bab418` | narrated cards: validator, narrate-via-editor, the store, the card encode, "auto", the record, driver step, disclosure, e2e stub + spec |
-| `219f9967` | T1 as shipped: the editor's disclosure verbatim, exact tags (+ the `TTS_EXPRESSIVE_TAGS` test), a late result line re-read |
-
-### T3, as shipped — the podcast (`r25/tts-video`)
-
-`build-podcast.mjs <manifest> [--out] [--variant] [--progress ndjson]` renders the cut as sound only, **from its built
-segments**, so it plays exactly what the video plays. Takes the heavy slot.
-
-- **The plan** (`podcastPlan`, pure): heard — each clip (its `muteFrom` honoured, `muteSegmentSeconds` as the join
- does), each narrated card, each teaser with hits; left out — every entry with no sound of its own, or
- `render.podcast.silence` seconds of quiet each with `skipSilentCards: false`. Holds, moves, dips and the end fade are
- picture and are not in it.
-- **The sound**: joined end to end with 10 ms edges, levelled in two `loudnorm` passes (linear) to −16 LUFS / −1.5
- dBTP; `podcast.m4a` (AAC 160k, faststart) and `podcast.mp3` (128k, ID3v2.3 chapters), each with the chapters — the
- video's `chapters.ffmeta` titles at the podcast's own offsets — the title, and the disclosure as `comment`.
-- **`show-notes.md`**: title, subtitle, length, the chapters with times, every cited source's link once (a heard
- clip's by the QR's rule, a still's `citeUrl`, a post's `url`), the disclosure. **`podcast.json`**: the plan, each
- item's seconds, what was left out, the measured loudness, the files.
-- **Refusals**, naming each: a segment not built ("build the cut first — a fast build is enough"); a narrated card's
- segment made from other words than the manifest's (its `.narration.json` key). `validatePodcast` (`render.podcast`:
- `skipSilentCards, silence, lufs, truePeak, bitrate, mp3, mp3Bitrate`) runs in the render and the lint.
-- **umtool**: the build route's `options.podcast` runs it alone (no preflight, no verify, no overwrite guard; job
- `podcast <project>`); `GET /api/report/podcast?project&variant&file=m4a|mp3|notes` serves the three by name
- (`podcastFor`, `PODCAST_FILES`); the project page's export row has a **podcast** button per cut
- (`PodcastExport.tsx`), then links to the three files.
-
-| commit | what |
-|---|---|
-| `094b64fb` | build-podcast, validatePodcast, the route option, the file route, the export-row button, driver/busy, docs |
-| `1f48aa9c` | a post's label without a nested template literal (`next-build-trace.test.mjs` misread it as running to the file's end) |
-
-#### Gates (T2 + T3)
-
-| gate | result |
-|---|---|
-| tsc (`pnpm -r … exec tsc --noEmit`) | clean at every commit |
-| umtool unit (`report-to-video/*.test.mjs`, `lib/*.test.mjs`, `lib/report/*.test.mjs`) | 655: 653 pass, 2 skip (new: `narration.test.mjs` 12, `narrate.test.mjs` 6 — a fake editor, three real builds, `build-podcast.test.mjs` 6 — a real render, `export-narration.test.mjs` 1, `driver.test.mjs` +2, `deliverables.test.mjs` +2 asserts) |
-| `pnpm run test:scripts` (after the T1 merge) | 825: 822 pass, 3 skip |
-| un-narrated byte-identity | the same manifest (two cards, a still, hard cuts, chapters) built by `9d805472`'s and this branch's `build-video.mjs`: every segment and the final mp4 md5-identical |
-| umtool e2e `report-narration.spec.ts` (new; start mode, at `219f9967`) | 3 passed (14.9 s): the chain's narration step, a fixture build voiced by the e2e editor stub's tone (one ask, the words, engine and voice on the wire; the card audible, "auto" 3.7 s; the plain card −91 dB; the exports' disclosure), the export row's podcast (files, 2 chapters, `left: ["k02"]`, served by name, a traversal name a 400) |
-| umtool e2e `build.spec.ts onscreen.spec.ts` | 14 passed (35.9 s) |
-| umtool capped `next build`, corpus linked (`pnpm heavy`, 5 GB cap) | compiled in 7.1 s, TypeScript 15.0 s; link removed |
-| counts-only privacy greps over `9d805472..` (home paths, the operator's names and email, session links and trailers) | 0 each |
-
-Not done here: no real Kokoro synthesis through the live editor (the fake editor and the e2e stub stand in; T1's
-gate ran one through the route), the editor/export/homepage builds and `pnpm e2e:all` (the orchestrator's).
-**Found and left.** A podcast is made from the last build's segments: a clip re-cut since is heard as it was built
-(only a narrated card's words are checked). Narration under clips, and a podcast's RSS enclosure (T4), are not built.
-
-### T5, as shipped — writing for the ear: the narration review and the writing guide (`r25/tts-video`)
-
-The review surface first, then the writing guide from the Orpheus tuning round's "Written for the ear" rules.
-
-- **`/browse/<project>/narration`** (linked from the project page as **Narration — N** when a card is narrated): each
- narrated card's words beside what it shows on screen (kicker, heading, sub, the deck title), its engine · voice, its
- words and estimated seconds, and **Approve**, **Reject** (a note required: "say what is wrong with the words", the
- clip verdict's rule), **Save words**, **Play**. Verdicts and Play are disabled while the words are unsaved: a verdict
- is on the words as saved.
-- **The store** is takes/verdicts.json's shape, beside the manifest: `<project>/narration.review.json`, `{ "<cardId>":
- { verdict: "approved" | "rejected" | null, note, key, text, at } }` (`report-to-video/narration-review.mjs`: its own
- write queue, tmp + rename, a file that does not parse is an error and never overwritten, an empty row removed).
- **A verdict is on the words and voice it was given on**: `key` is the narration's key (text, engine, voice, speed),
- so an edit or a voice change leaves the card "edited" — not approved — with nothing having to remember to clear it.
- The page's edit clears the verdict too.
-- **Edit** goes through the manifest writer's new `updateNarration` (only `narration.text`, trimmed; a snapshot first;
- the build's `validateNarration`, which now joins every structural writer's checks; the generated-manifest edit note).
-- **Play** is a job (`narrateCardSteps`: `narrate-via-editor.mjs --only <id>`, new), followed by id, then
- `GET /api/report/narration/audio` serves the kept voice for the card's current words. Playing approves nothing.
-- **The build**: no review file — nothing held, the lint WARNS (existing narrated cuts build as they did). With one,
- every narrated card in the cut must be approved on its current words: unreviewed or edited is a lint ERROR unless
- `--narration-unreviewed` (then a note per card); **rejected refuses always** (rewrite and approve it, or take the
- narration out). The check is in the lint (`reviewProblems`), so `--lint` reports it and a build refuses before any
- voice is asked for.
-- **The guide.** The hard rule — storytelling and emotion live in the delivery, never in the claims; every factual
- statement stays exactly as the cited evidence supports; no invented quotes, no motives or feelings attributed to real
- people, no intensifiers that change a claim's strength — in both places:
- - **the report-to-video README's "Writing narration"**: all ten tuning-round rules, condensed, with the evidence
- that makes them believable (a tag reacting to what was just said voiced 7–9 of 9 takes, one after a greeting 0 of
- 6; story-shaped text 10–20% slower on Orpheus; "..." read at 2.0–2.5 words/s; a paragraph-ending punch 4.41–4.51
- UTMOS; tags costing naturalness and 0.5–3 s each), a note that Kokoro reads the same scripts (tags stripped, its own
- pace), and a worked example — a flat report sentence and its for-the-ear rewrite, invented content, no real names;
- - **`mcp/src/instructions.ts`**, short: `narrationStep()` in every sweep plan carries `NARRATION_HARD_RULE` and the
- five rules that mattered most (`NARRATION_WRITING_RULES`: short sentences and fragments; "..." for a beat, one a
- sentence; a tag only where a person would make that sound, reacting, at a sentence boundary, one a paragraph; end a
- paragraph on a punch or a question; a quote its own sentence after a colon lead-in), and the Kokoro note.
-- **Rulings (confirmed by the orchestrator):** a rejection needs a note; `--narration-unreviewed` never builds a
- rejected card; a voice change un-approves, as an edit does; the gate applies to `--chrome-only`.
-- Docs: README "The narration review"; `docs/report-video.md` "Narrated cards".
-
-| commit | what |
-|---|---|
-| `39a7c923` | the review store, the lint/build gate and `--narration-unreviewed`, `updateNarration`, the page, its three routes, `--only`, the MCP rule, docs |
-| `9016f63c` | the narration specs count the stub's asks from their own start (they share its log) |
-| `988a62e5` | the writing guide: the README's ten rules, the Kokoro note and the worked example; the MCP plan's five rules |
-
-#### Gates (T5 surface)
-
-| gate | result |
-|---|---|
-| tsc | clean at every commit |
-| umtool unit | new `report-to-video/narration-review.test.mjs` 5 (the file, the writer, the states, the problems, a build refused before any ask / let through by the flag / a rejected card refused regardless), `lib/report/narration-review.test.mjs` 2 (`updateNarration`, the view), `driver.test.mjs` +1 |
-| `pnpm run test:scripts` | 833: 830 pass, 3 skip |
-| mcp unit | 306/306 (+1: a sweep plan carries the hard rule verbatim and each of the five writing rules) |
-| umtool e2e `narration-review.spec.ts` (new) + `report-narration.spec.ts` (start mode) | 5 passed (20.1 s): approve; reject refused without a note, then with one; edit saved through the manifest and un-rejected; play asked the stub once for that card's words and the audio route served the WAV; a build refused with "timeline k02: its narration is not reviewed" and wrote no mp4 |
-
-### T1b, as shipped — Orpheus 3B as a second engine (`r25/orpheus`)
-
-The operator's ask after the tuning round (job tmp `tts-orpheus2-report.md`; the pipeline `run_orpheus2.py`): Orpheus as
-a second engine, its tuned pipeline ported, Kokoro (af_heart) still the default.
-
-- **The engine** (`common/lib/ttsApps.ts` `orpheus`): Orpheus 3B 0.1-ft Q8_0 GGUF on llama.cpp's server + the SNAC
- 24 kHz ONNX decoder on the CPU (onnxruntime; no torch). `device: "gpu"`, `runtime: "server"`, voices `tara leah jess
- leo dan mia zac zoe` (default `leah`, `zac` the male option), speed range [1, 1], licence "Llama 3.2 Community
- License + Apache-2.0", attribution "Built with Llama" — the disclosure reads "Narration: synthetic voice (Orpheus 3B ·
- leah). Built with Llama". The sampler is the round's choice (t 0.7, top_p 0.9, top_k 50, min_p 0, repeat_penalty
- 1.1, repeat_last_n 64), seeds 1234 + 101·take + chunk. Files pinned by size and sha256: the GGUF from
- `unsloth/orpheus-3b-0.1-ft-GGUF`, `snac_decoder.onnx` and `snac_config.json` from `onnx-community/snac_24khz-ONNX`
- (each identical to the bake-off's copy).
-- **`settings.tts.orpheus`** (SETTINGS.md): `serverBin` `/usr/lib/ollama/llama-server`, `libraryPath`
- `/usr/lib/ollama` (LD_LIBRARY_PATH), `ggmlBackendPath` `/usr/lib/ollama/vulkan/libggml-vulkan.so`, `port` 8799,
- `gpuLayers` 99, `contextSize` 8192, `startTimeoutSeconds` 150, `idleStopSeconds` 5, `heavyEstimateMB` 4000, `takes`
- 3, `tagCheck` false. Nothing about the server is hard-coded.
-- **The normalizer** (`lib/ttsText.ts`): the round's `normalize()` ported, its 17 self-tests as unit tests (all pass
- unchanged). Options per engine: tags kept (Orpheus) or stripped; years `guarded` (Orpheus: "1950 people" is a count)
- or `plain` (Kokoro keeps T1's rule); paragraphs kept for the chunker or joined. Kokoro now gets the whole spoken form
- too (numbers, money, ordinals, times, URLs, handles, abbreviations), so its cache keys change once.
-- **The chunker** (`lib/ttsChunk.ts`): the round's `chunk()` and the token budget, held byte-equal to the pipeline's own
- output on all nine bake-off lines. The editor chunks; the helper renders.
-- **The helper** (`scripts/tts_orpheus.py`, behind `scripts/tts.mjs --engine-kind orpheus`): per chunk up to `takes`
- takes, the FIRST that passes kept (end token reached, no malformed frame, not truncated, words/s in band, no long
- silence); the rate floor is lowered 0.25 words/s per sentence past the first (min 1.5), so slow multi-sentence and
- story reads pass. When none passes: the fewest failures (never a truncated or malformed take) are kept and the chunk
- is FLAGGED (job log, sidecar `flagged`); all truncated or malformed fails the job. Joins: trim, loudness match ±6 dB,
- 15 ms fades, pauses 0.30 / 0.15 / 0.60 s. **UTMOS is left out**: it needs torch, which the default install does not
- carry. The tag-length check (a plain-twin take per tagged chunk) is behind `tagCheck`, off.
-- **The server** (`controller/ttsServer.ts`): one holder per engine; started through `queue-lock --heavy --estimate`
- for the first synthesis of a batch, `/health` polled, reused by the next, stopped (SIGTERM to its process group,
- SIGKILL after 15 s) once `idleStopSeconds` pass with nothing taking it, on a failed or cancelled start, and on the
- editor's exit. A port something else answers on is refused. Server output goes to `<install dir>/server.log`, the
- gate's lines to the job log.
-- **The GPU wait** (`ttsFile.ts` `waitForGpu`): a GPU engine waits to start while a transcription runs on a local
- worker whose device is not `cpu`; a synthesis running is not interrupted.
-- **Setup and doctor**: `archilyzer tts setup --engine orpheus [--from <dir>]` (venv with onnxruntime 1.31.0 and numpy
- 2.5.4; the three files); setup, `--check` and the doctor's `tts` row also check the configured `serverBin`.
-- **For Lane B / umtool**: the engine id is `orpheus`, its label `Orpheus 3B` (umtool's fallback label map says
- `Orpheus`; the editor's `disclosure` is used verbatim when present, and it carries "Built with Llama"). `speed` must be
- 1 for Orpheus (absent is fine).
-
-| commit | what |
-|---|---|
-| `edbabe51` | the spoken-form normalizer (17 self-tests) and the chunker, Kokoro on the new normalizer |
-| `3be65c04` | the `orpheus` engine, `settings.tts.orpheus`, the server holder, the GPU wait, the helper and the wrapper |
-| `1fe6160f` | `tts setup --engine orpheus`, the doctor, the ops help, COMMANDS.md |
-| `998a3450` | merge of `r25/integration` (T5) |
-
-#### Gates (T1b)
-
-| gate | result |
-|---|---|
-| tsc (`pnpm -r … exec tsc --noEmit`) | clean at each code commit |
-| common unit | 3772 pass, 0 fail (new: ttsChunk 5, ttsServer 6 — a fake llama-server: reuse, idle stop, restart on new settings, port refusal, early death, start timeout, cancel, SIGKILL; ttsFile +5, ttsApps +3, ttsText +3, ttsSettings +1, tts-setup +1) |
-| editor unit | 260 pass |
-| test:scripts | 827: 824 pass, 3 skip (new: `tts_orpheus.test.mjs` 2 — the helper's selftest of 22 checks; `tts.test.mjs` refusals) |
-| `docs env\|files\|cli --check`, `settings example --check` | clean |
-| `archilyzer tts setup --engine orpheus --from <bake-off models>` | real: uv venv py3.12 + onnxruntime 1.31.0 + numpy 2.5.4, the three files hard-linked and verified; `--check` 0 |
-| one real Orpheus synthesis through the route, voice leah | in-process route handler, isolated temp corpus and cache, under `pnpm heavy` (10 GB free, VRAM idle 115 MB, nothing else on the GPU): 372 characters, 3 paragraphs with a `<sigh>`, numbers and a date → 3 chunks, each passing on its FIRST take → 24.8 s of audio in 44.9 s engine time — **RTF 1.81** (2.09 wall, the 6.8 s server start included); VRAM peak 4442 MB, back to 112 MB after the idle stop; no llama-server left running; the sidecar disclosed "Built with Llama" |
-
-## As it went (2026-10-10 evening → 2026-10-11)
-
-Operator's ask (2026-10-10 evening): good local AI text-to-speech for videos and podcasts made from Archilyzer.
-Rulings, in order: a bake-off first, then build; **stock voices only** (no cloning, no reference audio; outputs disclose a
-synthetic voice); Kokoro-82M `af_heart` picked by ear, Kokoro only (2026-10-11); then "I want Orpheus too, but it needs
-to be used better" → a tuning round and T1b; then "if the text is written with a little storytelling and pre-baked
-emotion, Orpheus can shine" → T5. After the live renders: "Orpheus is definitely better than Kokoro here, but it could use
-some tuning still" — the operator is listening for specifics (owed: a tuning pass from those notes; whether Orpheus
-becomes the default).
-
-- **Bake-off** (`~/reports/tts-bakeoff/`): 5 engines, 31 runs; Kokoro RTF 0.46 CPU, UTMOS af_heart 4.52; Piper's good
- voices not publishable; Chatterbox RTF 7.5 CPU and watermarked; Orpheus RTF 1.7 on Vulkan.
-- **Orpheus tuning round** (`~/reports/tts-bakeoff/orpheus2/`): chunking (1–3 sentences), the normalizer, best-of-3 by
- non-ASR checks, punctuation joins; sampler matters little; leah and zac best; written-for-the-ear text slows Orpheus
- 10–20 % (Kokoro unchanged); tags land when they react to something just said. 10 writing rules → T5.
-- Lanes: A (`r25/tts-core`, then `r25/orpheus`): T1 `3704fe94`, T1b `3e12fd7d`; B (`r25/tts-video`): T2/T3 `064eb930`, T5
- `4a75c125`. Merged `1dfb5d56`, `0c1529e8`, `dd193a2c`, `8a89125c`, `0ff1e902`; main's plan commit merged in `1edeb0d6`.
-
-### Gates (on `0ff1e902`)
-
-| gate | result |
-|---|---|
-| privacy, counts only, `2f357f3a..0ff1e902` (29 commits) | all 0/0 except one "home path" in added lines: a synthetic `/home/someone/reference.wav` in `ttsFile.test.ts`, the test that a reference-audio path is refused as a voice (the no-cloning rule) |
-| `pnpm typecheck` | clean (86 s) |
-| `pnpm test` | common 3,772 · editor 260 · export 118 · homepage 23 · mcp 306 · scripts 832 + 3 skipped — 0 failed |
-| docs checks, settings example | all 0 |
-| builds | editor 41 s · export 21 s · homepage 13 s · umtool 25 s |
-| `pnpm e2e:all` (36 min) | homepage 106 · umtool 287 + 1 (`browse.spec:342`, green alone 23/23 — the side-by-side flake recorded in release 24) · editor 685 + 1 · export 276 · hub 39 · 2-origin 3 · report 46 |
-| the editor red, `channel-build-toggle.spec:23` | alone ×10: release 25 9/10, **`main` fe6b97a1 9/10** — an existing ~10 % flake, not this release's |
-
-## Rollout (2026-10-11)
-
-`main` fast-forwarded to `1edeb0d6`.
-
-- **Editor** — build `dZWdaTKIUovXkw0S1ixiY` → `XS9QCmFhdVixBVob7eLcl`, restart 13:20: `/` 200, no ZodError; one job closed
- as interrupted (the MK session's `transcribe-file`, waiting on the held pool since 2026-10-10 19:52 — that session had
- ended and could not be told). Smoke 0; the transcription pool still paused.
-- **umtool** — rebuilt and restarted (T2/T3/T5): `/` 200.
-- **Live TTS through the editor** (`pnpm ops tts --wait`, the same written-for-the-ear line with a `<sigh>`): Kokoro
- af_heart 8.17 s in 5.5 s (RTF 0.68, the tag stripped); Orpheus leah 9.8 s in 19.2 s (RTF 1.96, server up in 7.1 s, take
- 1 passed, disclosure "… Built with Llama"), llama-server stopped after the idle window. Engines installed at
- `~/.local/share/archilyzer/tts/{kokoro,orpheus}` (hard-linked from the bake-off's verified files).
-- **Source mirror + homepage** — `source publish --check` on `1edeb0d6`: audit clean (33,450 objects, 2,918 commits,
- 6,284 files against 14 denied literals), gitleaks clean; homepage deployed, live check ok. A fresh clone of the live
- mirror after the cache window: head `43623dff`, 2,918 commits; every privacy count 0; one identity.
-- **Public sites** — not rebuilt (no export change); the publish lane's `build` policy builds them on its own schedule.
diff --git a/plans/release-28.md b/plans/release-28.md
@@ -1,1054 +0,0 @@
-# Release 28 — the remaining media tasks, generation quality, follow-ups and housekeeping
-
-Status: **LIVE 2026-10-14** — all slices but M8 (it waits for the operator's bench bar) merged, gated and rolled out;
-the live smoke's five fixes on `main`.
-
-## Start here (the implementing session)
-
-Read before acting:
-- `AGENTS.md`;
-- `plans/STATE.md` ("Now") and `plans/FACTS.md`;
-- `plans/tools/implementer-rules.md`;
-- this plan, and `plans/release-27.md`'s record (the machinery this release builds on).
-
-**The orchestrator** runs in the primary checkout; the integration branch is in the worktree `~/Projects/r28-integration`:
-- lane worktrees: `pnpm wt add <branch> --from r28/integration`, then `link-fixture-public.sh`;
-- merges are `--no-ff`; `main` moves by `git merge --ff-only` after the gates;
-- rollout scripts are `~/reports/release-27/scripts` copied to `~/reports/release-28/scripts`, MERGE and LIVE re-guarded.
-
-## Rulings (operator, 2026-10-13)
-
-- **Review gate:** the full gate. Drafted fields carry provenance and an approve/reject, a field the operator edited is
- never overwritten, and a `final` build refuses unapproved drafts (the original plan's D2).
-- **Verdicts:** bench first. A `verdicts` task ships only for models that pass the operator's bar, as AWAITING_REVIEW
- proposals.
-- **Cleanup is authorised without a per-item OK (after the gates):** prune stale worktrees, delete the stopgap folder and
- the user-level `/gen`, delete the candalyzer site, finish and deploy the hub tombstone.
-
-## Facts found (survey, 2026-10-13)
-
-- None of the media tasks exist. `common/lib/report/draft/tasks/index.ts` has five (sweep-agent, sweep-pipeline,
- revise-report, revise-video, narrate). No `drafted` provenance or general review exists anywhere.
-- **The pattern to copy** is `narrate.ts`: evidence per entry → `structuredAnswer` against a schema → checks
- (`grounding.ts`) → keep the better of two attempts → a `<task>-draft.json` audit file → `snapshotManifest` →
- `writeManifest` (`tasks/project.ts`).
-- **The gate to generalise** is release 25's narration review: `umtool/report-to-video/narration-review.mjs` (the
- `NARRATION_REVIEW_FILE`) and `build-video.mjs:4137` (an un-approved narrated card refuses the build unless
- `--narration-unreviewed`); `umtool/lib/report/narration-review.mjs` is umtool's view; `driver.mjs:55` has the
- `final` mode.
-- **Where each media field lives** (manifest; `umtool/report-to-video/README.md`):
- - clips: timeline entries, today one per citation in report order (`convertManifest.ts:407`);
- - on-screen: an entry's `onscreen.{title,subtitle}` (`umtool/lib/report/onscreen.mjs`, `OnscreenSection.tsx`;
- validated by `deck.mjs` `normalizeOnscreen`);
- - teaser: a `{type:"teaser", lines, …}` entry (`StructureEditors.tsx` hand editor);
- - flips: `render.chrome.flips.pairs[]` (`flips.mjs` `validateFlips`, `validateFlipEntries`; no umtool UI);
- - threads: `render.chrome.threads.list[]` and each clip's `thread` key (`threads.mjs` `validateThreads`,
- `validateThreadEntries`; no UI; NOT social posts);
- - YouTube title and description: no field anywhere (new);
- - verdicts: the report's `Claim.verdict` (`schema.ts:80`), mirrored to the manifest's `claim.verdict`; no op sets it.
-- **Q0 (binding for every prompt):** counts and lengths are enforced in code; prompts carry rules, never worked
- examples; keep the better of two attempts; the local prompt is ≤ 8k tokens.
-- **Quality gaps:**
- - no check catches a speaker's first-person words in the narrator's mouth (`grounding.ts:179-237` is where the lints
- live);
- - nothing rejects a fragment quote ("I priced it as"; `citations/verify.ts`, `tasks/quotes.ts`);
- - local revisions mostly fail in the tool loop (the r27 fallback asks once with `structuredAnswer`, and the numbered
- view is never trimmed to the 8k cap).
-- **Follow-ups:**
- - research continuation is only request-driven (`researchRuns.ts` `continuationOf` / `markContinued`, called from
- `reportDraft.ts:315,392`);
- - the extractor is settings-only (`reportDraft.ts:465`);
- - `report-draft` discards `setProgress` (`JobProgressMetric` in `common/jobs/registry.ts:17`; example
- `controller/fetchWindows.ts:274`);
- - `~/.claude/commands/gen.md` is the stale stopgap version (the repo's overrides it in this project).
-- **Housekeeping:**
- - `scripts/parakeet-stitch.mjs:346` mkdtemps, and the pause path `process.exit`s inside the `try` (:360), skipping the
- `finally` rm (:379);
- - flaky tests: `relocateChannelMedia.test.ts:1602` (real rsync in a shared temp dir), `scripts/queue-lock.test.mjs:792`
- (timing), `editor/e2e/backfill.spec.ts:516` (unchecks before the previous save settles);
- - A7: `~/reports/release-26/scripts/a7-fill-media.sh` (40 post captures via the editor, 2 windows, prepare, private
- homepage);
- - site delete is editor-only (`editor/app/sites/actions.ts:319` → `common/lib/site.ts:311`), with no ops verb;
- - the hub tombstone code shipped (`common/publish/tombstones.ts`); a hub publish with its live tombstone probes, and
- release 18's "open question 1", are owed;
- - about 17 worktrees are on branches merged into `main` (unmerged: `mk/dedup-ums`, `export/gumroad-tip`,
- `r13/phase-5`, `diet-series`; plus a detached `render-local-sources`);
- - `plans/STATE.md` "Now" predates r27's rollout.
-
-## Shape
-
-**The draft framework (M0)** — one shape for every media task, narration included:
-- A drafted manifest field carries `drafted: {task, model, at, iteration?, attempt}` beside it (an entry's `onscreen`, a
- teaser's `lines`, `render.chrome.flips`, `render.chrome.threads`, `publish.youtube`, a card's `narration`; the
- timeline order for `cut`).
-- **No overwrite:** a field without `drafted` (the operator wrote or edited it) is never replaced. The new draft goes to
- `<task>-draft.json` as an alternative with "use this" in umtool. Editing a drafted field in umtool removes its
- `drafted` (it is the operator's now).
-- **The review** generalises `narration.review.json` into one review file keyed by `task/entry/field`: approve or reject
- with a note. `build-video` lints it: preview and fast builds pass with a warning; `final` refuses any
- drafted-and-unapproved field (`--drafts-unreviewed` overrides, as `--narration-unreviewed` does). Narration moves
- onto it, and existing narration reviews read unchanged.
-- **A media task** = `(iteration, entries?, model, force?)` → evidence → `structuredAnswer` → code checks (counts,
- lengths, ids that exist, grounding) → the better of two attempts → `<task>-draft.json` → snapshot → write with
- `drafted`. Each task is registered in `tasks/index.ts`, runs as a `report-draft` step on the iteration (like narrate:
- `steps[]`), and gets a route in `settings.generation.routes`.
-
-**The tasks:**
-- **M1 cut** — selection and order from the report's citations. A cap on clip count (setting, default 20), ids only
- from citations, order by argument; windows untouched (fetch and snap stay code).
-- **M2 on-screen** — title (≤ 60 chars) and subtitle (≤ 90) per entry, grounded in the claim and quote.
-- **M3 teaser** — 3 to 5 lines, each ≤ 70 chars, no quotes read out, grounded.
-- **M4 flips** — THEN/NOW pairs over existing timeline ids. A pair needs two clips on one topic at different dates
- (dates checked in code). `validateFlips` passes.
-- **M5 threads** — a short list (2 to 4) and a `thread` key per clip. `validateThreads` passes.
-- **M6 YouTube** — a new manifest field `publish.youtube {title, description}`:
- - the model writes the title (≤ 100 chars) and a summary paragraph;
- - code appends chapters from the build's chapter list, and source links from the citations (moment links);
- - the build writes `out/youtube.txt`;
- - umtool shows and copies it.
-- **M7 verdict bench** (local-only data, counts-only in commits):
- - one claim per call (claim, quote, the transcript window) over existing fact-checks with operator rulings;
- - models: Sonnet 5.5, Opus 5.5 and qwen3:8b;
- - per model: agreement, a confusion matrix, CONTRADICTED and NOT_FOUND recall, against an always-CORROBORATED
- baseline;
- - a umtool results page, audit-style;
- - the operator then sets the bar.
-- **M8 verdicts** (only after the bar is set, only for passing models):
- - a `proposedVerdict {verdict, model, reason}` on claims;
- - AWAITING_REVIEW in umtool, approve → `verdict`;
- - never written to `verdict` directly.
-- **M9 surfaces:**
- - "Draft with <model>" per section in the project and Iterations pages;
- - "Draft everything" = the chain's optional text steps (cut → windows → on-screen → teaser → flips → threads →
- narration → voices → fast build → podcast → YouTube);
- - MCP `generate` and `generation_policy` know the new tasks, and `/gen` and `archilyzer gen` follow.
-
-**Quality (Q):**
-- **Q1** — a hard narration check: a first-person sentence (I/my/me/we/our outside a quote) is refused. The narrator is
- third person by rule. If a sentence closely matches an evidence quote, the reason names it.
-- **Q2** — a quote-fragment check:
- - a generated quote under 4 words, or ending on a function word (as, to, the, and, of, a…), is `fragment`;
- - code offers the full sentence from the cue window, and the repair round and revisions use it;
- - verify-quotes reports `fragment` as a warning for existing reports;
- - `authoringRules.ts` gains "quote a whole sentence or clause".
-- **Q3** — local-first revisions: for an ollama model, skip the tool loop and make one `structuredAnswer` ops batch over
- a numbered view trimmed to the 8k cap (sections the feedback names first, quotes shortened in the view only). The API
- path is unchanged.
-
-**Follow-ups (F):**
-- **F1** — auto-continue: an `auto` research run whose acquisitions settle continues into its sweep by itself (a check
- on the editor's existing heartbeat, plus at each acquisition job's end). Channels not yet in any build are skipped,
- with a warning, and the caps hold.
-- **F2** — a per-job `extractorModel` body key (ops, umtool per-step model, MCP `generate`).
-- **F3** — progress metrics on `report-draft`: `turns` for agent tasks, `cards` and `entries` for media tasks; a new
- `JobProgressMetric` value, threaded through `TaskDeps`.
-- **F4** — retire the stopgap: delete `~/reports/local-reports` and `~/.claude/commands/gen.md`; docs say the repo's
- `/gen` is the one.
-
-**Housekeeping (H):**
-- **H1** — parakeet-stitch: rm the temp dir before the pause `process.exit`, plus a start-up sweep of
- `parakeet-stitch-*` older than 24 h that no running process holds; then remove today's 21 stale dirs.
-- **H2** — the three flaky tests: an isolated temp dir and mtime tolerance; timing slack; wait for the save to settle
- before unchecking.
-- **H3** — `plans/STATE.md` "Now" rewritten for r27-live and r28; FACTS gains r27's facts (the two-line finding, the ops
- ask, delete semantics).
-- **H4** — the A7 leftovers: re-check the script against r27's CLI (`prepare --only`), then run it through the editor
- (paced captures on the posts queue).
-- **H5** — `pnpm ops delete-site {id}` (an adapter over `deleteSiteAction`, refusing a site that has a deployed project
- unless `force`); then delete `candalyzer` with it. Channel data untouched; the Candace rule stands.
-- **H6** — the hub: `archilyzer publish hub` build and production deploy; read the tombstone probes (plain and busted);
- answer release 18's open question 1 in the record.
-- **H7** — prune the worktrees whose branches are merged into `main` (branches kept; the unmerged four and
- `render-local-sources` untouched); `r27-integration` is replaced by `r28-integration`.
-
-## Lanes (at most three Opus implementers; worktrees from `r28/integration`)
-
-- **S0 (orchestrator):**
- - `r28/integration` from `main`;
- - `plans/release-28.md` committed (this plan);
- - test-kit additions: manifests with every field, a fact-check fixture with ruled claims (synthetic);
- - H3.
-- **Phase 1:**
- - lane A: M0 (framework, review, the `final` refusal, badges, narration moved onto it);
- - lane B: Q1 → Q2 → Q3 → F2 → F3;
- - lane C: M7 bench → H1 → H2 → H5 (code).
- - The orchestrator, meanwhile: F4, H4, H7, then H5's delete and H6 once their code and the gates allow.
-- **Phase 2 (after M0):** lane D: M1 → M2 → M3; lane E: M4 → M5 → M6; lane F: F1.
-- **Phase 3:**
- - M9 (one lane);
- - M8 once the operator has set the bench bar (the bench results page is the handoff);
- - then the gate round and the rollout.
-
-Prelude and briefs follow r27's (`$T/r27-prelude.md` → `$T/r28-prelude.md`): the test kit, fakes, no real LLM calls in
-tests, memory floor, single-spec e2e for lanes, records in this file.
-
-## Rules that bind every slice
-
-As release 27:
-- no session links or trailers; the Co-Authored-By line alone;
-- heavy work through the heavy slot (6 GB floor, one `next build` at a time);
-- scratch in the job dir, never `/tmp`;
-- no hand edits under `transcripts/**`;
-- no yt-dlp, gallery-dl or ASR by hand;
-- never print the key or the scrub files;
-- Candace data never in fixtures — the M7 bench reads ruled claims locally and commits counts only;
-- tests use the S0 fakes; real API calls only in the bench run (≤ $5) and the live smoke (≤ $3).
-
-## Verification
-
-- Gates on `r28/integration`:
- - `pnpm typecheck`, `pnpm test`, `docs env|files|cli --check`, `settings example --check`;
- - the four capped builds;
- - `pnpm e2e:all`, plus new specs: `draft-review.spec` (badge, approve/reject, `final` refusal, the no-overwrite
- alternative), `media-draft.spec` (each task over the fake LLM and the editor stub), `verdict-bench.spec`, and a
- `report-draft` progress assertion. A red is re-run alone; a persistent red blocks.
- - privacy counts; the source mirror's check.
-- Unit:
- - each task's code checks (counts, lengths, ids, dates for flips);
- - Q1 (first-person refused);
- - Q2 (fragment found, the full sentence offered);
- - Q3 (a trimmed view under 8k; one ops call);
- - F1 (an `auto` run continues once; caps hold);
- - H1 (the pause path leaves no temp dir).
-- Live smoke (the operator's key, ≤ $3, through umtool):
- - "Draft everything" on a fresh small article;
- - each media task on qwen and on Sonnet;
- - approve and reject in the review;
- - a `final` build refused, then passing after the approvals;
- - `out/youtube.txt`;
- - an `auto` research run that continues by itself;
- - a cancel.
-- Housekeeping checks:
- - `/tmp` has no `parakeet-stitch-*` after a paused transcription;
- - the three formerly flaky tests pass five runs each;
- - candalyzer is gone from `/sites`;
- - the hub's tombstone probes read ok;
- - `pnpm wt list` shows only live worktrees.
-
-## Rollout
-
-Fast-forward `main`; editor and umtool build and restart (`~/reports/release-27/scripts` copied to
-`~/reports/release-28/scripts`, MERGE and LIVE re-guarded); Claude Code picks up the MCP tools on restart; homepage
-source-mirror publish; the hub deploy (H6). No public site changes otherwise.
-
-## Record
-
-### S0, as shipped (2026-10-13, orchestrator)
-
-`r28/integration` from `main` `e8a5f49d`, in the worktree `r28-integration`.
-
-| Commit | What |
-| --- | --- |
-| `cc1eca66` | the test kit: `draft/manifests/full` (on-screen, a narrated card, a teaser, `claim` verdicts, threads with a `thread` per clip) and `flips` (one THEN/NOW pair over clips of different dates), hand-written and kept lint-clean by `umtool/report-to-video/fixtures-r28.test.mjs`; `draft/reports/ruled.report.json`, a synthetic fact-check carrying every verdict |
-| (this commit) | this plan |
-
-Gates: common tsc clean; `testing/fakes.test.ts` 10/10; `fixtures-r28.test.mjs` 3/3.
-
-### M0, as shipped (2026-10-13, lane A, `r28/framework`)
-
-The draft framework, the drafts review and the final gate, as the orchestrator's eight M0 rulings, with narration
-moved onto them. The rulings held as given, with these as built:
-- `applyDraft`'s refusals are `operator`, `drafted` (a draft already, no `force`) and `missing` (no such entry, or
- flips/threads with no `render.chrome`); a field in the wrong place (narration on a clip) throws.
-- A review address's `<task>` is the FIELD's own (`onscreen`, `narrate`, `teaser`, `cut`, `flips`, `threads`,
- `youtube`), whichever task drafted it, so a field has one address; narration's is `narrate/<cardId>/narration`.
-- A drafted narration follows the drafts gate (a warning in fast, refused in final); one with no mark keeps
- release 25's rule in every build. "The narration has a review" is now a narration row in either file, so an
- on-screen verdict does not start it.
-- Narrate's audit file kept its name, `narration-draft.json`, in the scaffold's shape (`units`, `alternatives`);
- `mcp/src/draftTasks.test.ts`'s narrate test reads `units[...]` (two lines, lane B's file) and asserts the mark.
-- Badges (ruling 8): the narration page STAYS (it edits and plays the words) and writes the new file; the general
- page is `/browse/<project>/review`, linked as **Review drafts — N**. Badges sit in the On-screen table's title
- cell, the teaser editor and the narration page.
-- "Use this" writes onscreen, lines, narration, flips, threads and publish.youtube; not the cut's order (an order
- replaces every entry: the cut task's to apply). A timeline with no `drafted.timeline` is the operator's — M1
- decides what the converter's order counts as.
-
-| Commit | What |
-| --- | --- |
-| `e4fe6039` | common: `drafted.mjs` (+ `.d.mts`): the marks, `applyDraft`, `clearEditedDrafts`, `pruneDrafted`, `validateDrafted`, `validatePublish`, review addresses and keys; `tasks/media.ts`, the scaffold (`runMediaTask`); narrate refactored onto it |
-| `994fc97b` | umtool: `report-to-video/drafts-review.mjs` (the file, release 25's read unchanged, the gate); the lint and build-video (`--final`, `--drafts-unreviewed`); the driver's `final` passes `--final`; the manifest writer clears an edited draft's mark; `writeDraftedField`; `lib/report/drafts.mjs` and `/api/report/drafts` |
-| `1b185182` | umtool: the badges, the alternatives with **Use this**, `/browse/<project>/review` |
-| `f281b714` | umtool: e2e `draft-review.spec.ts` and its fixtures; `narration-review.spec.ts` reads the drafts file |
-| `da4b123e` | the README's drafts review section, umtool's report-video doc; the scaffold exported from `tasks/index.ts` |
-| (this commit) | this record, FACTS "Drafted fields and the drafts review", CHANGELOG |
-
-Gates (from the worktree root):
-- `pnpm -r exec tsc --noEmit`: clean at every commit.
-- common: 4018 (2 failing, flaky at the branch's start) → 4029, all pass (+11: `drafted.test.ts` 7,
- `media.test.ts` 4).
-- `test:scripts`: 863 (+3 skipped) → 874; 869 pass + 3 skipped, 2 failing in `scripts/queue-lock.test.mjs`
- (timing, H2's flake) under the full run, 37/37 alone (+11: `drafts-review.test.mjs` 7, `drafted-writer.test.mjs`
- 3, `drafts.test.mjs` 1).
-- mcp 343/343; editor 288/288.
-- `docs env|files|cli --check` and `settings example --check`: clean.
-- umtool capped build, corpus linked, through the heavy slot: compiled in 10.2 s (83 s with 50 s waiting for memory).
-- umtool e2e, single specs in the foreground: `draft-review.spec.ts` 3/3 (6.9 s; a real offline final build:
- refused, approved on the review page, built); `narration-review.spec.ts` + `build.spec.ts` 8 (1 failure:
- narration-review read the old file, fixed) then `narration-review.spec.ts` + `onscreen.spec.ts` 10/10;
- `timeline-edit.spec.ts` + `undo.spec.ts` 9/9.
-
-Left for phase 2: the media tasks themselves (M1–M6) on the scaffold; `TaskDeps.progress` (F3) is not wired.
-### F4, H4, H6, as run (2026-10-13, orchestrator, phase 1)
-
-- **F4:** the stopgap retired. Its two remaining runs were already iterations (`piratesoftware-ai-friends` i1,
- `api-shondo-recent` i1) and its one video project already copied to `~/reports/articles/piratesoftware-ai-friends/i1`;
- no stopgap process alive. `~/reports/local-reports` (74 MB) and `~/.claude/commands/gen.md` deleted; OPERATING.md
- says so (`b4d243fc`).
-- **H4:** `~/reports/release-28/scripts/a7-fill-media.sh` is the r26 script with the two windows padded by the caller
- (release 27 S7: `from`/`to` are the padded window, `pad` provenance). Run through the editor: 38 of 38 X post captures
- done (posts queue, paced). Left, needing the operator: the two YouTube windows are unfetchable (both videos "This
- video is unavailable"; cited by `deleted` and `nineteenth`), and the two Bluesky posts cannot be captured (the editor
- has no Bluesky capture: "Bluesky (public AT Protocol) cannot capture posts"; cited by `polemic-groundbreaking` and
- `polemic-onlyfangs`). `reports prepare --article deconstruction-fact-check` and the private homepage compose refuse
- on exactly those four.
-- **H6:** `archilyzer publish hub --deploy` from `main`: build `0mv7f27h8-98f6fc35` deployed to production
- (`archilyzer-hub`), live check ok, nine withdrawn paths read as tombstones.
- **Release 18's open question 1, answered:** after a deploy the hub's plain and cache-busted reads return the same new
- build (`corpus.json` and all nine tombstones, read by the live check and again by hand), on 2026-10-09 and today.
- The served headers carry no `s-maxage`: `corpus.json` is `public, max-age=0, must-revalidate`, the tombstones are
- `no-store` (the `_headers` rule). Pages sends neither `cf-cache-status` nor `age`, so the live check cannot record
- them. The 7-day edge TTL seen in release 18 is not observed after a deploy.
-### Q1, as shipped (2026-10-13, lane B, `r28/quality`)
-
-| Commit | What |
-| --- | --- |
-| `03ece497` | `grounding.ts`: `FIRST_PERSON_WORDS`, `firstPersonWords`, `firstPersonProblems`, `THIRD_PERSON_MESSAGE`; `GroundingInput.sources` (`QuoteSource`, `reportQuoteSources`, filled by `groundingInputOf`); `checkNarration` adds each first-person sentence to `hard`; the taste's third-person rule; revise-video's narration op names it; 3 tests |
-
-- A sentence with I, I'm, I've, I'd, I'll, me, my, mine, myself, we, we're, we've, we'd, we'll, us, our, ours or ourselves outside double quotation marks is a HARD problem: `the narrator is third person (“I've”, “mine”): …`. When the sentence restates a cited quote (grounding's own `closest` match: two shared content words and half the sentence's), the reason names it: `this is the speaker's line from c03 (Bread day @ 0:45), “…”` (the citation's `speaker` when it has one).
-- Word-bounded and case-insensitive; curly apostrophes read as straight. Not hits: "Iowa", "myth", "mineral", the all-caps "US". Accepted collateral: "mine" the noun, a roman numeral I.
-- narrate needs no change: its grounding call puts the problem in `hard`, so the re-ask, the better attempt and the failing-sentence removal refuse it. videoOps' narration op is refused with it.
-- The rule is stated once, in `NARRATION_TASTE` (narrate's prompt reads it).
-
-Gates: in the lane's totals below.
-
-### Q2, as shipped (2026-10-13, lane B, `r28/quality`)
-
-| Commit | What |
-| --- | --- |
-| `e023db71` | `citations/fragment.ts` (`FRAGMENT_END_WORDS`, `FRAGMENT_MIN_WORDS`, `fragmentOf`, `isFragmentQuote`, `fullSentenceFor`, `fragmentHint`); `checkQuotes` and `strictCheckerOver` refuse a fragment with its sentence; the pipeline extends one in code; revise-report's parent fragments a warning; verify-quotes `fragment`; `WHOLE_SENTENCE_QUOTE_RULE`; REPORT.md; `testing/draft/sweeps/fragment.md`; 8 tests |
-
-- **A fragment**: fewer than 4 words in the whole quote, or an ellipsis part ending on one of `FRAGMENT_END_WORDS` (the brief's list) without sentence punctuation (. ! ? …). A part ending on punctuation is a sentence whatever its last word.
-- **`fullSentenceFor(quote, cues, second, {windowSeconds?, maxWords?})`** → the cues' own words from the quote's first word to sentence punctuation, or to a cue boundary whose next cue starts with a capital (not the pronoun I); unpunctuated, the end of the quote's cue, then one more cue while still a fragment; under 4 words, widened back to the sentence's start. Cap: max(30, quote + 15) words. Null when the quote is not there verbatim or nothing whole fits. The result passes the strict check wherever the quote did.
-- **Generated quotes:** `checkQuotes` gives a fragment as a problem (`fragment: {why, part, sentence}`, `why` = `a fragment (ends on “of”): "…" — quote the whole sentence: "…"`), so the sweep agent's repair round is handed the sentence; still a fragment after it, the finding is dropped. The `add` op's checker (`strictCheckerOver`, `fragments: false` turns it off) refuses one with the same words. **sweep-pipeline** replaces a fragment with its sentence from the window in code (≤ 60 words), else drops it (`a fragment (…)`).
-- **revise-report:** a fragment the parent already quoted is a warning in the `quotes` check, not a failure (as verify-quotes says of existing reports); one this revision added is dropped as before.
-- **verify-quotes:** `fragment` is in `QUOTE_WARNING_STATUSES`; precedence `drift` / `en-orig-drift` > `inexact` > `fragment` > `ok`; the result carries `sentence`. The summary's note names whichever warnings occur.
-- A `fragment` from the editor's verify-quotes is not one more problem in `checkQuotes` (its own check is the one).
-
-### Q3, as shipped (2026-10-13, lane B, `r28/quality`)
-
-| Commit | What |
-| --- | --- |
-| `f93ac191` | `structuredPromptEstimate` (llm/structured.ts); `sweepModel` `trimmedNumberedView`, `sectionsNamedBy`, `shortEvidence`; `videoOps` `trimmedCutView`, `chaptersOf`, `chaptersNamedBy`, `entryLine`; revise-report `LOCAL_REVISE_RULES`, `fitLocalAsk`, `localOpsBatch`, `REPORT_OPS_TEXT(origin, local?)`; revise-video's local path; 5 tests |
-
-- On an ollama model, revise-report and revise-video make ONE `structuredAnswer` (no tools; the rules name none) and apply its ops; the API path is the tool loop and its one-ask fallback, unchanged.
-- **The fit:** `fitLocalAsk` builds the user text at a character budget from the model's prompt cap (`promptCapOf` × 3.5) and shrinks it by 15% until `structuredPromptEstimate` — the very messages and format localAnswer sends, counted as `ollamaChat` counts them — is under the cap.
-- **The report view:** sections the feedback names first (a title, `section N`, or a finding number in what is left once titles are taken out; seconds and percentages are not finding numbers), then the rest in document order, finding by finding while the budget lasts; shown in document order; a section's left-out findings named (`(findings [96]–[100] not shown)`). Quotes over 12 words cut to 8 and `…`, links cut to their labels — in the view only; ops number against the whole document.
-- **The cut view:** every entry listed in timeline order; the chapters the feedback names (an entry id, a card heading, `chapter N`) in full first, the rest while the budget lasts, else `- clip c07 (not shown in full)`; citations the feedback names first, then the rest, with the count left out.
-- Unit, against fakeOllama: a 45k-character report's view under the 8k estimate, one request, the named section in full, the op landing on finding 220 of the whole document, links whole in the report; the cut's one batch.
-
-### F2, as shipped (2026-10-13, lane B, `r28/quality`)
-
-| Commit | What |
-| --- | --- |
-| `c9e99c51` | `report-draft {extractorModel}` (`REPORT_DRAFT_BODY_KEYS`, `parseReportDraftBody`, `isKnownApiModel`); the route's comment and the ops help; COMMANDS.md; the MCP's `generate` argument; umtool `ExtractorSelect` / `extractorBody` on `/articles/new`, Copy with model and a research continuation; `DRAFT_KEYS`; editor unit 2, MCP checks, umtool `article-new.spec` |
-
-- `extractorModel` is a sweep's (`task: "sweep"`, a copy of one or a research continuation included) and a Claude model id the price table knows (`isKnownApiModel`: a `PRICES` key, or a dated id of one). It replaces `settings.generation.models.extractor` for that job. On a sweep whose model is local it is unused and the answer carries a warning.
-- The MCP's `generate` checks it (a sweep's, `claude-…`) and passes it through.
-- umtool shows the extractor only beside a sweep on a Claude model and sends it only when it is not the policy's (so the bodies its specs pin are unchanged).
-
-### F3, as shipped (2026-10-13, lane B, `r28/quality`)
-
-| Commit | What |
-| --- | --- |
-| `48dbc5de` | `JobProgressMetric` `turns` / `cards` / `entries`; `TaskProgress`, `TaskDeps.progress`, `TaskHandle.progress`; `reportDraft.ts` wires `setProgress`; sweep-agent, revise-report, revise-video and research report turns, sweep-pipeline entries; the editor's bars label them; editor unit, MCP and `report-draft.spec` assertions |
-
-- `TaskDeps.progress?(p: {metric: "turns" | "cards" | "entries"; current: number; total?: number})`; a task calls `h.progress`, which never throws into it. The job maps it to `{metric, initial: 0, target: max(total ?? current, current), current}` — the runner's own `current`, as fetch-windows' clips.
-- Agent tasks report every model turn against their turn cap (sweep-agent 150, the repair round counted on; revisions 30; research 60); a local revision's one batch is 1/1; sweep-pipeline reports the recordings gone through of its worklist (`entries`, from 0). The media tasks (narrate, phase 2's) are not wired here.
-- `common/views/jobRowView.ts` imports the union (no re-spelling to change); `JobProgressBars.tsx`'s three records gained the metrics (Model turns ⇄, Cards ▤, Entries ≡).
-
-**Lane B's gates** (at `48dbc5de`; counts at the branch start → the tip):
-- tsc clean (all packages) before every commit.
-- common 4018 (1 failed at the start, not reproduced at the tip) → 4031/4031 (13 new); mcp 343 → 346/346; editor unit 288 → 290/290; `test:scripts` 860 + 3 skipped → 860 + 3 skipped.
-- `docs cli|files|env --check`, `settings example --check`: clean.
-- Editor build: the e2e prebuild's capped `next build` (heavy slot, 5 GB) at `48dbc5de`, clean.
-- e2e `report-draft.spec.ts` (editor suite, alone): 3 passed, 0 failed, 17.8 s wall (after 40 s in the queue).
-- umtool e2e `article-new.spec.ts` + `article-iterations.spec.ts`: 7 passed, 0 failed, 44.8 s (its prebuild's capped `next build` 35 s, clean).
-
-Not done here: the MCP's `sweep_plan` / `ask_plan` text (Claude Code's own /sweep) does not state `WHOLE_SENTENCE_QUOTE_RULE` (`mcp/src/instructions.ts` is not this lane's; one line where the claim-quotes and verbatim rules are).
-
-### Phase 1 merges (2026-10-13, orchestrator)
-
-`r28/framework` (M0) merged `172d07ae`; `r28/quality` (Q1–Q3, F2, F3) merged `900671ae`; `7e14a060` adds lane B's
-`WHOLE_SENTENCE_QUOTE_RULE` to the `/sweep` plan's extractor directive (`mcp/src/instructions.ts`). Gates at
-`7e14a060`: tsc clean; common 4041/4042 — `fetchPosts.test.ts` "a drain mid-page waits for the page's cursor…" failed
-once under load and passes 3/3 alone (a flake candidate); mcp 346/346; editor 290/290; `test:scripts` 871 + 3 skipped.
-### M7, as shipped (2026-10-13, lane C, `r28/bench-house`)
-
-The verdict bench: ruled fact-check claims asked of models one claim per call, scored against the operator's rulings.
-
-| Commit | What |
-| --- | --- |
-| `dc21f2c8` | `common/lib/report/draft/bench/` (`items.ts`, `prompt.ts`, `score.ts`, `store.ts`, `run.ts`, `index.ts`, `bench.test.ts`); `controller/benchVerdicts.ts`; job kind `bench-verdicts`; `POST /api/ops/bench-verdicts` (+ `_benchVerdicts.test.ts`); the ops ACTIONS row and help; `archilyzer reports bench-verdicts` (`bin/reports-bench-verdicts.ts` + test); `settings.generation.verdicts`; COMMANDS.md, SETTINGS.md, settings.json.example |
-| `c31bedd0` | umtool `/bench` (`app/bench/page.tsx`, `components/bench/BarForm.tsx`, `lib/bench.ts`, `/api/bench/bar`), the `/articles` link; e2e `verdict-bench.spec.ts` + `fixtures/bench-fixture.mjs` |
-| (this commit) | the records, FACTS, CHANGELOG |
-
-- **Items:** every claim of a `kind: "factcheck"` article (the registry's `listArticleDirs` / `articleFile` / `parseReport`)
- with an operator `verdict` and a span citation whose recording has cues within ±`window` s (default 60) of the cited
- span; overlapping windows of one recording merged. The rest are `skipped` with a reason (`no operator verdict`, `no
- citation`, `no video or audio citation`, `no cited recording has cues around the cited seconds`). An item carries the
- claim text, its quotes and windows, and the verdict (the answer key); `findings`, `gist`, `flag` and `title` are
- never copied, and the prompt never reads the verdict.
-- **The call:** `structuredAnswer` with `{verdict: VERDICTS enum, reason}`; the system prompt is the five verdicts'
- meanings and "judge only the transcript shown" (no example); the reason is cut at 300 chars in code. A local prompt
- is held under 7 800 estimated tokens (the client's 8k less a margin) by dropping the cues farthest from a cited span
- first; the claim and quotes are never trimmed.
-- **Where it runs (decided here):** not a `report-draft` (no iteration, no task) — a job of its own, `bench-verdicts`,
- in the editor, because the GPU arbiter's holds are in-process there: any local model puts the run on `draft:local`
- with `llmConfigOf(…, {onLog, signal})` (every ollama call through `gpuGatedFetch`) and ollama is unloaded at the end;
- API-only runs go on `draft:api`. Calls are sequential. The day's cap refuses an API run at the ask and at its turn;
- its spend is appended to the usage ledger (`task: "bench-verdicts"`). The CLI is `--dry` (offline, read only),
- through the editor (`pnpm ops bench-verdicts`, the default), or `--here` (in process, API models only).
-- **The cap:** `maxUsd` (default 5, refused above 50) for the whole run, resumed spend included, checked before each
- API call against the spend so far plus that call's estimate; past it the run ends `capped` with what it did. A model
- with three errors in a row is stopped and the run goes on.
-- **Scoring (pure):** agreement (a failure counts as a miss), agreement with PARTLY ~ CORROBORATED, the 5×5 matrix (rows
- operator) plus each row's unanswered, recall for CONTRADICTED, NOT_FOUND, PARTLY strict and adjacent, cost, latency
- (mean, median, p90), parse failures and errors; the always-CORROBORATED baseline scored the same way. `passesBar`:
- strict agreement and the two recalls (a recall with nothing ruled that way is not a miss).
-- **Results:** `.generation/bench/verdicts/<run>/{items.jsonl, results.jsonl, summary.json}`, gitignored (`/.generation/`),
- every write atomic and whole; the same `--run` resumes (answered pairs skipped, failures asked again).
-- **umtool `/bench`:** the run picker; a tile per model and the baseline; the bar form (writes
- `settings.generation.verdicts {bar, models}` whole through the editor's settings action; a model failing the typed bar
- cannot be ticked); the confusion matrices; the items, disagreements first, filtered by model and by the operator's
- verdict; the skipped list. Zero client JS but the form. Linked from `/articles` ("verdict bench"), the nav unchanged.
-- **Labels (contracts):** link `verdict bench`; regions `models`, `the bar`, `confusion`, `items`; tables `confusion
- <model>`; form `bar` with spinbuttons `minimum agreement`, `minimum CONTRADICTED recall`, `minimum NOT_FOUND
- recall`, checkboxes `use <model>`, button `Save the bar`, status `Saved.`; attributes `data-bench-run`,
- `data-status`, `data-model`, `data-pass`, `data-metric`, `data-cell`, `data-item`, `data-disagree`, `data-run`.
-
-**The real run (the orchestrator's):**
-
-```
-pnpm archilyzer reports bench-verdicts --models claude-sonnet-5-5,claude-opus-5-5,qwen3:8b --max-usd 5 --run vb-r28 --wait
-```
-
-through an editor that has this branch (the route is new). Its `--dry` over the registry (read only, 2026-10-13): 147
-items from 2 fact-checks, 44 claims skipped (23 no operator verdict, 12 no citation, 9 no video or audio citation);
-ruled CORROBORATED 78, PARTLY 58, NOT_FOUND 6, CONTRADICTED 4, UNTESTABLE 1; estimate Sonnet 5.5 ~$1.29, Opus 5.5
-~$2.57, qwen $0 — ~$3.86 in all. With 4 CONTRADICTED and 6 NOT_FOUND items the two recalls move in steps of 25% and
-17%.
-
-### H1, as shipped (2026-10-13, lane C, `r28/bench-house`)
-
-| Commit | What |
-| --- | --- |
-| `66fd4a04` | `scripts/parakeet-stitch.mjs`: the pause path breaks out of the window loop and exits after the `finally`; the start-up sweep; `main()` only as a program; `scripts/parakeet-stitch.test.mjs` (3) |
-
-- **The sweep:** a `parakeet-stitch-*` dir in the tmpdir older than 24 h (its mtime; a running run's dir changes with
- every window) is removed unless held. **Chosen: an owner file** (`owner.json`: pid and that process's start time from
- `/proc/<pid>/stat`, so a reused pid is not the owner), written at creation. A `/proc` scan of open files and cwds alone
- would not do: a run holds nothing in its tmp dir between two windows. A dir with no owner file (today's stale ones) is
- held while any other parakeet-stitch process runs (its cmdline), or while any process has a file or its cwd in it.
-- Unit: the pause path (a fake parakeet-cli sends the SIGTERM mid-window) exits 0 with the window kept and no temp dir
- left — red against the old script; the sweep removes an old unheld dir and keeps an owned, a held and a young one.
-- The 21 live stale dirs in `/tmp` are the orchestrator's to remove after merge.
-
-### H2, as shipped (2026-10-13, lane C, `r28/bench-house`)
-
-| Commit | What |
-| --- | --- |
-| `4e941835` | the three flakes |
-
-- **`relocateChannelMedia.test.ts` "reconcile: an extra and a changed file":** each test already has its own
- `mkdtemp`; the cause was a directory mtime. Writing `stale.json` moved the target's `v1/` mtime, and when the setup
- crossed a second boundary rsync (whole seconds) itemized `.d..t v1/` as a third difference. Both trees' directory
- mtimes are pinned now. Proved with a forced 1.1 s delay: red before, green after.
- - Found, not changed (not this lane's file): `relocateDir.ts` `diffTrees` reports a directory-mtime-only line as
- "changed" in the reconcile sentence, which the verify (`DIR_MTIME_ONLY`) already ignores.
-- **`queue-lock.test.mjs` `--with` (:792), and "two weighted jobs" (:632), red in this branch's first run:** fixed holds
- (700 ms, 1500 ms) raced the next run's start under parallel test files. The holding runs wait on a gate file the test
- opens once what it checks has happened (capped at 20 s, so a wrong admission still fails the order assertion).
-- **`backfill.spec.ts` (:516):** the lane is unchecked only once the first save has settled on the page ("Saved.", the
- button back, nothing unsaved, still checked), and the second save is seen to settle before the lane is polled.
-- Five runs each: `relocateChannelMedia.test.ts` 44/44 ×5; `queue-lock.test.mjs` 37/37 ×5; `backfill.spec.ts` 22/22 ×5
- (1.8, 1.8, 2.0, 1.3 and 0.7 min).
-
-### H5, as shipped (code) (2026-10-13, lane C, `r28/bench-house`)
-
-| Commit | What |
-| --- | --- |
-| `8b11cb7d` | the plan and the delete, `POST /api/ops/delete-site`, the ACTIONS row and help, COMMANDS.md, the unit test |
-| `ebf9e60d` | moved to `common/publish/siteDelete.ts` (the architecture test: controller/ may not import publish/) |
-
-- **The survey — what a site leaves on disk:** `sites/<id>/` (site.json with its pool, tags.json, charts, reports with
- their history-git), `export/.export-builds/<id>/` (built.json, deployed.json, out/, a docker build's public/ and
- .r2-staging/) and `export/.export-index/sites/<id>/` (report media and exports, summaries, stats). Nothing else names
- a site by id: channel membership is site.json's own pool, the hub lists the sites on disk with a siteUrl, and curated
- tags' per-site file is in the site dir.
-- **Plan, then apply** (as release 27's `reports delete`): `dryRun` answers the plan. Removed: the three directories.
- Kept: every channel's data, the Pages project and what was deployed (a delete does not undeploy), a deployed hub until
- rebuilt, `export/out` when it links into the site's bundle. Refused unless `force`: a `cloudflareProject`, a deploy
- in deployed.json (production, a preview, local), reports of its own. Refused, force or not: no such site (404), a
- site dir that is a link, a publish stage running (a live publish-lock holder).
-- **The delete:** the publish lock taken without waiting (1.5 s; a stage that started refuses), the site.json lock,
- the plan made again, each directory renamed aside to `.deleting-<id>-<stamp>`; the bulk removed after the locks.
-- The editor's Danger → Delete (`deleteSiteAction` → `deleteSite`) is unchanged: it still removes `sites/<id>/` alone.
-- **The candalyzer plan** (read only, 2026-10-13): not refused, 3 paths, 7 772 files, about 2.7 GiB. The orchestrator
- runs `pnpm ops delete-site --json '{"id":"candalyzer"}'` after merge (a `dryRun` first).
-
-### Lane C gates (2026-10-13)
-
-- tsc clean (all packages) at every commit.
-- Unit, at the branch's start → at its tip:
- - common 4017 of 4018 (1 red: "a drain mid-page waits for the page's cursor", not this lane's; green since) →
- 4034/4034 (16 new: `bench.test.ts` 8, `reports-bench-verdicts.test.ts` 3, `siteDelete.test.ts` 4, the verdicts
- settings 1);
- - editor 288 of 289 (1 red: `whisperFromContainer.test.ts`, not this lane's; green since) → 291/291 (3 new: `_benchVerdicts.test.ts`);
- - `test:scripts` 858 pass, 2 red (the queue-lock pair H2 fixed), 3 skipped → 864 pass, 0 red, 2 skipped (3 new:
- `parakeet-stitch.test.mjs`);
- - mcp 343/343 (not touched).
-- `docs env|files|cli --check`, `settings example --check`: clean.
-- Builds (heavy slot, 5 GB cap): umtool 31 s with the corpus linked for the build only and removed (`/bench`,
- `/api/bench/bar`); umtool's e2e start build 29 s; the editor's e2e start build 57 s at `66fd4a04`
- (`/api/ops/bench-verdicts`); the editor at `ebf9e60d`, 123 s (`/api/ops/bench-verdicts`, `/api/ops/delete-site`).
-- e2e: umtool `verdict-bench.spec.ts` 2/2, 14.2 s; editor `backfill.spec.ts` 22/22 five times (above).
-
-### Lane C merge and H1's clean-up (2026-10-13, orchestrator)
-
-`r28/bench-house` merged `8cd383dd`. Gates there: tsc clean; common 4058/4058; mcp 346/346; editor 293/293;
-`test:scripts` 874 + 3 skipped, 0 failed. H1's leftovers: the 16 `parakeet-stitch-*` dirs left in `/tmp` (176 MB of the
-RAM tmpfs; 5 had gone since the survey's 21) were removed with no parakeet-stitch process running and no process holding
-a file in them. The real verdict bench runs once, after the rollout, through the live editor (`bench-verdicts` is a new
-route, and qwen needs the editor's GPU arbiter); its results land in the primary checkout's `.generation/`.
-Lane C's leftovers: `relocateDir.ts` reports a directory-mtime-only difference as "changed"; the editor's Danger →
-Delete still removes only `sites/<id>/` (M9 routes it through the plan-first delete).
-### F1, as shipped (2026-10-14, lane F, `r28/research-f`)
-
-An `auto` research run continues into its sweep by itself once its acquisitions settle.
-
-| Commit | What |
-| --- | --- |
-| `7739bce5` | `controller/researchAutoContinue.ts`: `maybeAutoContinue`, `scanAutoContinue`, `armResearchAutoContinue` / `researchAutoContinueTick`; `onJobEnd` in `jobs/registry.ts`; `researchRuns.ts` watches an `auto` run's pending jobs (`watchResearchJobs`, `takeWatchedRun`) and its view carries `autoContinue`; `AutoContinueRecord` in `research/state.ts`; the heartbeat's call; the editor arms it below the idle gate (`_autoContinue.ts`); 6 tests |
-| `526261f1` | umtool: the research queue says "continued automatically by iN", or why not; the editor stub continues an `auto` run as the editor does; `article-research.spec` asserts it |
-| `a3084416` | OPERATING.md's research section, the `autonomy` field doc and SETTINGS.md, research-approve's help and COMMANDS.md |
-| `62f732d3` | a site build's end runs the scan too (`SCAN_ON_END`), so a held run continues after the rebuild; 1 test |
-| (this commit) | this record, FACTS "Release 28 F1", CHANGELOG |
-
-- **Who continues by itself:** autonomy `auto` only. `propose` and `limits` are continued by the operator, as in r27.
-- **When:** the run is done; nothing waits for a yes or no; every acquisition job has ended (done, failed or
- cancelled); it is not continued already.
-- **The once-only mark** is a claim taken under the article store's lock (`updateIteration`'s function patch), so a
- heartbeat and a job end racing continue once. A claim is fresh for 10 minutes. A stale claim whose sweep exists is
- recorded as the continuation, not made again.
-- **What it asks:** Continue's own path, `report-draft {task: "sweep", iteration: n, model, channels}`.
- - The model is the research run's own (the brief's "the run's model/route"). The umtool button still defaults to the
- sweep route's.
- - The per-job cap is `caps.sweep`; the daily cap is checked first, again at the ask, and again at the job's turn.
- - A daily-cap refusal, like any refusal of the ask, is recorded as `refused` and tried again only on a later UTC
- day.
-- **Builds:** a channel in no composed build is left out. The warning `not in any build yet: <slug> — rebuild the site
- and continue again` is on the run's record and is a failed `unbuilt channels` check on the sweep. With nothing left,
- the run is `held` (nothing enqueued) until a build newer than the hold, or a later day.
-- **Triggers:**
- - the registry's new `onJobEnd`: a watched acquisition job's end continues its run; the end of a `report-draft` job
- (the research job's own) or a site build runs the scan;
- - the scan: on the heartbeat (`fire`, after the tick) and once at boot.
- - The editor arms both in `instrumentation.ts` below the idle gate, and `armResearchAutoContinue` refuses an idle
- boot itself.
-- **On the run:** `research.autoContinue` (status, at, by, reason, warnings, day, buildsAt) in `iteration.json`, an
- `auto-continue` line in `turns.jsonl`, `ResearchView.autoContinue` in research-approve's answer, and umtool's
- queue line.
-- **Found:** the editor's heartbeat is off by default (`syncScheduler.heartbeatSeconds` 0; the live `settings.json`
- says 0). Live, the triggers are the job ends and the boot scan. A refused run is retried the next day only when a
- report-draft or site-build job ends, the editor restarts, or a heartbeat is configured.
-- **No change to `reportDraft.ts`:** the continuation is asked from code through `enqueueReportDraft`, and the daily
- cap is pre-checked with `generationUsage`'s exports. No settings key was added; the `autonomy` doc says what `auto`
- now does.
-
-Gates (from the worktree root; counts at the branch start → the tip):
-- tsc clean (all packages) before every commit.
-- common 4042 → 4049/4049 (7 new, `controller/researchAutoContinue.test.ts`, five runs each clean); editor unit
- 290 → 290/290; mcp 345 of 346 at the start (1 failure, "a real editor that stops answering a poll hands back the
- job", not reproduced since) → 346/346; `test:scripts` 870 + 3 skipped, 1 failure at the start (`queue-lock`, H2's
- flake) → 871 + 3 skipped, 0 failed (874; the count unchanged, the failure not reproduced).
-- `settings example --check`, `docs env|files|cli --check`: clean.
-- Editor build (heavy slot, 5 GB cap): clean in 52 s.
-- e2e, single specs in the foreground:
- - umtool `article-research.spec.ts` 3/3 (31.2 s; its prebuild's capped build 29 s), the new auto-continue test included;
- - umtool `article-iterations.spec.ts` + `article-new.spec.ts` 7/7 (40.6 s);
- - editor `report-draft.spec.ts` 3/3 (19.2 s; its prebuild's capped build 48 s), with the new boot arming in its server.
-### M4, as shipped (2026-10-14, lane E, `r28/media-e`)
-
-The flips draft (`flips`): THEN/NOW pairs over the cut's clips, `render.chrome.flips`. A step on a done iteration on
-M0's scaffold, one unit (the whole field), replacing step 0's "not implemented" refusal.
-- **The model** proposes pairs: a topic, two clip ids, and optionally a part of each clip's quote. Rules, no example.
-- **Code** does the rest. It dates each clip: the entry's `date` (the operator's, what the header shows), else the
- corpus record's `uploadDate` (`get_video_metadata`), else the citation's `date`. The earlier is THEN, whichever
- way the model named them, and a pair of one day is refused. Each `when` is written from the date (`Jan 2026`).
- A side's `words` is the clip's quote verbatim, or the model's part of it only when the quote says exactly that,
- cut at a word to 110 with `…`. The pair id is the topic slugged. Code refuses unknown ids, a clip in two pairs, and
- more pairs than `min(24, dated clips / 2)`. The topic is one line of at most 32 characters, grounded by
- `checkLine`.
-- **Order:** a THEN that plays after its NOW is refused, unless `ownerOf(timeline)` is `"drafted"` and the flips
- will be applied. In that case the two clips swap places, and the timeline is written through `applyDraft` with the
- flips provenance. A twin id refuses the swap.
-- **The build's validators:** `validateFlips` and `validateFlipEntries` run on the cut as it will be, swaps
- included. To make that possible they moved to common, as `common/lib/report/panels.mjs` (see M5). The repair keeps
- the attempt's pairs that pass when one fails.
-- **One left panel (the simplest correct rule):** a cut with threads is refused, unless `force` and the threads are
- a draft. In that case the flips replace them: the list, every clip's `thread` and the mark are removed, and the log
- says so. Operator's threads are refused even with `force`. A cut with no `render.chrome` is refused.
-- Test kit: `draft/runs/flips.json`. Run over the full manifest with its threads taken off: the first answer is
- refused (a pair of one day, a number the report lacks) and re-asked. The kept answer reproduces S0's flips manifest
- pair, id aside.
-
-### M5, as shipped (2026-10-14, lane E, `r28/media-e`)
-
-The threads draft (`threads`): `render.chrome.threads.list` and each clip's `thread`.
-- **The model** names the threads (`{id, label}`) and gives each clip a thread or `""`.
-- **Code** checks the result:
- - 2 to 4 threads (`THREADS_TASK_COUNT`);
- - ids are slugged when invalid, and none is listed twice;
- - labels are one line of at most 32 characters, grounded;
- - every assignment names a clip of the cut and a listed thread, and no clip is in two threads;
- - every thread has a clip;
- - `validateThreads` and `validateThreadEntries` pass on the cut as it will be.
-- **The outcome is code's:** the `claim.verdict` that the thread's last clip (in timeline order) carries in the
- manifest, when it has one. The model never writes a verdict.
-- **Applied:** `applyDraft(render.chrome.threads, {list})`, then every clip's `thread` is set, and removed from a
- clip in no thread. The repair drops failing threads with their clips when two still stand.
-- **Mirror of M4:** a cut with flips is refused unless `force` and the flips are a draft, which the threads then
- replace.
-- **`common/lib/report/panels.mjs`** is now the one copy of the flips' and the threads' limits and validators.
- umtool's `flips.mjs` and `threads.mjs` re-export them unchanged (their tests, deck, lint and fixtures-r28 pass
- unchanged).
-- Test kit: `draft/runs/threads.json`. The first answer is refused (a label naming someone the report does not, a
- thread with no clip). The kept answer: bakery CONTRADICTED (c07), contest NOT_FOUND (c06).
-
-### M6, as shipped (2026-10-14, lane E, `r28/media-e`)
-
-The YouTube draft (`youtube`), `out/youtube.txt`, and umtool's panel.
-- **The task** writes `publish.youtube {title, description}`: a title of one line, at most 100 characters, and one
- summary paragraph of at most 900 (`YOUTUBE_SUMMARY_MAX`, room under `validatePublish`'s 5000). Both are grounded
- by `checkLine(…, {quotes: true})`:
- - names and numbers come from the report and the cut's title and subtitle;
- - no stock phrase;
- - third person (Q1's `firstPersonProblems`);
- - words in quotation marks only when a cited quote says them word for word;
- - no links, timestamps or hashtags.
- The repair drops a failing sentence of the summary when the title is clean and something is left.
-- **`out/youtube.txt`** is composed by code (`umtool/report-to-video/youtube.mjs`, pure; exported
- `umtool-report-to-video/youtube`):
- - the title, a blank line, the summary;
- - `Chapters` from the build's own chapter list: `muxChapters` now returns `{chapters, total}`, the list it muxed;
- - `Sources`: a moment link per cited clip, in cut order, each once — `citeUrl`, else the archive's page at
- `cite`.
-- **Chapters follow YouTube's rules** (ruled here): the first at 0:00, at least three, each at least ten seconds. A
- shorter one is folded into the one before it. A list that still falls short, or does not start at 0:00, is left
- out, and the build's `youtube` event names why.
-- **When it is written:** after every chapter mux (the full build, the deck build, `--rail-only`,
- `--chapters-only`), and under `--no-chapters` without the block, whenever the manifest has a `publish.youtube`
- title. The file is `youtube-<variant>.txt` for a variant other than `sourced`, as the mp4 is named.
-- **umtool:** `YoutubeSection` on the project page shows `out/youtube.txt` (its age; a note when `publish.youtube`
- changed since), else the same text composed without chapters (`youtubePreview`), with **Copy** and "drafted by
- <model>". Nothing when neither exists. M9 does "Draft with".
-- Test kit: `draft/runs/youtube.json`. The first answer is refused (speaks as the speaker, a link). The editor's
- `_reportDraft.test.ts` runs a youtube step through the job (step 0's "not implemented" case is now this).
-
-| Commit | What |
-| --- | --- |
-| `e4dff898` | `common/lib/report/panels.mjs` (+ `.d.mts`, package export), flips.mjs and threads.mjs re-export it; `report-to-video/youtube.mjs` + `youtube.test.mjs` (6); `muxChapters` returns its list; `writeYoutubeText` after every chapter mux; the `youtube` event |
-| `2d97a52c` | `tasks/clipEvidence.ts` (`clipFacts`, `isoDay`, `whenOf`, `checkLine`), `tasks/flips.ts`, `tasks/threads.ts`, `tasks/youtube.ts`, the dispatcher; `panelTasks.test.ts` (10); runs `flips` / `threads` / `youtube`; the MCP's end-to-end tests (3); the editor's report-draft youtube step; the kit README |
-| `f4884f7f` | umtool `YoutubeSection` on the project page; e2e `media-draft-e.spec.ts`, `fixtures/youtube-fixture.mjs` |
-| `45355fb8` | report-to-video README: the drafted panels, `publish.youtube` and `out/youtube.txt` |
-| (this commit) | these records, FACTS "Release 28 lane E", CHANGELOG |
-
-Lane E's gates (from the worktree root, at `45355fb8`; counts at the branch's start `381156ae` → its tip):
-- tsc clean (all packages) before every commit.
-- common 4059 → 4069 (+10, `panelTasks.test.ts`); 4068 passed, 1 failed: `fetchPosts.test.ts` "a drain mid-page
- waits for the page's cursor…", the phase-1 flake candidate, 8/8 alone.
-- mcp 346 → 349/349 (+3); editor 295/295 (one test rewritten, none added); `test:scripts` 874 + 3 skipped →
- 880 + 3 skipped (+6, `youtube.test.mjs`).
-- `docs env|files|cli --check`, `settings example --check`: clean (nothing regenerated).
-- umtool e2e, single specs in the foreground:
- - `media-draft-e.spec.ts` 1/1 (5.0 s; a real offline fast build: three chapters, two folded, and the sources);
- - `draft-review.spec.ts` + `report-narration.spec.ts` 6/6;
- - `projects.spec.ts` + `build.spec.ts` 29/29.
- - Each run's prebuild was umtool's capped `next build`, 29 s.
-- umtool capped build, corpus linked, through the heavy slot (5 GB): ok, 29 s with 8.5 GB available; the link removed.
-
-Found and left:
-- `checkLine` does not check a line's FIRST word as a name. It is the narration grounding, which skips each
- sentence's first word, so a topic, label or title starting with an unknown name passes that check. The tests use a
- name mid-line.
-- "Use this" on a threads alternative writes the list alone (M0's `writeDraftedField`), not the clips' `thread`
- keys the draft assigned. A threads alternative arises only when the operator's threads are forced over, and its
- Use this may then leave clips naming the operator's old ids, which the build refuses.
-- The media tasks report no progress in this branch. Lane D's scaffold change (`h.progress` per unit,
- `progressMetric`) covers these three once merged; they set no `progressMetric` (default `entries`).
-- umtool's editor stub answers a media step only for `narrate` (any other task makes a new iteration in the stub).
- That is M9's to extend with its buttons.
-
-### Phase 2 merges (2026-10-13/14, orchestrator)
-
-`r28/research-f` (F1) merged `165e766d` (gates: common 4065/4065, mcp 346, editor 293, `test:scripts` 874 + 3 skipped);
-`r28/media-e` (lane D's step-0 wiring `ea4e9072`, then M4–M6) merged `f7b8dae9` (common 4076/4076, mcp 349, editor 295,
-`test:scripts` 880 + 3 skipped; `docs cli --check` clean after regenerating COMMANDS.md). Rulings on the lanes'
-questions: F1 continues only `auto` runs, on the research run's model, and needs no timer of its own while the live
-heartbeat is off (an acquisition job's end is the trigger); lane E's first-word name check stays as built; a threads
-alternative's "Use this" carries the clips' assignments (M9). M9 (lane G, `r28/surfaces`) started from `f7b8dae9`
-beside lane D.
-### Media wiring, as shipped (2026-10-13, lane D, `r28/media-d`)
-
-Step 0: the six new media tasks are steps, as narrate was, through one list. Committed first and alone (`ea4e9072`);
-lane E branched from it.
-- `MEDIA_STEP_TASKS` (`narrate, cut, onscreen, teaser, flips, threads, youtube`) and `isStepTask` in
- `generationSettings.ts` are the one list. `GENERATION_TASKS` and `TASK_NAMES` contain them. Every `=== "narrate"`
- step check asks `isStepTask`: the controller's body, enqueue, job and usage row; the MCP's step lookup and wording;
- the ops row; the route's doc.
-- **Routes:** each new task takes narrate's route in every preset (`balanced`: local).
-- **A settings file from before:** one that routes release 27's first four tasks keeps its preset. A task it does not
- name takes that preset's route; S11's research rule is generalised. A partial patch names no preset.
-- **The body** of a media draft is `{task, article, iteration, model?, entries?, force?}` (narrate's `cards` kept). It
- is refused as narrate's is: no iteration, a `copyOf`, `entries` on a non-step task. Its cap is a narration's.
-- The tasks not yet built refused at the job as a failed step, "not implemented in this build". All six are built
- now, and the refusal is gone at the merge.
-- umtool's generate forwards `entries`.
-- SETTINGS.md, settings.json.example and COMMANDS.md regenerated.
-
-### M1, as shipped (2026-10-13, lane D, `r28/media-d`)
-
-The cut task (`cut`): which of the report's citations the video keeps, and in what order. It is one unit, the
-timeline's ORDER (`drafted.timeline`).
-- **Candidates** (`cutCandidates`): each clip or still whose id is a report citation (the converter's rule), else the
- video citation of its recording and second. The model sees them by the chapter they sit in, with:
- - each claim's text and verdict;
- - the source and date;
- - the quote, shortened step by step until the local prompt fits (`fitLocalAsk`).
-- **The answer** is citation ids grouped under the section headings.
-- **Code refuses:**
- - an id not a candidate;
- - an id twice;
- - more than `settings.generation.cut.maxClips` (new; default 20; a whole number from 3) or fewer than 3;
- - a dropped clip a post rides on or a flip names (`pinnedEntries`);
- - a heading not the cut's, or one heading two groups;
- - any error the build's own validators (`lint.mjs` `validatorErrors`) give the built cut that the cut as read did
- not have (compared with timeline positions taken out). A thread left with no clip is caught this way.
-- **Code builds the timeline** (`buildCut`), never inventing an entry:
- - the chosen entries, untouched, with variant twins together;
- - a chapter card where its group keeps an entry; a card with nothing left is dropped (S7's rule);
- - everything before the first chapter or citation entry first, and everything after the last one last (the
- teaser);
- - an entry no citation names stays with its chapter, after its card.
-- **The build's validators** reach a common task through `TaskDeps.deckChecks` (`tasks/deckChecks.ts`): umtool's
- `deck.mjs` and `lint.mjs`, loaded natively from the checkout (`import(/* turbopackIgnore: true */ …)`). The editor
- job passes `loadDeckChecks(paths.monorepoRoot)`. The editor's e2e proves it in the built server.
-- **The ruling on lane A's question, as built:**
- - `reportToManifest` marks its timeline `drafted.timeline {task: "convert", model: "code", at, attempt: 1}`, `at`
- the day it was made (`today`). The kit's derived manifests were regenerated.
- - An unmarked timeline whose clip order is exactly the converter's from the project's report is code's too
- (`isConverterOrder`).
- - A code-made order is drafted over without `force`. The cut's `apply` gives an unmarked one the converter's mark
- first, then writes through `applyDraft`. One marked by a model needs `force`. Any other is the operator's: its
- draft is kept as an alternative.
- - `isCodeDraft` (drafted.mjs): `draftsReviewRows` leaves a code mark out, so there is no row, no badge and no
- final-gate error. umtool's "Review drafts — N" count leaves it out too. These are lane A's files; the change is
- additive, a filter and an import each.
- - An operator's reorder in umtool clears the mark as any edit does.
-- **The scaffold** (`media.ts`, additive):
- - `spec.owner`, who owns a unit's field for the skip. The writer is still `applyDraft`.
- - `spec.batch` (M2).
- - Progress: `h.progress({metric: spec.progressMetric ?? "entries", current, total})` at 0 and after each ask.
- Narrate's metric is `cards`. Lane E's three get `entries` for free.
-
-### M2, as shipped (2026-10-13, lane D, `r28/media-d`)
-
-The on-screen task (`onscreen`): each clip's `onscreen.{title, subtitle}`. One unit per clip entry (or the `entries`
-asked for).
-- **Evidence:** the report's title, the clip's section, its claim (text, verdict), its quote and source.
-- **Batches:** several clips per ask (`spec.batch`) — as many as fit the local prompt cap measured by
- `structuredPromptEstimate`, at most `ONSCREEN_BATCH_MAX` (8). The re-ask carries only the clips refused, with each
- one's reasons.
-- **Code refuses:**
- - a title over 60 characters or a subtitle over 90;
- - more than one line;
- - a title with any quotation marks (an apostrophe is not one);
- - a subtitle quoting anything but the clip's own quote, word for word (`strictNormalize`, whole words), or with
- marks that do not pair up;
- - a name or number the clip's evidence lacks;
- - the first person outside a quotation (Q1's `firstPersonProblems`).
-- **`grounding.ts` `groundedProblems(text, reference, where)`:** the names and numbers check `checkNarration` ran
- inline, now one function that both use. The wording is unchanged for narration.
-
-### M3, as shipped (2026-10-13, lane D, `r28/media-d`)
-
-The teaser task (`teaser`): a teaser's `lines`. One unit per teaser entry.
-- **A cut with no teaser** gets one: `{type: "teaser", id: "teaser"}` (else `teaser-2`, …) after its last clip, its
- lines written through `applyDraft` as an empty field. Nothing is added when the draft is refused.
-- **Evidence:** the report's title and subtitle, section titles, claim gists (`claimGist`: the quoted words taken
- out), and the months its sources and clips are dated.
-- **Code refuses:**
- - fewer than 3 or more than 5 lines;
- - a line over 70 characters, or on two lines;
- - quotation marks;
- - a run of 5 words from any quote;
- - a name or number the evidence lacks;
- - anything `deck.mjs` `validateTeaser` refuses (the row each role fits: overline, title, kicker). Without that
- check (no `deckChecks`), nothing is written.
-- **The prompt** states each role's fit as a rule; the check is the build's.
-
-| Commit | What |
-| --- | --- |
-| `ea4e9072` | step 0: `MEDIA_STEP_TASKS`, `isStepTask`, routes in every preset, the old-file preset rule, the step body with `entries`, the not-implemented refusal; the MCP, the ops row, the route doc; SETTINGS.md, COMMANDS.md |
-| `54400684` | the scaffold: `spec.batch`, `spec.owner`, progress; `tasks/deckChecks.ts` and `TaskDeps.deckChecks`; a batch test |
-| `fbf1e11d` | M1: `tasks/cut.ts` (+ 5 tests), `generation.cut.maxClips`, the converter's code mark, `isCodeDraft` and the review's exemption, `runs/cut.json`, the kit regenerated |
-| `1a47547c` | M2: `tasks/onscreen.ts` (+ 3 tests), `groundedProblems`, `runs/onscreen.json` |
-| `2cd6e68d` | M3: `tasks/teaser.ts` (+ 3 tests), `runs/teaser.json` |
-| `c11db375` | umtool e2e `media-draft.spec.ts`: the stub runs a media step for real (`testing/draft/runMediaStep.ts`, a tsx child, the fake ollama on the kit's run); fixture `mdraft` |
-| `6ff39f31` | merge of `r28/integration` (lanes C, E, F): cut beside verdicts in the settings, the dispatcher with all six |
-| `4d0dee5c` | editor e2e: a teaser through the real editor job on the fake API; the runner's paths opt out of tracing |
-| (this commit) | these records, FACTS, CHANGELOG |
-
-Lane D's gates (from the worktree root):
-- **tsc** (all packages): clean before every commit.
-- **Unit suites**, counted at the branch's start (`7e14a060`), after the merge, and at the tip:
- - common: 4042 at the start (3 failing: two settings-doc tests read mid-edit, and the `fetchPosts` drain flake); 4050/4050 at M1; 4089/4089 after the merge; 4089/4089 at the tip.
- - editor: 290 → 292 at step 0 → 295 after the merge; 295/295 at the tip.
- - mcp: 346 → 349 after the merge; 349/349 at the tip.
- - `test:scripts`: 874 (870 pass, 3 skipped, 1 `queue-lock` timing flake) at the start → 875 at M1 (+1, the code-mark review test) → 884 after the merge; 884 at the tip (881 pass, 2 skipped, 1 `queue-lock.test.mjs` timing failure under the full run's load, 37/37 alone).
-- **Docs:** `docs env|files|cli --check` and `settings example --check` clean.
-- **umtool e2e**, single specs in the foreground:
- - `media-draft.spec.ts` 3/3 (14.6 s; the first run failed 3/3 waiting on a tab that does not poll a job it did not
- start, so the spec now polls the iterations API, then opens the tab);
- - `article-iterations.spec.ts` + `draft-review.spec.ts` 7/7 (40.3 s).
- - The first run's prebuild was umtool's capped build.
-- **Editor e2e** `report-draft.spec.ts` alone: 4/4 (17.9 s). Its prebuild was the editor's capped `next build`:
- compiled in 21.8 s, 52 s in all, heavy slot, 5 GB.
-- **umtool capped build**, corpus linked, through the heavy slot (5 GB): compiled in 9.1 s; the link removed.
-
-Found and left:
-- **Lane E's flips swap** a THEN after its NOW when `ownerOf(timeline)` is `"drafted"`. With the converter's mark, a
- converter-made cut is `"drafted"`, so flips may reorder it. This is consistent with the ruling: a code-made order is
- nobody's.
-- **A revise-video iteration copies its parent's manifest, mark included.** An order it changed through its ops
- stays marked as code's or the cut's, and the cut task may redraft it. Its ops are a model's work from the operator's
- feedback; whether that order is the operator's is a ruling for M9.
-- **Folding lane E's tasks into `media-draft.spec.ts` was not cheap.** flips needs the corpus's records for its
- dates, and the stub's runner has no corpus tools (common cannot import the MCP's). Both specs stay.
-- **The Iterations tab does not follow a step it did not start.** A media draft asked through the API shows on reload.
- M9's buttons start their own.
-
-### Lane D merge (2026-10-14, orchestrator)
-
-`r28/media-d` (step 0, M1–M3, the framework hooks) merged `726d4494`. Gates: tsc clean; common 4089/4089; mcp 349; editor
-295; `test:scripts` 881 + 3 skipped, 0 failed; `docs env|files|cli --check` and `settings example --check` clean.
-Rulings on lane D's questions, built in M9: a video revision whose ops change the clip order marks `drafted.timeline`
-with `revise-video` and its model (a model draft: reviewable, and the cut task needs `force`); an on-screen title in
-Title Case is not refused for its capitals.
-### M9, as shipped (2026-10-14, lane G, `r28/surfaces`)
-
-The surfaces of the media drafts: "Draft with <model>" per section, Draft everything, the MCP and `/gen`, the two
-leftovers, and the two rulings added to the lane.
-- **Draft with <model>** is a **draft** section on a report-video project page (`DraftPanel.tsx`), one row per task:
- the cut, on-screen titles, the teaser, flips, threads, narration, the YouTube text. A row has **Draft with** and the
- model (the policy's API and local models, the task's route preselected), **force** (re-drafts only what a model
- drafted; the UI says a field the operator wrote or edited is never replaced) and, for a per-entry task (on-screen,
- teaser, narration), the entries to draft. It posts `report-draft {task, article, iteration, model, entries?,
- force?}` through `/api/articles/generate` and follows the job (status, the queue, F3's progress, the last log line,
- Cancel). When the job ends the page re-reads the manifest, the drafts and the server sections, and the row shows the
- task's last run from its `<task>-draft.json`: written, kept as an alternative, refused by a check (with the reason),
- skipped, the failing checks. The cut, flips, threads and YouTube rows carry M0's badge and alternatives with **Use
- this**; per-entry fields keep theirs in the sections and on the review page. Flips and threads on a cut with no
- deck say why and offer no button.
-- **Which iteration:** a project `<projectsRoot>/<article>/i<n>/` whose iteration exists and names that directory
- (or none) (`projectIteration`). Any other project shows one line why and no control; an iteration not done says so.
-- **The Iterations tab** gains the six media drafts beside **Narrate** (a task select, a model, force, **Draft**) and
- **Draft everything** (a model and the button, which opens and starts a chain panel in its own mode).
-- **Draft everything** (`chain.mjs`): `CHAIN_STEPS` carries each step's `modes`; the draft-all chain is current →
- windows → prepare → posts → manifest → draft-cut → draft-onscreen → draft-teaser → draft-flips → draft-threads →
- draft-narrate → voices → video → podcast → draft-youtube.
- - Ruled here: the drafts sit after `manifest`, because a media task drafts the project's manifest, and the windows
- are fetched from the report's citations before prepare, not from the cut. The brief's "cut → windows" cannot hold.
- YouTube sits after the podcast as the brief says, and its step re-muxes a built cut's chapters
- (`--chapters-only`), so `out/youtube.txt` is written then.
- - No attach and no dedupe: a cut whose drafts nobody reviewed is not made the article's video.
- - The build is the existing `video` step without `--final` (fast: `--no-xfade`). The default chain is unchanged,
- its ten steps and labels as they were.
- - A draft step is one `report-draft` job through the editor, followed every 2 s, cancelled with the chain. It is
- recorded done, skipped or failed, and exits 0 either way: a missing draft never blocks a build.
- - Skipped: flips with threads on, or threads with flips on (the pre-check; the second of the pair is never asked
- once the first applied a panel), either with no deck, or a draft file whose every unit was skipped.
- - Failed: refused at the ask, or the job failed.
- - A resume passes an optional step that ran (done, skipped or failed); `--from` names one.
- - `umtool chain <article> <n> --draft-all [--model M]`; `--final` with it is refused. The umtool job kind is
- `draft-all <article> i<n>`.
-- **MCP and `/gen`:**
- - `generate` refuses a media draft with no iteration, a `copyOf`, a question, feedback, channels or dates, and
- `entries` on a task that is not a media draft. The tools' texts name the media tasks.
- - A done media draft's answer is `mediaReviewGuidance(task, projectDir)`: read `<task>-draft.json`, read the
- drafted fields and check what that task needs (`MEDIA_REVIEW`), say what to approve; the operator approves or
- rejects in umtool's review page, never by writing `drafts.review.json`; the final gate; force's rule.
- - `.claude/commands/gen.md` maps phrasings to each media task and says Draft everything is umtool's.
- - `archilyzer gen run <media task> --iteration <n> [--entries a,b] [--force]` takes no words; COMMANDS.md
- regenerated.
-- **Leftovers:**
- - The editor's site **Delete** on `/sites` is plan-first through H5's `publish/siteDelete.ts`
- (`planSiteDeleteAction`, `deleteSiteAction(id, {force})`). The plan shows the paths, files and size removed,
- what is kept and the refusals; then **Confirm delete**. A plan refused only for forceable reasons offers
- **Delete with force** behind an "I understand" box; any other refusal offers nothing. It now also removes the
- site's build state and staging.
- - **Use this on a threads alternative** writes the clips' assignments too. The threads task's alternative is
- `{list, clips}` and the task applies `{list}`. `writeDraftedField` sets each clip's `thread`, removes it from a
- clip in none, and refuses a clip the cut lacks or what `validateThreadEntries` refuses. An alternative without
- `clips` writes the list alone, as before.
-- **The two rulings added to the lane:**
- - **A revise-video that reorders the cut** (its timeline's ids, `fieldSignature`) sets `drafted.timeline =
- {task: "revise-video", model, iteration, attempt: 1}`. The reorder is then a model's draft: it has the cut's
- review row, and the cut task needs `force` to redraft it. A revision that keeps the order keeps the parent's mark
- (or none).
- - **A Title Case on-screen title** (every word but the small ones capitalised, two at least) is checked in its
- sentence case (`titleAsSentence`): past the first word, a small word, an ordinary headline word
- (`TITLE_ORDINARY`) or a word the clip's evidence has (by stem) is lowercased; any other keeps its capital and
- is looked for as a name. So "She Refuses To Sell To A Chain" passes, "The Bakery Stays, Says Marco" still fails
- on Marco. The first word is never a name's candidate (the grounding's rule, unchanged).
-
-| Commit | What |
-| --- | --- |
-| `f6de9a9e` | umtool: the chain's optional generation steps (`chain.mjs` modes, `chain-run.mjs` `draftStep`, `chain-draft.mjs`), `umtool chain --draft-all [--model]`; `chain-draft.test.mjs` (6), `chain.test.mjs` (+2) |
-| `18e2542e` | umtool: `DraftPanel.tsx` on the project page, the Iterations tab's drafts and Draft everything, `ChainPanel` modes, `/api/articles/draft`, the chain route's `draftAll`/`model`, `entries` in report-draft bodies, job progress in umtool's job view |
-| `ea232bbc` | merge of `r28/integration` (lane D) |
-| `81da836d` | common: revise-video's order mark; onscreen's Title Case check; MCP `draftTasks.test.ts` (+1), `onscreen.test.ts` (+1) |
-| `d1dda928` | threads' alternative `{list, clips}`; `writeDraftedField` sets the clips' threads; `panelTasks.test.ts` (+1), `drafted-writer.test.mjs` (+1) |
-| `82fd4ab8` | MCP `generate` checks and `mediaReviewGuidance`; `/gen`; `archilyzer gen run` media tasks; COMMANDS.md; `generation.test.ts` (+1), `instructions.test.ts` (+1), `gen.test.ts` (+1) |
-| `e3b6af2e` | editor: the site Delete plan-first; e2e `site-delete.spec.ts` (2), `sites-crud.spec.ts` follows the plan |
-| `189bc376` | umtool e2e `media-surfaces.spec.ts` (2), `fixtures/media-surfaces-fixture.mjs` (msurf), the stub's canned drafts for every media task |
-| `c4235bb5` | OPERATING.md "Generate and iterate" (the media tasks' table, Draft everything, the gate), `umtool/docs/authoring.md` |
-| `2d257fbe` | the stub's narration makes its card auto-length; msurf's clips inside the cached window |
-| (this commit) | this record, FACTS "Release 28 M9", CHANGELOG; `publish/siteDelete.ts`'s header names the editor's path |
-
-Gates (from the worktree root; counts at the branch's start `f7b8dae9`, after the merge of lane D `ea232bbc`, and at
-the tip):
-- tsc (all packages) clean before every commit.
-- common 4076 → 4089 after the merge → 4092/4092 (+3).
-- mcp 349 → 349 → 352/352 (+3).
-- editor unit 295 → 295 → 295/295 (none added).
-- `test:scripts` 880 + 3 skipped → 881 + 3 skipped after the merge → 890 + 3 skipped, 0 failed (+9).
-- `docs cli|files|env --check`, `settings example --check`: clean (COMMANDS.md regenerated in `82fd4ab8`).
-- umtool e2e, single specs in the foreground (the prebuild's capped `next build`: 396 s, most of it waiting for
- memory beside the integration suite):
- - `media-surfaces.spec.ts`: 1 passed, 1 failed twice (the chain's fast build: a stub narration longer than its
- card, then a clip outside the cached window — fixture fixes in `2d257fbe`), then 2/2 in 48.8 s.
- - `article-iterations.spec.ts` + `projects.spec.ts` 27/27 (52.0 s); `media-draft.spec.ts` + `draft-review.spec.ts`
- 6/6 (28.8 s); `media-draft-e.spec.ts` + `onscreen.spec.ts` 9/9 (42.3 s).
-- Editor e2e `site-delete.spec.ts` + `sites-crud.spec.ts` 22/22 (34.9 s; its prebuild's capped `next build`, 76 s).
-- umtool capped build with the corpus linked, through the heavy slot (5 GB): ok, 301 s wall (most of it waiting for
- the slot); the link removed.
-
-Found and left:
-- `draft-youtube`'s re-mux passes `--no-xfade`, Draft everything's build. A cut built final before it would be
- re-muxed with hard-cut offsets; Draft everything never builds final.
-- The iteration's draft steps (`onscreen`, …) and the chain's (`chain:draft-onscreen`) are two records of one run;
- the Iterations tab shows the first beside the step list.
-- `generate`'s summary of a media draft still lists the iteration's directory files (sweep.md, report.json) above
- the video project; harmless, not trimmed.
-
-### Gate round (2026-10-14, orchestrator)
-
-**Gate 1, at `726d4494`** (nothing after it touches export or homepage but a comment in `publish/siteDelete.ts`): the
-four capped builds — editor 230 s, export 261 s, homepage 115 s, umtool 159 s (corpus linked, then removed); e2e export
-275 passed, 1 failed (`charts.spec.ts:234`, a chart pixel test — re-run alone in the final round), report 46/46, hub
-39/39, homepage 110/110.
-
-`r28/surfaces` (M9) merged `339e07e5`; its rulings stand (the drafts run after `manifest`, the YouTube step re-muxes
-the built cut's chapters, Draft everything neither attaches nor dedupes). `docs env|files|cli --check`,
-`settings example --check` clean there.
-
-**Final round, at `339e07e5`:** tsc clean; common 4092/4092; mcp 352/352; editor 295/295; `test:scripts` 890 + 3
-skipped, 0 failed; capped builds editor 154 s, umtool 102 s; e2e editor 694 passed, 12 skipped, 0 failed (21.6 min);
-`charts.spec.ts` alone 11/11; umtool 316 passed, 1 failed — `browse.spec.ts:342` ("a new song gets the shape"), a 404 on
-a just-scaffolded project, red alone too; it passed at release 27's gate, and `main` had meanwhile moved (the umtool
-redesign, P0–P2a and P1, live) with `f36632a0` fixing exactly it (one project cache, cleared by a scaffold). Privacy
-counts on `main..r28/integration` (68 commits): 0 session trailers or links, 0 key-like strings, 0 config paths, 0 home
-paths; 3 mentions of the Candace rule and of ids `main` already carries.
-
-**`main` merged in** at `af153e2e` (the redesign touched none of release 28's files; only the CHANGELOG conflicted, both
-kept). Re-gate there: install ok; tsc clean; `test:scripts` 918 + 3 skipped, 0 failed; umtool unit ok; umtool capped
-build 33 s; umtool e2e 333 passed, 6 skipped, 0 failed (`browse.spec` included). Nothing outside umtool changed on
-`main` but the CHANGELOG, a plan and the `test:scripts` glob, so the other suites' results stand.
-
-### Rollout, as run (2026-10-14, orchestrator)
-
-- `main` fast-forwarded to `ea4bf4d5` (the umtool redesign session held `main` and :3050 for the window).
-- Editor: install, capped build, restart — `GVucDeKqjTIsMFBv18AsC`, 200, no ZodError, nothing queued. umtool: capped
- build and restart from `ea4bf4d5` (the redesign's P1 included) — `Gb3L57w_cAltRuB6L0HHE`; the rollout smoke
- `SMOKE_FAIL=0`.
-- Homepage and source mirror: the source check passed (audit clean: 36,284 objects, 3,132 commits, 6,917 files against
- 14 denied literals; gitleaks clean), `main` `ea4bf4d5` published as `84ad5f54ff32`; homepage build
- `0mv7q26rw-fe83a066` deployed to production, live check ok.
-- **H5:** `pnpm ops delete-site {"id": "candalyzer"}` — the plan first (no refusal; `sites/candalyzer/`, its build
- bundle, its compose staging: 3 paths, about 2.9 GB), then applied. Every channel kept.
-- **H1:** `/tmp` has no `parakeet-stitch-*` (removed at lane C's merge).
-- **H7:** 28 worktrees whose branches are merged into `main` and that were clean and held by no process were removed
- (r23–r28 lanes, `reports-timeline-feeds`, five `.claude/worktrees/agent-*`, `mk-game-hooks`); branches kept. Left:
- `main`, `r28-integration`, the unmerged `diet-series`, `export-gumroad-tip`, `mk-dedup-ums`, `r13-phase-5`, the
- detached `render-local-sources`, and the umtool redesign's `ux-*` lanes (another session's).
-
-### The verdict bench, as run (2026-10-14; the operator's key; $4.25 of the $5)
-
-`archilyzer reports bench-verdicts --models claude-sonnet-5-5,claude-opus-5-5,qwen3:8b --max-usd 5 --run vb-r28`
-through the live editor: 147 items from 2 fact-checks (44 claims skipped: 23 no ruling, 12 no citation, 9 no video or
-audio citation). Ruled: CORROBORATED 78, PARTLY 58, NOT_FOUND 6, CONTRADICTED 4, UNTESTABLE 1. Results are local
-(`.generation/bench/verdicts/vb-r28/`, gitignored); umtool's `/bench` shows them.
-
-| Model | Agreement | Adjacent (PARTLY ~ CORROBORATED) | CONTRADICTED recall | NOT_FOUND recall | USD |
-| --- | --- | --- | --- | --- | --- |
-| claude-sonnet-5-5 | 42.2% | 66.0% | 2/4 | 3/6 | 1.28 |
-| claude-opus-5-5 | 47.6% | 75.5% | 2/4 | 4/6 | 2.97 |
-| qwen3:8b | 46.3% | 87.8% | 2/4 | 3/6 | 0 |
-| always-CORROBORATED | 53.1% | 92.5% | 0/4 | 0/6 | — |
-
-No model beats the always-CORROBORATED baseline on agreement; each finds half the contradictions, which the baseline
-never does. **M8 waits for the operator's bar** (`/bench`, `settings.generation.verdicts`).
-
-### The live smoke, as run (2026-10-14; the operator's key; about $1.20 of the $3)
-
-Through umtool's own routes on the live apps, a fresh article `r28-smoke` (Sonnet sweep of one channel over a
-three-month window: 4 sections, 15 claims, 15 citations, $0.13; the job's progress read `turns 7/150`).
-
-| Step | Result |
-| --- | --- |
-| Draft everything on qwen | windows (15), prepare, posts, manifest (19 entries) done; the qwen cut queued behind the bench's qwen calls |
-| a cancel | the chain cancelled mid-step: the step `cancelled`, the editor's report-draft job `cancelled` |
-| Draft everything on Sonnet (resumed) | cut, on-screen (11), narration (3), voices, fast build, podcast, YouTube done; teaser refused (smoke fix 1); flips and threads skipped — the converted cut has no deck |
-| each media task on qwen | teaser (after fixes 3), cut, on-screen, narration, YouTube, flips done; threads done after fixes 4–5 |
-| each media task on Sonnet | teaser (after fix 1), threads done; flips: no pair proposed — the window holds no reversal (correct) |
-| the review | 18 drafted fields; 17 approved, the teaser rejected with a note: the `final` lint refused it, a fast lint warned; approved, then a re-draft of the YouTube text made its approval stale and the `final` build refused again (correct); re-approved: the `final` build passed (127.7 s, 12 MB) |
-| `out/youtube.txt` | title, summary, Chapters (by section after fix 2: 0:00, 0:17, 0:52), Sources |
-| `auto` research | run 1: its one proposal was past the smoke's caps (limits lowered for the smoke, then restored) and waited for approval; rejected, the run was ready but not continued until a job ended (fix 5); then continued by itself. Run 2: one X post imported within the caps, the import's end continued the run by itself, with the warning that the private build predates the acquisition |
-
-**Fixes found by the smoke, on `main`:**
-1. `31424d29` — a teaser line past its role's row gets its end as the second tier, in code (`fitTeaserLines`).
-2. `cb9ecb1a` — `out/youtube.txt`'s Chapters are the cut's sections, not one per clip.
-3. `d7490d87` — a Title Case short line's unknown capitals are soft (the review holds them), and a spelled-out number
- matches its digits (`titleLineGrounding`).
-4. `76608b24` — flip topics, thread labels and YouTube text get the same Title Case handling (`checkLine`).
-5. `87a834ee` — a flip topic or thread label past its limit is fitted in code (`fitShortLine`); `50a21a90` — the
- operator's last decision on an `auto` run continues it (`onResearchSettled`).
-
-Each merged to `main` with its suites green (common 4096/4096, mcp 352, editor 295, `test:scripts` 919 + 3 skipped);
-the editor redeployed each time — live `DvXDCIMNKavzU_JtCAe9H` at `main` `d5cd1f3d`.
-
-### Owed to the operator
-
-- **M8:** set the verdict bar on umtool's `/bench` (and tick passing models), or rule that no model passes.
-- **H4:** four citations the private homepage cannot compose: two YouTube videos are gone ("This video is
- unavailable"; cited by `deleted` and `nineteenth`) and two Bluesky posts cannot be captured (no Bluesky capture;
- cited by `polemic-groundbreaking` and `polemic-onlyfangs`) — replace or drop each citation, or rule a fallback.
-- The smoke's articles `r28-smoke`, `r28-smoke-research` and `r28-smoke-research2` are drafts on no site: keep or
- `archilyzer reports delete <id> --apply`. The X post run 2 imported stays in `piratesoftware-x`.
-
-## Not in this release
-
-Comment and thread generation for social posts (X/Bluesky promotion); auto-publishing to YouTube (r28 writes the text
-only).
diff --git a/plans/release-29.md b/plans/release-29.md
@@ -1,780 +0,0 @@
-# Release 29 — evidence gaps, verdicts round 2, generation round 2, debts
-
-Status: **in flight** — S0 done; phase 1 lanes A (E1 → E2), B (V1 → M8 code), C (G1 → G2 → D1).
-
-## Start here (the implementing session)
-
-Read before acting:
-- `AGENTS.md`;
-- `plans/STATE.md` ("Now") and `plans/FACTS.md`;
-- `plans/tools/implementer-rules.md`;
-- this plan, `plans/release-28.md`'s record (the media tasks, the drafts review, the bench) and
- `plans/umtool-redesign.md`'s R4 and R6 records (refresh's reading of gone sources, the window judge and its marks).
-
-**The orchestrator** runs in the primary checkout; the integration branch is in the worktree `~/Projects/r29-integration`:
-- lane worktrees: `pnpm wt add <branch> --from r29/integration`, then `link-fixture-public.sh`;
-- merges are `--no-ff`; `main` moves by `git merge --ff-only` after the gates, coordinated with the "umtool redesign"
- session (it shares `main`, :3001 and :3050 and runs a weekly pilot — first automatic tick 2026-10-19 06:00 ET; no
- restarts then);
-- rollout scripts are `~/reports/release-28/scripts` copied to `~/reports/release-29/scripts`, MERGE and LIVE re-guarded.
-
-## Context
-
-Release 28 is live (`main` also carries the umtool redesign, every phase LIVE at `dd162ec2`). It left:
-- **H4:** four article citations the private homepage cannot compose — two YouTube videos are deleted, two Bluesky
- posts cannot be screenshotted (the editor has no Bluesky capture).
-- **M8 blocked:** the verdict bench put every model under the always-CORROBORATED baseline (Opus 48 %, qwen 46 %,
- Sonnet 42 % vs 53 %), mostly calling PARTLY where the operator ruled CORROBORATED.
-- **From the smoke:** Draft everything never drafts flips/threads on a converted cut (no deck); social-post promotion
- text was out of r28's scope.
-- **Debts:** relocateDir's mtime-only "changed" message, flaky tests, `generate`'s answer order.
-
-## Rulings (operator, 2026-10-14)
-
-- All four tracks (evidence gaps, verdicts, generation, debts).
-- Bench v2 before M8; M8 ships enabled only for models that pass the operator's bar.
-- Delete the three r28 smoke drafts.
-- Draft everything's deck is an option, off by default.
-- Bluesky shots are the real bsky.app page (headless, no login).
-- A deleted video with no copy found becomes a text-only moment marked "source deleted".
-
-## Facts found (survey 2026-10-14, re-verified 2026-10-15 at `dd162ec2`)
-
-- **en track → 0 cues is already CLOSED** (release 20 D3, `videoStatus.ts:123-131`, `vtt.ts:59`). Not in r29.
-- Bluesky: `capturePostsProblem` (`common/controller/capturePosts.ts:78-85`) refuses any fetcher without the optional
- `captureByIds` (`common/social/fetchers.ts:287`); only X (`xGalleryDlFetcher.ts:1349`) and XenForo have it.
- `blueskyFetcher.ts` (no login, AppView API) has `fetch`, `checkAvailability`, `fetchOne`; `normalizeBlueskyItem`
- (:207-268) keeps `mediaCount` only, no image URLs. Capture storage: `common/social/postCapture.ts`
- (`posts-media/<id>/{shot.png, media…, capture.json}`, `writePostCapture`, `captureWork`); prepare needs `shot.png`
- (`common/publish/citedPostCaptures.ts:108`). Playwright loader: `common/social/playwrightRuntime.ts`.
-- Compose gate: `common/publish/composeReports.ts:656-692` (`missing-media`; only the all-or-nothing
- `allowMissingMedia`). The renderer already copes without media (`common/components/report/MomentArticle.tsx:50-80`,
- `CitationCard.tsx:112`). Per-video gone status: `data/<id>/availability.json` (`common/lib/availability.ts`,
- `isPermanentlyGone`); `missingEvidenceWindows` (`common/publish/reportMedia.ts:548-551`) already lists "unfetchable:
- gone". `fetch-windows` takes a per-item `webpageUrl` override (`controller/fetchWindows.ts:439-441`), so a found copy
- can fill `data/<ytid>/clips/` today. No Wayback CDX lookup exists; archive.org search/item/import do
- (`archiveOrgClient.ts`, ops `archive-search`/`archive-item`), but an import lands under the archive.org identifier,
- not the YouTube id.
-- Bench: `common/lib/report/draft/bench/{items,prompt,run,score,store}.ts`; the prompt defines CORROBORATED as "true as
- stated", PARTLY as "part unsupported" (`prompt.ts:37-41`) and puts `verdict` before `reason`; the model sees no
- report/section context; resume iterates the union of models (`run.ts:183`), so a qwen-only rerun re-asks API pairs;
- no prompt version is stored. Verdict meanings are written nowhere but the prompt. umtool bench page:
- `umtool/app/tools/bench/page.tsx`, `umtool/lib/bench.ts`, `components/bench/BarForm.tsx`.
-- M8 has nothing yet: `claimSchema` is strict (`common/lib/report/schema.ts:76-87`, docs `CLAIM_FIELD_DOCS` :204-216 →
- REPORT.md); `makeCurrent` (`iterations.ts:699-726`) overwrites the article's report, so proposals kept in
- `report.json` would vanish on a later iteration; the redesign reserved a `verdict-proposed` inbox kind
- (`plans/umtool-redesign.md:162`); the pattern is `drafts-unreviewed` (`umtool/lib/inbox.ts`,
- `inbox/{drafts,groups,what}.mjs`). Don't reuse `claim-unadjudicated` (the manifest claim bench's).
-- Deck: `draftPrecheck` (`umtool/lib/report/chain-draft.mjs:16-23`) skips; the tasks refuse (`flips.ts:220-224`,
- `threads.ts:169-172`); the minimal chrome is `{engine:"hyperframes", layout:"deck", deck:{}}` (`deck.mjs:137-157`,
- `OnscreenSection.tsx:1053`); `STARTER_RENDER` has no chrome (`convertManifest.ts:389-411`).
-- Social: nothing exists. The pattern is `publish.youtube` — `drafted.mjs` (:40, :47-55, :158, `validatePublish`
- :505-530), `tasks/youtube.ts` (`YOUTUBE_SPEC`), `umtool/report-to-video/youtube.mjs` (`composeYoutubeText`,
- `youtubePreview`), `build-video.mjs` `writeYoutubeText`, umtool `YoutubeSection` in
- `components/projects/report/MediaTab.tsx:66`.
-- **Since the redesign (2026-10-15):**
- - Media surface: `umtool/components/projects/report/MediaTab.tsx` renders `<MediaDrafts>` (:32), `<OnscreenSection>`
- (:46), `<YoutubeSection dir manifest>` (:54) — hardcoded JSX, no registry; draft rows come from `MEDIA_SECTIONS` in
- `components/projects/MediaDrafts.tsx:51-59`; the Draft everything button is `MediaDrafts.tsx:517-531`
- (`ChainPanel mode="draft-all"` :554). Chain logic (`chain.mjs`, `chain-run.mjs`, `chain-draft.mjs`) unchanged.
- - `reportDraft.ts` dispatches `ReportDraftTask = GenerationTask | "refresh" | "triage"` (:143-146; triage :469,
- refresh :477) with new body keys (`ids`, `fetch`, `dryRun`, triage's); `tasks/` gained `refresh`, `restrict.ts`;
- `draft/refresh/`, `draft/triage/` are new. `GENERATION_TASKS`, `MEDIA_STEP_TASKS`, `claimSchema`, `FIELD_TASKS`
- unchanged.
- - **R4 already reads gone sources** (`draft/refresh/delta.ts:194-195, 273-295`, `RecordRead.state`, `goneParts`
- "1 source deleted on YouTube", `refresh/types.ts:86-121, 226`) — E2 reuses that reading, not a second one.
- - **R6's window judge** (`draft/triage/judge.ts` `judgeCandidates` :113): an injected `ask(system, user, schema)` over
- `structuredAnswer` + `Meter`, model lines verified verbatim in the window (`locate`, `checkWordsInWindow`), a trace,
- a cap via `stop()`; calibration by operator Right/Wrong marks (`umtool/lib/research/triage-marks.mjs`,
- `precisionOf`/`suggestThreshold` in `triage/types.ts:313,335`, `GenerationTriage` settings). V1 reuses its shapes
- (ask injection, trace, marks → precision) rather than inventing new ones.
- - Inbox kinds (`umtool/lib/inbox/groups.mjs:42-66`): research-proposal, iteration-failed/ready, drafts-unreviewed,
- open-note, unreadable-notes, link-ambiguous, looks-done, tick-failed/held/partial, edition-ready, worth-researching,
- refresh-held/available. `verdict-proposed` is still unbuilt (reserved, redesign plan :1065, :1129).
- - Flakes the redesign recorded and left: `publish-lane.spec:78`, `storage-locations.spec:723`; `site-scope.spec` owed
- to r29 (R3 record); `fetchPosts.test.ts` red again under load in R5.
-- Debts: `relocateDir.ts` `classifyDrift` :397-411 / the reconcile message :590-599 (`DIR_MTIME_ONLY` :368 already used
- by verify); `fetchPosts.test.ts:236` (fixed 100/300 ms gaps, a 200 ms cancel); `scripts/queue-lock.test.mjs` fixed
- holds at :167, :185/:196, :206/:212, :808; `mcp/src/generation.ts` `renderIterationSummary` :421-426.
-
-## Shape (slices)
-
-| # | Slice | What | Depends |
-|---|---|---|---|
-| S0 | Setup (orchestrator) | `r29/integration` from `main`; this plan; the test kit: a synthetic Bluesky post + AppView fake (`common/testing/social/fakeBluesky.mjs`), a fake Wayback CDX (`common/testing/web/fakeWayback.mjs`), a deleted-video record (`GONE_RECORD`, `GONE_AVAILABILITY`) in the draft corpus; delete the three r28 smoke drafts (`archilyzer reports delete <id> --apply`, plan first) | — |
-| E1 | Bluesky capture | `blueskyFetcher.captureByIds`: `getPosts` (liveness + `embed.images[].fullsize`), headless Playwright with no profile on `bsky.app/profile/<h>/post/<rkey>` → `shot.png` (cropped to the post), images beside it, `writePostCapture`; availability merged as X's is. Optionally archive image URLs as `Post.media[]` in `normalizeBlueskyItem`. Paced (one page at a time, real gaps). | S0 |
-| E2 | Deleted-video fallback | (a) ops `wayback-lookup {url\|slug,id}` → CDX captures (paced, the same client manners as `archive-search`); (b) `archive-search` by YouTube id → a mirror's direct file URL; (c) a `find-copy` step that tries Wayback then archive.org for each cited gone window and calls `fetch-windows` with `webpageUrl` (provenance records which copy); (d) compose: a cited moment whose recording `isPermanentlyGone` (or post deleted in `posts-availability.json`) and has no media is accepted, flagged `sourceGone`; `MomentArticle`/`CitationCard` show "source deleted" (export site + homepage share the components); prepare reports it as a warning, not a failure. Gone status is read the way R4's refresh reads it (`refresh/delta.ts`), one helper for both. | S0 |
-| V1 | Bench v2 | `prompt.ts`: definitions to the operator's standard (CORROBORATED = the substance is shown; framing/unshown detail does not demote; PARTLY needs a part shown overstated or wrong), a CORROBORATED-vs-PARTLY tie rule, `reason` before `verdict`, report/section/speaker/date context, `PROMPT_VERSION`; the definitions in one shared place (`verdicts.mjs` + REPORT.md, generated). `items.ts`: window modes (±N, speaker turn), counted (not silent) drops, stratified `--limit`. `run.ts`/`store.ts`: `--items-from <run>`, resume over the invocation's models only, prompt version + item hash in the summary (refuse a cross-version resume). `score.ts`: "not CORROBORATED" precision/recall, run-vs-run comparison. Reuse R6's judge shapes: the injected `ask` for tests, a per-call trace, and operator Right/Wrong marks on disagreements (as `triage-marks.mjs`) so the bar can be set from marked precision. umtool `/tools/bench`: a run's prompt version, compare two runs, mark a disagreement (inside the existing page, on the redesign's primitives). | S0 |
-| V2 | Bench v2 runs (orchestrator) | qwen-only on `vb-r28`'s items (free) per prompt iteration; then one paid run (≤ $5) on the best prompt; results in the record (counts only); the operator sets the bar | V1 |
-| M8 | Proposed verdicts | Proposals in a sidecar `transcripts/reports/<id>/verdicts.proposed.json` written through the registry (survives `makeCurrent`; never in `report.json`); `tasks/verdicts.ts` (reuses `benchItemsOfReport` in an "unruled" mode + `benchPrompt`; refuses models not in `settings.generation.verdicts.models`; never writes `verdict`); `GENERATION_TASKS` + routes, dispatched in `reportDraft.ts` beside R4/R6's `refresh`/`triage`; `pnpm ops verdict-review {article, claim, approve, note}` (approve → `patchArticle` sets `verdict`); umtool: the `verdict-proposed` inbox kind (`lib/inbox.ts`, `inbox/{groups,what}.mjs`) + approve/reject on the article (a new small component). Built after V1; ships enabled only for models that pass the bar. | V1 (code); V2 + the operator's bar (enable) |
-| G1 | Deck option | Draft everything `deck: true` (umtool chain body `deck`, `umtool chain --deck`): a non-model chain step `deck` before `draft-flips` writes the minimal chrome only when `render.chrome` is absent, through the manifest writer (snapshot), and says so in the step detail; default off (behaviour unchanged). UI: a "with the deck" checkbox beside the button in `MediaDrafts.tsx` (~:517). | S0 |
-| G2 | Social promotion text | `publish.x` / `publish.bluesky` drafted fields (`drafted.mjs` registry + `validatePublish`); `tasks/social.ts` on the media scaffold (one post + an optional short thread each; code enforces X 280 with URLs at 23, Bluesky 300 graphemes; grounded, third person, no unsaid quotes; links appended by code: the video/article URL); chain step `draft-social` after YouTube; `report-to-video/social.mjs` composer → `out/x.txt`, `out/bluesky.txt`; `components/projects/SocialPostSection.tsx` (show + Copy, like `YoutubeSection`) mounted in `MediaTab.tsx` after `YoutubeSection` (:54); `social` added to `MEDIA_SECTIONS` (`MediaDrafts.tsx:51-59`) for its draft row. Text only — never posts. | S0 |
-| D1 | Debts | relocateDir counts `DIR_MTIME_ONLY` separately in the reconcile message; `fetchPosts.test.ts` and `queue-lock.test.mjs` gate on files instead of fixed delays; `generate`'s answer puts `Video project:` first for step tasks; editor `site-scope.spec` (a Back lands on about:blank, ~1/13 since r23), `publish-lane.spec:78` and `storage-locations.spec:723` — wait on the real event; each 5 runs. | S0 |
-
-## Lanes (at most three Opus implementers; worktrees from `r29/integration`)
-
-- **S0 (orchestrator)**, then **phase 1**:
- - lane A (`r29/evidence`): E1 → E2;
- - lane B (`r29/verdicts`): V1 → M8 (code);
- - lane C (`r29/gen-debts`): G1 → G2 → D1.
-- The orchestrator: S0; V2's runs once V1 merges; the gate round; the rollout; H4's re-run.
-- Prelude `$T/r29-prelude.md` (from r28's), plus: umtool UI on the redesign's primitives (`components/ui/*`, role
- tokens, `lib/hrefs.ts`) and URLs (`/projects/<p>?tab=…`, `/tools/bench`; old paths are 308s).
-- Merge hotspots: `reportDraft.ts` / `generationSettings.ts` / `tasks/index.ts` (B's `verdicts`, C's `social`);
- `drafted.mjs` (C); `umtool/lib/inbox/*` (B); `scripts/archilyzer-ops.mjs` + COMMANDS.md (A's ops, B's
- `verdict-review`); SETTINGS.md; `editor/CHANGELOG.md`; this file's Record. Generated docs are regenerated at merge.
-
-## Rules that bind every slice
-
-As release 28:
-- no session links or trailers; the Co-Authored-By line alone;
-- heavy work through the heavy slot (6 GB floor, one `next build` at a time);
-- scratch in the job dir, never `/tmp`;
-- no hand edits under `transcripts/**`;
-- no yt-dlp, gallery-dl or ASR by hand — captures and fetches go through the editor, paced: one stream, real gaps, back
- off on 429;
-- never print the key or the scrub files;
-- Candace data stays local-only — bench commits carry counts only;
-- tests use fakes; real calls only in V2 (≤ $5) and the live smoke (≤ $3);
-- message the redesign session before restarting :3050 or moving `main`.
-
-## Verification
-
-- Unit: E1 against the fake AppView + a Playwright page over a local fixture (no network); E2 CDX parsing, find-copy
- order, compose's `sourceGone` acceptance and its refusal of a live-but-missing moment; V1 prompt version / resume /
- items-from / stratified limit / the new scores; M8 never writes `verdict`, refuses unlisted models, the sidecar
- survives `makeCurrent`; G1 the deck written only when absent; G2 lengths (X URL weighting, Bluesky graphemes),
- grounding; D1 flakes 5× each.
-- e2e: umtool `verdict-bench.spec` (prompt version, compare), a `verdict-proposed` spec (inbox row → approve → verdict
- set), `media-draft.spec` gains deck + social; editor `capture-posts` for a Bluesky channel over the fakes; the export
- `report` suite gains a source-deleted moment.
-- Gates on the integration tip: typecheck, all unit suites, docs/settings checks, four capped builds, `pnpm e2e:all`,
- privacy counts, the source mirror check.
-- Live (the operator's key, ≤ $3 smoke; ≤ $5 bench): capture the two H4 Bluesky posts; run find-copy on the two deleted
- videos (a copy found → clip; else text-only "source deleted"); `reports prepare` + the private homepage build succeed;
- Draft everything with the deck on a fresh article (flips/threads drafted); `out/x.txt` / `out/bluesky.txt`; bench v2
- numbers for the operator's bar; then M8 on one fact-check for a passing model, a proposal approved in umtool.
-
-## Rollout
-
-Fast-forward `main` (coordinated with the redesign session); editor + umtool rebuild/restart via
-`~/reports/release-29/scripts` (copied from r28's, MERGE/LIVE re-guarded); homepage source-mirror publish; the private
-homepage build (H4 closed).
-
-## Record
-
-### S0, as shipped (2026-10-15, orchestrator)
-
-`r29/integration` from `main` `dd162ec2`, in the worktree `r29-integration`.
-
-| Commit | What |
-| --- | --- |
-| `89b93fa5` | the test kit: `social/fakeBluesky.mjs` (AppView `resolveHandle`/`getPosts` with `embed.images[].fullsize`, a bsky.app-shaped post page with `postThreadItem-by-<handle>`, PNG images, 429s), `web/fakeWayback.mjs` (CDX json/text, status filter, limit, prefix, captures, 429/503), `draft/corpus.mjs` `GONE_RECORD` + `GONE_AVAILABILITY` |
-| (this commit) | this plan |
-
-Gates: common tsc clean; `testing/fakes.test.ts` 13/13 (10 + 3 new).
-
-The three release 28 smoke drafts deleted through `archilyzer reports delete <id>` (each a dry run first, then
-`--apply`): `r28-smoke` (the article, its i1 video project and its staged exports — 3 paths, 45.0 MiB),
-`r28-smoke-research` and `r28-smoke-research2` (articles in the making — 265 KiB and 262 KiB). The usage ledger's rows
-and the shared prepared-media cache are kept, as the command keeps them.
-
-### V1, as shipped (2026-10-15, lane B, `r29/verdicts`)
-
-Bench v2: the verdict bench asks to the operator's standard, says which prompt and which items a run used, and can be
-compared and marked, so the bar can be set from marked precision. No real calls were made (the fakes and the injected
-`ask` only); V2's runs are the orchestrator's.
-
-- **The meanings are written once** — `VERDICT_MEANINGS` and `VERDICT_TIE_RULE` in `common/lib/report/verdicts.mjs`
- (typed in `verdicts.ts`): CORROBORATED = the substance of the claim is shown by the cited words (framing, emphasis or
- a detail the transcript does not show does not demote it); PARTLY = a part is shown overstated or wrong (a part only
- not shown is not PARTLY); CONTRADICTED and NOT_FOUND sharpened to the claim's substance; UNTESTABLE as before; the tie
- rule "In doubt between CORROBORATED and PARTLY: CORROBORATED, unless a part of the claim is shown overstated or
- wrong." The bench's system prompt, REPORT.md's verdicts table (a "Means" column and the tie rule, `docs.ts`),
- `CLAIM_FIELD_DOCS.verdict` (a pointer) and umtool's `/tools/bench` read them.
-- **The prompt** (`bench/prompt.ts`): rules only (Q0), the meanings and the tie rule, "write the reason first"; the
- answer schema `{reason, verdict}` (reason first); the user prompt carries `Report:` (the title), `Section:` (the
- claim's heading), each cited line's speaker (the citation's, else the channel) and recording date (the citation's,
- else the record's `upload_date` — `bench/disk.ts` `diskDateOf`), each window headed with its channel and date.
- `PROMPT_VERSION = "2"`; a run without one is `"1"` (`M7_PROMPT_VERSION`). The local prompt stays under 7,800
- estimated tokens (the window trimmed, as before).
-- **Items** (`bench/items.ts`): `--window-mode seconds|turn` — `turn` is the cited speaker's run of attribution
- segments (`diskTurnsOf`), else the cues until a ≥ 2 s pause or a `>>` cue, clipped to ±`--window`; a window's
- `bound` says which. A citation of a kept claim that gives no window is DROPPED with its reason (not in the report's
- citations, not a video or audio citation, the recording has no cues, no cues around the cited seconds) and listed in
- `summary.dropped`, the dry run and the page. `--limit` is stratified (`stratifiedLimit`: every ruled verdict kept,
- the rarest first, the rest in proportion, the largest remainder); the rest are skipped "left out by the limit".
- `unruledItemsOfReport` is M8's reading of the unruled claims.
-- **Runs** (`bench/run.ts`, `store.ts`): `--items-from <run>` takes that run's exact items (context lines filled from
- the registry; refused with `--report`, `--window`, `--window-mode`, `--limit`); a resume asks ONLY this invocation's
- models (a qwen-only re-run never re-asks an API pair; `summary.models` the union); the summary records
- `promptVersion`, `itemsHash` (`benchItemsHash`: keys, rulings and windows), `windowMode`, `itemsFrom`, `dropped`; a
- resume under another prompt version, or with `itemsFrom` naming other items, is refused. Every call is traced
- (`trace.jsonl` in the run dir: a `start` line per invocation with the system prompt and schema, a `call` line with the
- user prompt, the raw answer, the verdict, ms, usd). The model is injectable (`BenchDeps.ask(system, user, schema,
- model)`, R6's shape).
-- **Scores** (`bench/score.ts`): `notCorroborated {tp, fp, fn, precision, recall}` per model and the baseline;
- `compareBenchRuns` (each model asked in both: agreement in each over the shared items, the claims whose answers
- changed, fixed and broke); `markedScore` (a disagreement marked Right counts as the model agreeing) tallied by
- `markTally`, which triage's `precisionOf` now uses too (its output and tests unchanged).
-- **umtool `/tools/bench`** (inside the page, on the redesign's primitives): the status line names the window mode, the
- prompt version (`data-prompt-version`) and the items hash (`data-items-hash`, and `from <run>`); **compare with**
- (`nav "compare with"`, chips `<run> · prompt v<n>` over the runs with the same items hash) and its table (region
- `compare`, `data-compare`, `data-metric` `agreement-a|agreement-b|changed`, list `changed answers`); **Right** /
- **Wrong** (pressed when set, again to unmark; `data-mark`) on every answered disagreement, kept in the run's
- `marks.json` (`lib/bench-marks.mjs`, R6's discipline, umtool the one writer; `POST /api/bench/marks {run, model,
- key, verdict}`, refused on an agreement); region `precision` beside the bar (`data-metric`
- `precision|marked-precision|marks`); "what the verdicts mean" (`data-meaning`); the dropped citations.
-- **CLI/ops:** `archilyzer reports bench-verdicts` gains `--window-mode`, `--items-from` and the stratified `--limit`;
- the body keys `windowMode`, `itemsFrom` (controller, the editor route, `pnpm ops` help); COMMANDS.md and REPORT.md
- regenerated.
-
-| Commit | What |
-| --- | --- |
-| `243cf1ec` | common, editor: the meanings, the prompt v2, window modes, drops, the stratified limit, items-from, the resume, the items hash, the new scores, the injected ask and the trace; CLI/ops/route flags; `bench.test.ts` (+5), `reports-bench-verdicts.test.ts`, `_benchVerdicts.test.ts`; COMMANDS.md, REPORT.md |
-| `452446a9` | umtool: `/tools/bench` — version, hash, compare, marks, precision, meanings, drops; `lib/bench-marks.mjs` (+ test), `/api/bench/marks`, `MarkButtons`; `verdict-bench.spec` (+2) and its fixture's second run |
-| (this commit) | this record, FACTS, CHANGELOG |
-
-Gates (at `452446a9`; branch start `3217bdfb` in brackets):
-
-| Gate | Result |
-| --- | --- |
-| repo-wide `tsc --noEmit` | clean at each commit |
-| common `pnpm --filter yt-dlp-transcript-common test` | **4198/4198** [4193] (+5 in `bench.test.ts`: the meanings, tie rule, schema order and context; the turn mode and the drops; the stratified limit; the injected ask, the trace, items-from, the resume over its own models, a cross-version resume refused; not-CORROBORATED, the compare, the marks) |
-| editor unit `pnpm --filter editor test` | 304/304 [304] (`_benchVerdicts.test.ts` gains the two body keys) |
-| mcp `pnpm --filter yt-dlp-transcript-mcp test` | 370/370 [370] |
-| `pnpm run test:scripts` | 1014 tests, 1011 pass, 3 skipped, 0 fail [1013: 1009 pass, 3 skipped, 1 fail — `queue-lock.test.mjs` "two builds never overlap", the timing flake D1 owns; green this time] (+1 `bench-marks.test.mjs`) |
-| `pnpm --filter umtool test` | 33/33 [33] |
-| `archilyzer docs cli|files|env --check`, `settings example --check` | clean |
-| umtool e2e `verdict-bench.spec.ts` (foreground, queued; its prebuild 69 s) | **4 passed**, 0 failed, 24.6 s |
-
-Found and left:
-- **No dry run over the real registry was made** from the worktree (it has no corpus and no `vb-r28`); the first
- `--dry --items-from vb-r28` is V2's, through the primary.
-- **The turn mode without attribution** reads the cues' pauses: on a stream whose cues run back to back (as the
- synthetic ones do) a turn is the whole ±window, `bound: "limit"`. With an `attribution.json` it is the speaker's run
- of segments.
-- **An injected `ask` has no Meter**: its calls cost nothing in the run's spend (the cap still applies to the estimate).
-
-### E1, as shipped (2026-10-15, lane A, `r29/evidence`)
-
-Bluesky captures posts with no login, as ruled: the real bsky.app page, headless. Built as the plan's Shape row, with
-these as built:
-- `blueskyFetcher.captureByIds` is `captureBlueskyPosts` (`common/social/blueskyPostCapture.ts`) over live deps. Per
- run: the handle resolved to its DID once; `getPosts` in batches of 25 for the posts owed (`captureWork`); a post
- absent from a batch that answered is `deleted` (availability `deleted`, no page opened, an earlier capture's shot and
- media kept in the record); a batch that failed says nothing about its posts (state `error`, no availability).
-- A live post: ONE headless Chromium per run, a fresh context (no profile, no cookies, 1280×1600 at 2×, en-US,
- light), `bsky.app/profile/<author handle>/post/<rkey>`; the post is the `[data-testid="postThreadItem-by-<handle>"]`
- element — the only one, else the one whose text holds the post's first 80 characters (a self-thread's parents and
- replies share the test id); `shot.png` is that element's box (`fullPage` + clip, as X's). A post that does not
- render is `error` (a page that asks to sign in says so: the capture has no login).
-- Images: `embed.images[].fullsize` (else `thumb`), or a recordWithMedia's `media.images`, downloaded as
- `media-<n>.<ext>` (the content type, else the CDN's `@jpeg`). Video embeds are not downloaded (`mediaState` `none`).
-- Pacing: a gap before every page after the run's first, `blueskyPageGapMs` = max(3 s, the channel's
- `postPagePauseSeconds`) × [1, 2); 1–2 s between images; an AppView or CDN 429/503 waited out (Retry-After, else 5 s
- doubling, capped 2 min, 4 attempts) and then the run stops; a page 429 is waited out once (≥ 30 s), a second stops
- the run; 45 s per page load, 20 s for the post to appear; cancel and drain checked between posts and raced against
- a page load; three errors in a row stop the run.
-- Base URLs: `common/social/blueskyEndpoints.ts` — the AppView, bsky.app and the CDN, injected as `deps.endpoints`;
- the fetcher's own AppView reads (`fetch`, `checkAvailability`, `fetchOne`) now read it per call. Test-only:
- `E2E_BLUESKY_ORIGIN_FILE` names a file holding one loopback origin that all three then are; the editor e2e server
- sets it per slot (`<test-transcripts>/.fake-bluesky-origin`, `blueskyOriginFile` in `editor/e2e/servers.ts`).
-- Not done (optional): image URLs as `Post.media[]` in `normalizeBlueskyItem` — the PostModal lists a post's `media`
- as links on every site, a visible change nobody asked for; the capture reads the URLs from `getPosts` instead.
-
-| Commit | What |
-| --- | --- |
-| `0295636d` | common, editor: `blueskyPostCapture.ts`, `blueskyEndpoints.ts`, `blueskyFetcher.captureByIds`; `E2E_BLUESKY_ORIGIN_FILE` (envVars, ENVIRONMENT.md, `servers.ts`, the config's header); unit tests; the editor `capture-posts.spec.ts`; the capture-posts route test (a Bluesky channel now passes the fetcher check and is refused as a stray id; the "cannot capture" case is a Nitter channel) |
-| (this commit) | this record, FACTS "Release 29 lane A", CHANGELOG |
-
-Gates (from the worktree root):
-- `pnpm -r exec tsc --noEmit`: clean.
-- common: 4188 at the branch's start (3 failing that run, not reproduced) → 4204, all pass
- (`social/blueskyPostCapture.test.ts` 11, one of them a real headless Chromium over the fake's page: the shot is
- 1200 px wide — the 600-px thread item at 2× — not the page).
-- editor unit: 304/304 (the branch-start run read 279 with 14 failing; not reproduced); mcp 370/370;
- `test:scripts` 1010 + 3 skipped.
-- `docs env|files|cli --check`, `settings example --check`: clean.
-- editor e2e, one spec in the foreground: `capture-posts.spec.ts` 1/1 (26 s, the e2e build 51 s): the image post's
- shot (1200 px wide) and two images, the text post's shot, the deleted post `deleted` in `posts-availability.json`,
- bsky.app asked for the two live posts only.
-
-### E2, as shipped (2026-10-15, lane A, `r29/evidence`)
-
-The deleted-video fallback, as ruled: a copy when one is found, else a text-only moment marked "source deleted".
-Built as the plan's Shape row, with these as built:
-- **One gone reading**, `common/lib/sourceGone.ts` (`goneState`, `GONE_STATES` = deleted | private,
- `SOURCE_GONE_LABELS`) and `sourceGone-server.ts` (`sourceGoneState(videoDir)` — `resolveEffectiveAvailability` →
- `stateFromAvailability` → `goneState`, refresh's reading; `recordGoneState`; `postGoneState` — `deleted` in
- `posts-availability.json`). Refresh's delta calls `goneState` (its one call; its tests unchanged and green).
- `missingEvidenceWindows` reads it too (it read the explicit `availability.json` + `isPermanentlyGone` before), and
- names the state on the window (`gone`). So a **members-only** recording is no longer "unfetchable: gone" there: it
- is a window to fetch (member cookies fetch it), as refresh already read it.
-- **(a) `wayback-lookup`** `{url}` | `{slug, id}` (the record's page: its metadata's `webpage_url`, else its
- availability check's `webpageUrl`, else the playlist's), `okOnly?`, `limit?` (100, ≤ 500) → the CDX captures,
- oldest first (`timestamp`, `status`, `mimetype`, `replayUrl`). `lib/waybackClient.ts` is an `ArchiveOrgClient`
- of its own (its UA, 2 s gap, 429/503 Retry-After back-off, then `ArchiveOrgRequestError` `rateLimited`); a new
- `ArchiveOrgClient.getText` reads the CDX answer, whose empty forms (`[]`, an empty body, a header alone) are none.
-- **(b) `archive-search {youtubeId, limit?: 10}`**: the query
- `identifier:(youtube-<id>) OR originalurl:(*<id>*) OR description:("<id>") OR title:("<id>")`, each hit's metadata
- read; an item that does not name the id, is restricted, or holds no video file the upload can be told by (several
- originals, none naming the id) is `skipped` with why; else its file — one naming the id first, an original before a
- derivative, mp4 › webm › mkv › m4v › mov — as `https://archive.org/download/<identifier>/<file>`. The archive.org
- fake gained a mirror of `GONE_RECORD` and `field:value` OR-clause searches (its existing tests green).
-- **(c) `find-copy`** `{article}` | `{articles: true}` | `{siteId}`, `dryRun?` (`publish/findCopy.ts`
- `findCopies`/`runFindCopy`, `editor/app/channels/[slug]/videos/findCopyAction.ts`): the host's
- `missingEvidenceWindows` "unfetchable: gone" windows, grouped by recording, one recording at a time: the newest
- 200 Wayback capture of its page, else the first archive.org mirror; a lookup archive.org keeps refusing stops the
- run (`stopped`); none found → `text-only`. Every found copy's windows go to ONE `fetchWindowsJobAction` on
- `clips:archiveorg` (one job, one stream), each item's `webpageUrl` the copy's URL and `copy: {from: "wayback" |
- "archive.org", url}`, which `fetchWindows` → `fetchWindowManaged` write into the window's sidecar
- (`ClipProvenance.copy`, `coerceClipCopy`; a replay keeps it). The lookups run in the request. fetch-windows' door
- (`planFetchWindows`) now refuses a gone recording's window unless the item names a `webpageUrl` — before, it would
- have asked the dead page.
-- **(d) compose**: a cited moment with no prepared media whose recording is gone (`recordGoneState`) or whose post is
- deleted (`postGoneState`) is accepted and flagged `sourceGone` on its citation view (`SpanCitationView`,
- `PostCitationView`) and its moment page (`MomentPageView`), with no clip or shot; a live one is still
- `missing-media`. `ResolvedSiteReports.sourceGone` / `ComposedReports.sourceGone` list them; compose and `reports
- check` log each as a warning. `prepareReportMedia` writes them to the index's new `warnings` (kind `source-gone`)
- instead of `problems` (checked after the unreachable-drive check), and `reports prepare` prints them; neither fails.
- `MomentArticle` shows "Source deleted" (or "Source made private") where the clip would be; `CitationCard` says it
- in the kind row and its link reads "Open <span>" for "Play". No schema doc lists the view shapes, so nothing was
- regenerated; `REPORT_VIEWS_VERSION` stays 1 (an optional field).
-
-| Commit | What |
-| --- | --- |
-| `d40960d6` | common: `sourceGone.ts`/`-server.ts`, `waybackClient.ts`, `findCopy.ts`, `ClipProvenance.copy`, compose's acceptance and the views, prepare's warnings, `reports check`, the two components, the archive.org fake; tests |
-| `e479489f` | editor, export, scripts: the `find-copy` and `wayback-lookup` routes, `archive-search {youtubeId}`, the fetch-windows door, the replay; ops rows and help (capture-posts names Bluesky); COMMANDS.md, OPERATING.md; the report-site fixture's `g01` and its spec |
-| `b5d5721e` | common: find-copy moved to `publish/findCopy.ts` (controller/ may not import publish/: `architecture.test.ts` named the back-edge) |
-| (this commit) | this record, FACTS, CHANGELOG |
-
-Gates (from the worktree root):
-- `pnpm -r exec tsc --noEmit`: clean at every commit.
-- common: 4204 (E1) → 4218, all pass (+14: `lib/sourceGone.test.ts` 2, `lib/waybackClient.test.ts` 3,
- `publish/findCopy.test.ts` 6, `controller/fetchWindows.test.ts` +1 (the copy in the sidecar),
- `publish/composeReports.test.ts` +1 (acceptance, private, refusal), `publish/reportMedia.test.ts` +1 (the
- warnings); `publish/missingEvidenceWindows.test.ts` names `gone`). Refresh's suites unchanged and green.
-- editor unit 304 → 308/308 (`_research.test.ts` +3: archive-search's id mode, wayback-lookup, find-copy refused at
- the door; `fetchWindowsAction.test.ts` +1: the gone door). mcp 370/370; `test:scripts` 1010 + 3 skipped; export
- unit 117/117 (`reports.test.ts`: the new moment's params, the reference numbers); homepage unit 25/25.
-- `docs env|files|cli --check`, `settings example --check`: clean.
-- Builds, capped, through the heavy slot, one at a time: editor `next build` 129 s, export `next build` 175 s.
-- export report suite, single specs in the foreground: `report-site.spec.ts` 24/24 (25.7 s, its stage built; the
- source-deleted moment: "Source deleted" on the reference card and the moment page, no clip, its cue in span);
- `slides.spec.ts` + `audit.spec.ts` 14/14 and `overview.spec.ts` + `timeline.spec.ts` 9/9 over the same stage
- (`E2E_REPORT_SITE_REUSE=1`). Homepage `articles.spec.ts` 4/4 (it reads the same fixture).
-- One real request left the machine in a unit test, once, while it was being written: an editor route test asked
- `wayback-lookup` for a record of a YouTube channel with no metadata, whose page `findVideoSourceUrl` rebuilt from the
- id, and the default client asked web.archive.org's CDX for `youtube.com/watch?v=no-such-video` (200, no captures).
- The test now names a record of no channel (404 before any request).
-
-Not done: the editor has no UI for find-copy (ops and the research door only — the brief named none); prepare's
-`warnings` are in the index and the job log, not on the editor's Reports tab.
-
-### M8, as shipped (code) (2026-10-15, lane B, `r29/verdicts`)
-
-Proposed verdicts: a model that cleared the bench's bar proposes a verdict for each unruled claim of a fact-check; the
-operator approves or rejects each. Built and tested over the fakes and an injected `ask` only; **nothing runs live
-until the operator ticks a model** (`settings.generation.verdicts.models` is empty by default) — after V2 and the bar.
-
-- **The sidecar** `transcripts/reports/<id>/verdicts.proposed.json` (`archilyzer-verdict-proposals` v1:
- `proposals: {<claim>: {verdict, reason, model, promptVersion, at, status: proposed|approved|rejected, note?,
- reviewedAt?}}`), written only by `common/lib/report/verdictProposals.ts` under the article store's lock, whole and
- atomic; a file that does not read is a 409, never taken for empty. Never in `report.json`, so `makeCurrent` cannot
- drop it (tested); compose, the homepage and the history read `report.json` only. `recordVerdictProposals` replaces a
- waiting proposal and keeps a reviewed one; `reviewVerdictProposal` approve → `patchArticle` sets the claim's
- `verdict` (refused when the claim was ruled meanwhile, or is gone), then the proposal `approved`; reject → `rejected`,
- the claim untouched.
-- **The task** `common/lib/report/draft/tasks/verdicts.ts` `proposeVerdicts`: `unruledItemsOfReport` (V1's reading of
- the claims with no verdict; a ruled claim is skipped "ruled by the operator") and `benchPrompt` (PROMPT_VERSION on
- every proposal), one claim per call; REFUSES a model not in `allowed` (`settings.generation.verdicts.models`, read
- again at the job's turn); never writes `verdict`; skips a claim whose proposal the operator approved or rejected; an
- API model held to `maxUsd` before each call. `verdictsModelOf`: the asked model (must be listed), else the first
- listed model on the `verdicts` route (`api`/`local`); `code` needs a model named.
-- **Generation:** `verdicts` in `GENERATION_TASKS` and every preset (`code`, `balanced` local, `api`, `local`);
- `report-draft {"task": "verdicts", "article", "claims"?, "model"?, "maxUsd"?}` dispatched in `reportDraft.ts` beside
- refresh/triage to `controller/reportVerdicts.ts` `enqueueVerdictProposals` — one `report-draft` job (no iteration:
- the answer's `iteration` is 0) on `draft:local` (the GPU arbiter's gated fetch, ollama unloaded at the end) or
- `draft:api` (the revision cap, the daily cap at the ask and the turn, ledger rows task `verdicts`); the cues the
- local corpus's (`diskCuesOf`, as the bench); the log ends `@@report-draft {…, verdicts: {proposed, failed, skipped,
- promptVersion}}`. The new body key `claims` (a verdicts job's only).
-- **Review:** `pnpm ops verdict-review {article, claim, decision: approve|reject, note?}` → `POST
- /api/ops/verdict-review` (synchronous; 404 no proposal, 409 reviewed already / ruled meanwhile / a sidecar that does
- not read). The ops ACTIONS row and help, COMMANDS.md, SETTINGS.md (`routes.verdicts`), settings.json.example,
- REPORT.md (the sidecar, the claim's `verdict` doc) regenerated.
-- **umtool:** the Inbox's `verdict-proposed` kind (Review, action **Review verdicts** → the article's `?tab=article`;
- `lib/inbox/verdicts.mjs` after `drafts-unreviewed`'s pattern, one row per proposal, the card "N verdicts proposed",
- "by <model> · prompt v<n>"; `lib/inbox.ts` reads each store fact-check's waiting proposals on still-unruled claims —
- gone once approved, rejected, or ruled by hand); the article tab's region `verdict proposals`
- (`components/articles/VerdictProposals.tsx`: each claim with its section, the proposed verdict as plain mono text —
- no verdict colour, it is not a ruling — the reason, model and prompt version, a note box `note on <claim>`, **Approve**
- / **Reject** outlines; `data-proposal`, `data-proposed`; status "Approved: c2 is PARTLY." / "Rejected: c3 stays
- unruled.") through `/api/articles/verdicts` → the editor's verdict-review. The e2e stub runs the REAL review over the
- fixture's store (`common/testing/verdicts/reviewStub.ts`). Docs: `umtool/docs/inbox.md`, `tools.md`.
-
-| Commit | What |
-| --- | --- |
-| `784e421f` | common, editor: the sidecar store, the task, the generation wiring, the controller, `verdict-review` (route + ops row); `tasks/verdicts.test.ts` (4), `_verdicts.test.ts` (2), mcp `generation.test.ts` (the api preset routes verdicts); COMMANDS.md, SETTINGS.md, REPORT.md, settings.json.example |
-| `62ed2add` | umtool: the inbox kind, the proposals panel, `/api/articles/verdicts`, the stub route, `verdict-proposed.spec`, `inbox/verdicts.test.mjs` |
-| `a14f4fc6` | docs: umtool's inbox and tools |
-| (this commit) | this record, FACTS, CHANGELOG |
-
-Gates (at `a14f4fc6`):
-
-| Gate | Result |
-| --- | --- |
-| repo-wide `tsc --noEmit` | clean at each commit |
-| common | 4202 tests, 4201 pass, 1 fail — `controller/transcribeFile.test.ts` "with no workerId the pool's highest-priority local worker…" (timing under the full suite's load; that file 24/24 three times alone; not touched by this lane) (+4: `tasks/verdicts.test.ts` — the model rule; the unruled claims only, report.json byte-identical, unlisted models refused; the sidecar survives makeCurrent, approve through patchArticle, reject, twice refused, a rerun skips ruled and reviewed claims, a reviewed proposal never replaced, a claim ruled by hand refuses approve; an API model capped) |
-| editor unit | **306/306** (+2 `_verdicts.test.ts`: the body; refused until a model clears the bar, then a job on draft:local writing proposals and never a verdict, ollama unloaded, approve sets it) |
-| mcp | 370/370 |
-| `test:scripts` | 1015 tests, 1012 pass, 3 skipped, 0 fail (+1 `inbox/verdicts.test.mjs`) |
-| `pnpm --filter umtool test` | 33/33 |
-| `docs cli|files|env --check`, `settings example --check` | clean |
-| capped umtool `next build` (the corpus linked, heavy slot, `MemoryMax=5G`) | exit 0; compiled 16.5 s, 55.7 s wall, 1.54 GB max RSS; the link removed; `/api/articles/verdicts`, `/api/bench/marks`, `/tools/bench`, `/api/browse/decisions` traces 1,019–1,088 files, none from `transcripts/`, `.e2e-song` or `.env*` |
-| capped editor `next build` (heavy slot, `MemoryMax=5G`) | exit 0; compiled 21.2 s, 1:31 wall, 2.52 GB |
-| umtool e2e `verdict-proposed.spec` (+ `article-notes.spec`, foreground, queued) | run 1: 9 passed, 1 failed — the panel unmounted with its status when the last proposal went (fixed: mounted while the article has a proposals file); run 2: **1/1**, 40.6 s |
-
-Found and left:
-- **Enabling is the operator's**: tick a model on `/tools/bench` after V2; then `pnpm ops report-draft --json
- '{"task":"verdicts","article":"<a fact-check>"}'` (or the MCP's `generate`). No umtool button starts a run yet (the
- brief named none); the Inbox and the article tab are the review side.
-- **The window** a proposal reads is the bench's default (±60 s, `seconds`); a bar set on a `turn` run would want the
- proposals in that mode too — `VerdictsInput.windowMode` exists, nothing sets it from settings yet.
-- **Two lock windows on approve**: the verdict is set by `patchArticle`, then the proposal marked; a crash between
- leaves a `proposed` entry on a ruled claim, which nothing shows (the inbox and the tab list unruled claims only) and
- a rerun skips.
-
-### G1, as shipped (2026-10-15, lane C, `r29/gen-debts`)
-
-Draft everything's deck, as ruled: an option, off by default. Built as the plan's Shape row, with these as built:
-- **The step** is `deck` in `CHAIN_STEPS` (`umtool/lib/report/chain.mjs`), mode `draft-all`, `option: "deck"`, placed
- after `draft-teaser` and before `draft-flips`, no `draft` (no model, no `--model` on its argv). A step with an
- `option` is in a chain only when that option is on: `chainStepsOf(mode, {deck})`, and `chainStart` / `chainSteps` /
- `planChain` take `deck`. Without it the draft-all chain is exactly release 28's list (its labels count the same);
- `deck` with the video chain is refused. It is `optional`: a refusal is recorded failed and the chain goes on (flips
- and threads are then skipped by `draftPrecheck`, as before).
-- **What it writes** is `deckChrome()` (`chain-draft.mjs`, the one constructor: `{engine: "hyperframes", layout:
- "deck", deck: {}}`, a fresh object), which the On-screen section's switch now calls too (it had the literal). There
- was no constructor in `deck.mjs` to reuse (its :137-157 is `validateChrome`). It is written by
- `addDeckChrome(dir, chrome)` (`lib/report/manifest.mjs`): under the manifest lock, a cut whose `render.chrome` is
- set (anything but null/absent) is left untouched (`{added: false}`, nothing written); else `validateChrome`, an
- `auto-before-deck` snapshot in `revisions/`, then the writer. The step's line is "deck added: …" or "deck already
- there: …" (`deckStepDetail`).
-- **Where it is asked for:** umtool's chain route takes `deck` in the POST body (refused without `draftAll`) and
- `&deck=1` on the GET; `chainViewOf(…, {deck})` lists the step when asked or when the iteration recorded a
- `chain:deck` step; `ChainPanel` takes `deck`; `MediaDrafts` has the **with the deck** checkbox
- (`data-draft-everything-deck`) beside **Draft everything**, the run keeping the value it was started with;
- `umtool chain <article> <n> --draft-all --deck` (`--deck` alone is refused).
-- **Found:** the minimal deck (its defaults) does not fit a small frame: on the e2e's 640×360 cuts `validateChrome`
- refuses it ("footageScale 0.82 needs 294px but a 190px deck leaves 170"). The step is then recorded failed, as built;
- the e2e's deck cut is full HD.
-
-| Commit | What |
-| --- | --- |
-| `ca779c9d` | umtool: the `deck` step, `deckChrome`, `addDeckChrome`, the route/view/panel/checkbox and `--deck`; `chain.test.mjs` (+1), `chain-draft.test.mjs` (+1); common `deckOption.test.ts` (3: flips and threads drafted on a converted cut given the deck, over the fake ollama, through umtool's own writer) |
-| `b3e05faf` | (G2's commit, which carried the e2e of both) umtool e2e: `media-surfaces.spec.ts` "Draft everything with the deck" on msurf i3: the deck step done, the flips drafted (the stub's canned flips on a cut with a deck), the threads skipped, the snapshot, then the chain cancelled |
-| `4979ee0e` | umtool e2e: msurf i3 is a full-HD cut (the minimal deck's defaults need the room) |
-
-### G2, as shipped (2026-10-15, lane C, `r29/gen-debts`)
-
-The social promotion text, text only. Built as the plan's Shape row, with these as built:
-- **The counts are one module**, `common/lib/report/social.mjs` (+ `.d.mts`, exported; no node imports, so umtool's
- page reads it): `SOCIAL_LIMITS` (X 280, Bluesky 300, a thread of at most 4, a URL 23), `xLength` (twitter-text's v3
- weighting: every `http(s)://` or `www.` URL 23, an emoji grapheme 2, a code point in 0–4351, 8192–8205, 8208–8223,
- 8242–8247 1, any other 2), `blueskyLength` (NFC graphemes, `Intl.Segmenter`), `withLink` (the post, a blank line,
- the link), `validateSocialPost`, `socialLinkOf`.
-- **The fields:** `publish.x` and `publish.bluesky` `{post, thread?}` in `drafted.mjs` (`DRAFTED_MANIFEST_FIELDS`,
- `FIELD_TASKS` → `social`, `isEmptyField`, the marks' placement check). `validatePublish` takes `PUBLISH_KEYS`
- (`youtube, x, bluesky, videoUrl`): each post within its platform's count, a thread of at most 4, and
- `publish.videoUrl` an http(s) URL. **`publish.videoUrl` is new**: the video's public URL, the operator's to set once
- it is up; nothing drafts it. The stored first post INCLUDES its link (so the field is the post as published, and
- the lint counts what is pasted).
-- **The task** (`tasks/social.ts`, `SOCIAL_SPEC` on `runMediaTask`): one unit per platform, the YouTube task's
- evidence (`evidenceOf`, now exported). The link is code's, resolved once per run: `publish.videoUrl`, else the
- article's homepage page (`PROJECT_URL` + `/articles/<id>/`) when the registry has it published and `audience`
- public, else none — said once in the log, not a check (a check's soft problem would re-ask a model that cannot fix
- it). The prompt names the first post's budget (the limit minus the link's room: 255 on X); code counts the post
- WITH its link, refuses links, timestamps, hashtags, @mentions and emoji, and grounds every post with
- `checkLine(…, {quotes: true})` (names and numbers, Q1's third person, quotation marks only around a cited quote's
- words). The repair keeps the first post's sentences that pass and fit, and drops failing thread posts (to 4); never
- a rewrite. `toField` appends the link.
-- **Wired** as a media step: `MEDIA_STEP_TASKS`, `GENERATION_TASKS`, narrate's route in every preset (a release-28
- settings file keeps its preset, `social` takes the preset's route), `reportDraft.ts`'s media case, `runTask`, the
- MCP's lists and `MEDIA_REVIEW`, `/gen`'s phrasings, `archilyzer gen`'s usage; SETTINGS.md, settings.json.example and
- COMMANDS.md regenerated.
-- **Files:** `umtool/report-to-video/social.mjs` (`composeSocialText`: the first post, then each thread post under a
- `— k/n —` line; `socialTexts`, `socialTextName`), exported `umtool-report-to-video/social`. build-video's
- `writeSocialText` runs at the top of `writeYoutubeText` (every chapter mux, every variant: the posts are the cut's)
- and removes a platform's file when its post is gone. Draft everything's `draft-social` (after `draft-youtube`) writes
- the two files itself, no build needed, also when the draft is skipped.
-- **umtool:** `SocialPostSection.tsx` on the Media tab after the YouTube section (each platform's posts, their counted
- lengths in Meter — no verdict colour, "over the limit" in words — the file's age, "drafted by", **Copy**); `social`
- in `MEDIA_SECTIONS`, `PROJECT_DRAFT_TASKS` and its draft row; `writeDraftedField` takes `publish.x` /
- `publish.bluesky` ("Use this"); the drafts review labels them.
-- Test kit: `draft/runs/social.json` (the X post's first answer refused — first person, a link, a hashtag — and
- re-asked; the Bluesky post kept at once; no link: the kit's article is not public).
-
-| Commit | What |
-| --- | --- |
-| `b3e05faf` | common, umtool, mcp: `social.mjs`, the fields and `validatePublish`, `tasks/social.ts`, the wiring, `report-to-video/social.mjs`, build-video's writer, `draft-social`, `SocialPostSection`, the kit's run, docs; tests: common `social.test.ts` (7), `drafted.test.ts` (+1), `generationSettings.test.ts` (one test widened); umtool `social.test.mjs` (2), `chain-draft.test.mjs` (+1), `drafted-writer.test.mjs` (+1), `chain.test.mjs`/`create.test.mjs` lists; mcp `generation.test.ts` lists |
-| `b3e05faf` (cont.) | umtool e2e: `media-draft.spec.ts` "social" (the real task over the kit's run on mdraft i4, the Media tab's posts and counts); `media-surfaces.spec.ts` the draft-all chain's 16 steps with `out/x.txt` and `out/bluesky.txt`; the stub's canned social, `social` run for real on mdraft |
-| `4979ee0e` | umtool e2e: eight draft sections; the Bluesky post's count read on its first post |
-
-### D1, as shipped (2026-10-15, lane C, `r29/gen-debts`)
-
-- **relocateDir:** `CopyDifferences` gains `mtimeOnly`; `classifyDrift` puts a `.d..t` line (`DIR_MTIME_ONLY`) there,
- not in `changed`; `describeDifferences` appends ", and N directories differ only in mtime (…)"; a reconcile whose
- only drift is that says "the destination copy's content already matches the source; N directories differ only in
- mtime (…), which the mirror pass settles". The verify's own `.d..t` rule is unchanged.
-- **fetchPosts.test:** the fake's paged mode is stepped by files (`FAKE_GATES`: a page's cursor waits for
- `cursor-<p>`, the next page for `page-<p+1>`), so the drain lands between page 1's records and its cursor whatever
- the load; the resume run is cancelled once the fake's argv is in its log, not after 200 ms.
-- **queue-lock.test:** every fixed hold a test's assertion depended on is a gate (`gateCmd`) opened once the waiter
- has printed its banner (or, for the pass-through cases, once the nested run has finished while the lock is still
- held — no stopwatch): the banner, `QUEUE_LOCK_HELD`, `E2E_QUEUE=0`, the SIGKILL (until `holder.json`, not 500 ms),
- two heavy contenders, an e2e run behind a heavy one, two builds, the undeclared job, the nested build, named suites,
- the SIGTERM waiter, `--scale-by`; the FIFO test's first hold too.
-- **`generate`'s answer** (`renderIterationSummary`): for a media draft the `Video project:` line comes second, under
- the header; any other task's stays under the iteration's files.
-- **The editor flakes were product races, fixed in the app as R6.3 fixed Settings' save** (aaba3723):
- - `site-scope.spec` (Back on `about:blank`): the active-site cookie was set in a server action, which Next answers
- before its router applies the re-render the action carries; the picker's `router.push` in that gap discards the
- pending action, which is replayed as a refresh after the push, and React committing the two together writes the
- push's history entry as a REPLACE (Next 16's `HistoryUpdater`). The cookie is now written by **`POST
- /api/active-site`** (same-origin JSON; `setActiveSiteAction` and `lib/activeSiteActions.ts` are gone), and the
- provider refreshes after a write unless the caller navigates (`choose(value, {navigating})`). The same runs also
- showed two other site-scope reds, both fixed: a re-scope waiting seconds on the action's re-render under load
- (gone with the action), and the spec's `hydrated` (React's props on the select) coming before the provider's
- BroadcastChannel subscription — it now waits on the picker's `data-hydrated`, stamped by a re-render after every
- first-commit effect.
- - `storage-locations.spec:723` (the timing's "Saved." late): `saveHealthTimingsAction` no longer revalidates
- `/storage`; `HealthTimingForm` refreshes after an ok answer. The same spec's `:661` (any-age eviction) asserted a
- transient "still disabled" right after Preview, which a preview answering at once on the small fixture raced (2 of
- 5 under load): a MutationObserver in the page now records whether the button was armed before the answer.
- - `publish-lane.spec:78`: the spec waits on the lane's held state (`publishStatus`), then reloads, before reading
- the pause/resume button (the shared `LaneActionButton` and its lane actions are unchanged).
-
-| Commit | What |
-| --- | --- |
-| `315e8335` | common, mcp, scripts: relocateDir's `mtimeOnly` (`relocateDir.test.ts` +1, one case rewritten); `fetchPosts.test.ts`; `queue-lock.test.mjs`; `renderIterationSummary` (`generation.test.ts` +1) |
-| `742da22c` | editor: `POST /api/active-site`, the provider and the picker; the timing action and form; `site-scope.spec.ts`'s `hydrated`; `publish-lane.spec.ts` |
-| `d30248dc` | merge of `r29/integration` (`cfdeb856`: V1, E1, E2), clean |
-| `800a26fc` | editor e2e: `storage-locations.spec.ts`'s any-age eviction watched in the page |
-| (this commit) | these records, FACTS "Release 29 lane C", CHANGELOG |
-
-### Lane C review fixes (2026-10-15, lane C, `r29/gen-debts`)
-
-The review of `cfdeb856..2f6a0ad1` (no blocker), fixed on the branch:
-- **X weighs a bare domain** (`Kick.com`, `x.co`, `a.pages.dev/…`) as 23: `SOCIAL_URL_RE` takes a scheme-less
- `label.tld` whose TLD is in `SOCIAL_TLDS` (a conservative list), not glued to a word, an `@` or a dot (so `e.g.`,
- `3.5`, `a@b.com` are not links); `hasLink` is the social task's link refusal. `Kai streamed on Kick.com` is 39; 270
- characters and ` x.co x.co` are 318.
-- **The site picker after a navigating choice** refreshes once the new URL has committed (an effect on the URL after
- the push or replace), so a page cached under the old site re-renders. And then — found while re-running the spec —
- **the cookie has two writers again**: where the page stays, `setActiveSiteAction` (its answer re-renders the page);
- before a navigation, the route. With the route for every write, a pick on Channels in a second tab now and then never
- re-scoped (a `router.refresh` after the write that was not applied: 1–3 of 70, and a retried refresh did not help);
- the action never did. Both writers go through one promise chain (the last pick wins); the route's origin check reads
- `x-forwarded-host` first; another tab's pick shows at once. site-scope.spec: every pick waits for hydration, a
- re-scope's wait is 15 s (`RESCOPED`), and a new case — a choice on a site's page reaches Channels cached under the
- old site.
-- **A social post's quotation marks** are stripped only when they wrap it whole.
-- **Draft everything's social step** removes a platform's old `out/<platform>.txt` when it has no post.
-- **`publish.x`, `publish.bluesky`, `publish.videoUrl` are warnings** (`publishWarnings`, `drafted.mjs`): the lint warns,
- the build and the cut's structural edits go on; YouTube's rules and an unknown `publish` key stay errors; "Use this"
- on a social post still refuses one past its count (the field's own writer). When `publish.videoUrl` is set and a post
- drafted before it does not carry it, the Social posts section says so and offers **Re-draft the posts** (a forced
- `social` draft on the cut's iteration; a post you wrote is named and never replaced).
-- **A deck refused on a small frame** says "frame too small for the deck (W×H): …" (`deckRefusedDetail`).
-
-| Commit | What |
-| --- | --- |
-| `ed4a429d` | common: bare domains in X's count and the task's refusal; the quote strip |
-| `be921c5b` | common, umtool: `publishWarnings`; the re-draft notice and `RedraftSocial`; the social step's stale file; the deck's detail; tests |
-| `f338e552` | editor: the refresh after a navigating choice, the write chain, `x-forwarded-host`, the broadcast value; site-scope.spec |
-| `dcb704ba` | editor: the server action back for writes where the page stays |
-| (this commit) | these records, FACTS, CHANGELOG |
-
-Gates: tsc clean at every commit. common 4236/4236 (+1: the quote case; the X cases are in existing tests); test:scripts
-1022, 1019 + 3 skipped, 0 failed (+2: the small-frame deck, the lint warning); editor unit 308/308; mcp 371/371; umtool
-unit 33/33 (final counts in the report). umtool e2e `media-draft.spec.ts` + `media-surfaces.spec.ts` 7/7 (1.7 min; the
-social case now sets `publish.videoUrl` and re-drafts). Editor `site-scope.spec.ts`, 15 tests a run: with the route
-alone 69/70, 69/70, 67/70, 69/70, 140/140, 68/70; with the action back 140/140 (`--repeat-each=10`), 70/70, 70/70.
-
-### Lane C gates (2026-10-15, `r29/gen-debts`)
-
-Counts at the branch's start (`3217bdfb`) → before the merge → after the merge of `r29/integration` (`d30248dc`):
-- tsc (all packages): clean before every commit.
-- common: 4193/4193 → 4205/4205 (+12: `deckOption.test.ts` 3, `social.test.ts` 7, `drafted.test.ts` +1,
- `relocateDir.test.ts` +1) → 4235: 4234 pass, 1 failed — `ttsServer.test.ts` "a start that times out…", run beside
- an editor e2e; 6/6 alone.
-- mcp 370 → 371/371 (+1). editor unit 304 → 304 → 308/308 (the merge's). umtool unit 33/33.
-- `test:scripts`: 1013 (1008 pass, 2 failed — `queue-lock.test.mjs` "an e2e run takes the heavy slot too" and "two
- builds never overlap", the fixed holds — 3 skipped) → 1019 (1016 + 3 skipped, 0 failed) → 1020 (1017 + 3 skipped,
- 0 failed).
-- Flakes, 5 runs each, `fetchPosts.test.ts` and `queue-lock.test.mjs` run two at once: 8/8 and 37/37 every run.
-- `docs env|files|cli --check`, `settings example --check`: clean (COMMANDS.md, SETTINGS.md regenerated in
- `b3e05faf`; clean again after the merge).
-- umtool e2e, two specs per run, foreground: `media-draft.spec.ts` + `media-surfaces.spec.ts` 4/7 (the deck refused on
- a 640×360 cut, a Bluesky count's locator, seven sections → eight), then 7/7 (1.5 min), and 7/7 after the merge
- (1.4 min).
-- Editor e2e, one spec per run with `--repeat-each=5`, foreground (each run's prebuild a capped `next build` through
- the heavy slot): `site-scope.spec.ts` 64/65 (the other-tab broadcast), 64/65 (a re-scope over 5 s), then with the
- route 65/65 (2.0 min); after the merge `publish-lane.spec.ts` 10/10 (58.5 s); `storage-locations.spec.ts` 43/45
- (`:661` twice) then 45/45 (2.2 min).
-- umtool capped build, the corpus linked, through the heavy slot (5 GB): ok, 49 s wall; the link removed.
-
-Found and left:
-- The minimal deck refuses a small frame (G1, above). Draft everything on such a cut records the deck step failed.
-- A social post's link is resolved when it is drafted: a `publish.videoUrl` set later is in the posts only after a
- forced re-draft or an edit (the field shows its link, so the operator sees which).
-- `LaneActionButton`'s lane actions still revalidate (`/jobs`, `/workers`, the lane's page), so their buttons can
- re-render late under load as the timing's did; the publish-lane spec now waits on the lane's state instead. Not
- changed here: the button is shared by every lane.
-
-### M8/V1 review fixes, as shipped (2026-10-15, lane B, `r29/verdicts`)
-
-The read-only review of `3217bdfb..925bc809` (seven findings) and the orchestrator's rulings, fixed on top of `925bc809`:
-
-- **Fingerprint (1).** Each proposal carries `fingerprint` = `claimFingerprint(claim, citations)` (sha256, 16 hex, of the
- claim's text and each citation's kind, recording, seconds and quote). A proposal whose claim's fingerprint is not the
- current one is STALE: never waiting (umtool counts it: "N stale (the claim changed since)"), its review refused 409,
- and — reviewed — no reason to skip the claim now under that id (`proposeVerdicts`, `recordVerdictProposals`). Tested on
- a revision that drops a claim and shifts the ids.
-- **Compare-and-set (2).** `verdict-review` takes `verdict` and `at` (the proposal shown; required). The whole review runs
- under ONE lock (`patchArticleHoldingLock`, new in `registry.ts`, `patchArticle`'s body): refused 409 when the proposal
- was replaced or reviewed, its claim changed or was ruled; the CHECKED proposal is recorded. umtool's panel sends them
- and shows a refusal. Tested: a rewrite between view and click, concurrent approve and reject (one wins, the record and
- the claim agree).
-- **No orphans (3).** Every sidecar write is under the lock and refused (404) when `report.json` is absent; no `mkdir`. A
- verdicts job marks itself on the sidecar (`job {jobId, pid, host, since}`, cleared at its end); `planArticleDelete`
- refuses while the mark names a live process on this host.
-- **The `code` route (4).** MCP `generate` refuses a verdicts job routed to `code` with no model ("a session never proposes
- or rules claims' verdicts itself"); its `@@report-draft` verdicts marker (iteration 0) is rendered with the counts and
- the operator's review; `.claude/commands/gen.md` step 4 says verdicts are never a session's.
-- **Resume (5):** a changed `--limit` is refused. **Hash (6):** `benchItemsHash` includes the claim's text and its quotes'
- spans (context lines still out). **Unreadable sidecar (7):** shown on the article tab (`data-proposals-error`) and as the
- Inbox's `unreadable-proposals` (Blocking, "Repair verdicts.proposed.json").
-- **The window (the open question, ruled):** `settings.generation.verdicts.window {mode: seconds | turn, seconds}`
- (default the bench's: seconds, 60; SETTINGS.md) is what proposals read. umtool's bar form saves the run's window with
- the bar ("proposals read ±60 s (this run's window)"); a save without one keeps the set window.
-
-| Commit | What |
-| --- | --- |
-| `58270685` | common, editor, mcp: the fingerprint, the compare-and-set, no orphans + the delete refusal, the MCP/`code` route, the limit, the hash, the window setting; tests; SETTINGS.md, COMMANDS.md, settings.json.example, gen.md |
-| `a6c42610` | umtool: the panel (verdict/at, refusal, stale, error), `unreadable-proposals`, the bar's window; both specs |
-| `309c2fbe` | umtool: the window line as one string |
-| (this commit) | this record, FACTS, CHANGELOG, umtool docs |
-
-Gates (at `309c2fbe`): repo-wide tsc clean at each commit; common **4205/4205** (+3: the shift, the compare-and-set, no
-orphans and the delete refusal; the settings window; the bench limit and hash); editor unit 306/306 (`_verdicts.test.ts`:
-the compare-and-set body, the window from settings in the log); mcp **371/371** (+1: the `code` route refused, the
-verdicts marker rendered); test:scripts 1016 tests, 1013 pass, 3 skipped, 0 fail (+1 `unreadable-proposals`); umtool
-33/33; docs cli/files/env and settings example checks clean; umtool e2e `verdict-proposed.spec` + `verdict-bench.spec`:
-run 1 4 passed, 1 failed (the bar's window line rendered without its space — `309c2fbe`), run 2 `verdict-bench.spec`
-**4/4**; `verdict-proposed.spec` **1/1** in run 1 (the stale proposal counted, the rewrite between view and click
-refused, then rejected on reload).
-
-### E1/E2 review fixes (2026-10-15, lane A, `r29/evidence`)
-
-The read-only review of E1/E2 (`$T/r29ra-review.md`) found eight defects; each fixed as the orchestrator ruled:
-1. **Compose decides "gone" on prepare's word only.** A moment with no media is accepted as words only when this
- host's index lists it as a `source-gone` warning (prepare gives one after its reachability check, with no media to
- cut; the warning now names the state), the source is still gone, and no media is on disk since (a window or a
- capture fetched after prepare). No index, another host's, or a moment prepare failed for (unreachable, cut-failed,
- too-big) stays `missing-media`.
-2. **Bluesky looks each post up under its own author.** capturePosts hands each id's archived author to the capture
- (`archived.author`); each author's DID is resolved once and getPosts asked under it; an absence is `deleted` only
- from a batch asked under the post's own author (an unknown or unresolved author: nothing learned). A 1–2 s gap
- before every AppView request after the first (`apiGapMs`). The deleted-post sweep (`checkAvailability`) leaves
- another account's posts (reposts) as they were (`PostAvailabilityInput.authors`).
-3. **Wayback counts only when it holds the video.** The installed yt-dlp's YoutubeWebArchive extractor
- (`yt_dlp/extractor/archiveorg.py` `_real_extract`) asks `web.archive.org/__wb/videoinfo?vtype=youtube&vid=<id>`
- and stops when it has no formats; find-copy asks the same (`WaybackClient.youtubeVideoArchived`), and the copy's URL
- is the form the extractor takes (`waybackYoutubeUrl`). A copy whose fetch failed is recorded by fetch-windows beside
- the recording (`data/<id>/copy-attempts.json`, `lib/copyAttempts-server.ts`; not on a rate limit or a cancel), and
- the next find-copy falls through: Wayback → archive.org → the next mirror.
-4. **A mirror must be OF the upload.** Its identifier, a file's name or its `originalurl`/`source` names the id (a
- title or description is not enough — a compilation does that); its file's length agrees with the record's
- `duration` (± 5 s or 2 %; a file with no length is not taken when the duration is known); only a record whose page
- is a YouTube URL is looked for (`youtubeIdOf` reads YouTube hosts only; no fallback to the record's own id).
-5. **The Bluesky shot is the post's own item**: the one linking to `/post/<rkey>`, else the one holding an element
- whose whole text is the post's, else the only item by the author; two matches are an error, never a wrong shot.
-6. **The fetch-windows door** names the availability re-check (Diagnostics → Check availability) and takes an item's
- `"force": true` (documented in the ops help).
-7. **find-copy is a job** (`find-copy` kind, its own queue; its log ends with `@@find-copy {…, fetchJobId?}`); a
- cancelled run starts no fetch.
-8. **Members-only** is "unfetchable: members-only" in `missingEvidenceWindows` unless the channel has cookies to send
- (`authRetryCookies` of its cookie policy: then a window to fetch); compose never reads it as gone.
-
-| Commit | What |
-| --- | --- |
-| `4939d74e` | compose: gone only on prepare's `source-gone` warning (1) |
-| `478938ee` | Bluesky: each post under its own author, the API gap, the sweep's reposts; the self-thread shot (2, 5) |
-| `739c6b87` | find-copy: the Wayback video check, the mirror match and length, YouTube pages only, failed copies (3, 4) |
-| `a224715e` | find-copy as a job; the door's re-check and `force`; members-only (6, 7, 8) |
-| `40979b5e` | the find-copy result marker out of the "use server" file (the e2e build refused it) |
-| (this commit) | this paragraph, FACTS, CHANGELOG |
-
-Gates: tsc clean at every commit; common 4218 → 4226/4226; editor 308/308; mcp 370/370; `test:scripts` 1010 + 3
-skipped; export 117/117; homepage 25/25; `docs env|files|cli --check`, `settings example --check` clean; editor e2e
-`capture-posts.spec.ts` 1/1 (43 s; its start-mode build 178 s, through the heavy slot). New tests: a repost looked up
-under its author and the sweep leaving it; a self-thread page in a real Chromium (a short reply under parents holding
-its words, the own-link rule, two twins → error); compose refusing gone-on-disk without prepare's warning and another
-host's warning; the Wayback order and its fall-through; a compilation mentioning the id rejected; a length mismatch;
-a Rumble record not looked for; a failed copy recorded and not on a 429; members-only with and without cookies; the
-door's `force`.
-
-### Live fix: a copy's format selector (2026-10-15, lane A, `r29/fix-copy` from `main` `840d126c`)
-
-Found live: find-copy for the article `deleted` found an archive.org mirror (an original `.webm`) and its
-fetch-windows job failed — yt-dlp's generic extractor answered "Requested format is not available", because
-`clipFormatSelector` has only height- and codec-filtered rungs and a direct file's one format has no known height —
-and fetch-windows then recorded the mirror as a failed copy. Fixed:
-- A window whose item carries `copy` is fetched with `copyClipFormatSelector(maxHeight)`
- (`common/ytdlp/downloadFormat.ts`): the clip rungs, then `bv*[height<=?N]+ba`, `b[ext=mp4][height<=?N]`,
- `b[height<=?N]`, then `b`. The output is still `-o <window>.part.mp4` with `--force-keyframes-at-cuts`, so ffmpeg
- writes the cut as an mp4 (a stray `.<ext>` is still adopted as before); no recode was added, because prepare
- re-encodes every clip to H.264 (`lib/evidenceClip-server.ts`). A platform window keeps the strict selector.
-- A failed copy is recorded only for a source-side failure (`isSourceSideCopyFailure`, `lib/copyAttempts-server.ts`:
- `per_video` or `network` class, or 404/410/403, "not archived or indexed", "Unable to download webpage", an
- unresolvable or refusing host). Our selector ("Requested format is not available"), ffmpeg, the disk or an
- unplaceable error is never held against the copy.
-- `find-copy {…, "retryFailed": true}` tries copies recorded as failed again (still listed as `failedBefore`) — for
- the live `deleted` article, whose mirror is now in `copy-attempts.json` from the selector failure; that file was
- not edited by hand.
-
-| Commit | What |
-| --- | --- |
-| `9f2fb949` | the lenient copy selector, source-side-only failed copies, `retryFailed`; tests (a fake generic single-format source of unknown height: refused by the clip selector, fetched by the copy's; the classifier; a selector failure not recorded; retryFailed); ops help, COMMANDS.md |
-| (this commit) | this paragraph |
-
-Gates: tsc clean; common 4253/4253, editor 310/310, mcp 372/372, `test:scripts` 1021 + 3 skipped, export 117/117,
-homepage 25/25; `docs env|files|cli --check`, `settings example --check` clean; editor capped build ok (95 s,
-through the heavy slot). No e2e spec touched. Not proven offline: what yt-dlp writes for a real archive.org `.webm`
-under `--download-sections` (an mp4 at the `-o` name, or a stray adopted and renamed); the re-run of `deleted` with
-`retryFailed` is the check.
-
-### Gate round (2026-10-15, orchestrator)
-
-On `r29/integration` `b9e91de6` (every lane and every review fix merged), one step at a time behind a 6 GB memory floor
-(the machine was shared with transcription and the operator's own work; two earlier attempts were stopped for memory):
-
-- `pnpm install --frozen-lockfile` ok; tsc clean; `docs cli|files|env --check`, `settings example --check` clean.
-- Unit: common 4251/4251, editor 310/310, mcp 372/372, `test:scripts` 1021 + 3 skipped, umtool 33/33, export 117/117,
- homepage 25/25.
-- Capped builds: editor 115 s, umtool 55 s (corpus linked, then unlinked), export 52 s, homepage `build:nodata` 87 s.
-- `pnpm e2e:all` (56 min): homepage 110/0, export 276/0, export-hub 39/0, export-2origin 3/0, export-report 47/0;
- umtool 541 passed, 4 failed, 8 skipped; editor 705 passed, 1 failed, 12 skipped. The reds:
- - umtool `create.spec:61` and `settings.spec:50` asserted the policy summary without M8's `verdicts` route (local in
- the balanced preset) — the expectation updated (`cf0372a3`);
- - umtool `learned-spellings.spec:119` and `triage.spec:194` (an ECONNRESET) — load; all four green alone (30/30);
- - editor `incomplete-transcript.spec:83` — "Page crashed" under memory pressure; green alone (6/6) after re-linking
- the fixture's `export/public` (the export lanes had replaced it).
-- Privacy counts on `main..HEAD` (46 commits): session trailers 0, session links 0, key-like 0, config paths 0, home
- paths 0; one added line names Candace — this plan's own rule line, as release 28's plan already carries.
-
-## Not in this release
-
-Auto-posting to X/Bluesky/YouTube (text only); any umtool restructuring; the "en track → 0 cues" bug (closed in r20).
diff --git a/plans/release-30.md b/plans/release-30.md
@@ -1,31 +0,0 @@
-# Release 30 — corrupt-source recovery, the frame scan, verdict bench v3
-
-Lanes run after release 29 shipped (2026-10-15), each from a brief; the per-lane records are in `plans/release-30/`.
-
-| Lane | Branch | Record | State |
-|---|---|---|---|
-| Q — corrupt-source recovery | `r30/corrupt-recovery` | [q.md](release-30/q.md) | merged `8a4db248`, live |
-| P — the frame scan | `r30/frame-scan` | [frame-scan.md](release-30/frame-scan.md) | merged `37840679`, live |
-| P2 — the frame scan's derivation | `r30/frame-derive` | [frame-derive.md](release-30/frame-derive.md) | merged `6810cdff`; editor restart owed |
-| V — verdict bench v3 | `r30/bench-v3` | on its branch (`plans/release-30/V.md`) | held: the operator's ruling on the verdict meanings and the dedupe default |
-
-Also on `main`: the adaptive pace eases back to its base (`1c45e494`); `out-private` skipped like `out`
-(`b9f7ee6f`); ttsServer's start test waits on the stop (`14d09aa2`).
-
-## Gates
-
-On `main` `6810cdff`: tsc clean; common 4362, editor 319, mcp 373, export 117, scripts 1030 (+3 skipped); docs files,
-env, cli and settings example checks clean. e2e: `audio-check-scenarios.spec` 16/16 and `frame-scan.spec` 1/1 on the
-lane branches; `verdict-bench.spec` 4/4 on `r30/bench-v3`. Owed: `frame-scan.spec` on `main` after P2.
-
-## Live
-
-- Q: cornbreadman's corrupt full sources retried through the refetch path; one came back clean, the rest stay
- malformed at the source and go to salvage transcription.
-- P: `the-quartering-rumble/v7gkv5w` scanned whole on `claude-haiku-4-5` ($4.06, 1,139 readings, 0 failed);
- re-derived with P2 (1 tournament, 18 events); supercut draft `v7gkv5w-poker` (3 clips).
-
-## Owed
-
-Editor rebuild and restart on P2; umtool rebuild (P's `frames-cut`); V's merge after the ruling and its qwen runs;
-the overlay render (`frameScan.overlay` is data only); OCR of the client's fixed boxes.
diff --git a/plans/release-30/V.md b/plans/release-30/V.md
@@ -1,94 +0,0 @@
-# Release 30 lane V — the verdict bench, v3
-
-### V, as shipped (2026-10-15, lane V, `r30/bench-v3` from `main` `59fdc486`)
-
-The diagnosis of bench v2's disagreements, and the fixes it called for. No real model call was made: the qwen
-runs are the orchestrator's (the transcription lane and the memory floor held the GPU the whole session). The
-commands are at the end of this section.
-
-**The diagnosis** (opus on prompt 2, `vb-r29-api`: 71 of 146 answered items disagree with the operator; read
-locally, recorded as counts only):
-
-| Category | Disagreements | What it is |
-| --- | --- | --- |
-| compound claim, partly shown | 22 | the claim joins several things; some are shown, one is not found (or a quoted phrase, a count or a date is not the speaker's) — the operator rules PARTLY; v2's meaning ("a part only not shown does not make PARTLY") sent the model to CORROBORATED (18) or NOT_FOUND (4) |
-| evidence the model never saw | 14 | the ruling rests on the claim's cited posts or pages; v2 items carried transcript windows only |
-| framing | 14 | the operator rules the substance hers (paraphrase, softer wording); the model demotes for framing (PARTLY 10, CONTRADICTED 4) |
-| corpus-wide claim | 11 | how often, "never", "constantly", "didn't come up in the episode": the operator ruled from a corpus search no window shows |
-| ruling needs outside context | 6 | a fact about the world beside what was said ("she gets it wrong: X"), a claim phrased as a prediction, a feud the window only half shows |
-| model error | 4 | a verdict against the model's own reason, or a misread |
-| window miss | 0 | every cited quote is inside its ±60 s window (147 of 147, token overlap ≥ 0.6) |
-
-qwen on prompt 1 (`vb-r28`, 79 disagreements): the same categories where they overlap (evidence 14, framing 12,
-corpus-wide 8, outside context 4, compound 4, model error 1) plus 36 of its own — 25 CORROBORATED claims demoted to
-PARTLY for an unshown detail (prompt 1's meanings), 6 misreads, 5 others.
-
-Two item facts beside it: the 147 items are **74 distinct claims**, each twice (the second fact-check is a re-cut of
-the first, its 73 repeats ruled identically), and the re-cut's **section headings name the verdict** — the answer,
-shown to the model as context since V1.
-
-**What changed:**
-
-- **Evidence** (`items.ts`): a claim's post and page citations are its `evidence` — quoted, with label, speaker and
- date (never a page's note), at most `EVIDENCE_MAX` 8, each quote cut at 600 characters — and the prompt quotes them
- under "Cited posts and pages". 23 of the 74 claims carry some.
-- **Withheld heading**: `sectionNamesVerdict` drops a section heading that names a verdict.
-- **Dedupe**: `benchItemsOf` skips a claim that repeats an earlier item (same text, same cited spans), "the same claim
- as <key>" (`dedupe`, default on). The registry now gives 74 items (39 CORROBORATED, 29 PARTLY, 3 NOT_FOUND, 2
- CONTRADICTED, 1 UNTESTABLE; the always-CORROBORATED baseline 52.7 %), hash `1aaf154834f0d807`, at half the cost of
- a paid run.
-- **Prompt v3** (`prompt.ts`, `PROMPT_VERSION` "3"): the model splits the claim into its parts (at most 6) and gives
- each a finding — shown, shown wrong, not shown — plus `checkable`; the verdict follows in code (`verdictOfParts`), and
- `readVerdictAnswer` holds the counts and lengths (Q0: rules, no examples, counts in code; the local prompt's largest
- estimate over the 74 items is 7,214 tokens, none trimmed).
-- **The meanings** (`verdicts.mjs`) are rewritten in parts terms to match the 147 rulings, and `VERDICT_PARTS_RULE`
- replaces `VERDICT_TIE_RULE` (REPORT.md regenerated). **Ruling owed:** this reverses V1's "a part only not shown
- does not make PARTLY"; the rulings bear the reversal out (22 disagreements), and the operator confirms it.
-- **M8** (`tasks/verdicts.ts`) reads its answer through `readVerdictAnswer`, so proposals use the same rule.
-- **umtool `/tools/bench`**: under each claim "what the model saw" (its windows' lines, its posts and pages), under
- each answer the model's parts.
-- **Not done:** a "look wider" second pass before a NOT_FOUND stands (the diagnosis found no window misses), the
- `turn` window as the default (same reason), and post-only claims as items (9 ruled claims cite no span; left as
- before).
-
-**The second attempt.** Q0's "keep the better of two attempts" is set up, not yet decided: attempt A is the shipped
-v3 (parts, the verdict in code); attempt B ("3a", not committed) is the same items and meanings with a holistic
-`{reason, verdict}` answer, kept as a snapshot in the scratch dir. Whichever qwen scores higher stays.
-
-| Commit | What |
-| --- | --- |
-| `6fe0d13b` | common, umtool: evidence, the withheld heading, dedupe, prompt v3 with the verdict in code, the meanings, M8's reader, the bench page; tests; REPORT.md |
-| `ec5b8726` | this record, FACTS, CHANGELOG |
-| (this commit) | umtool e2e: the V1 test reads v3's meanings; the record's e2e gate |
-
-Gates (branch start in brackets):
-
-| Gate | Result |
-| --- | --- |
-| tsc | common and umtool package tsc clean at `6fe0d13b`; repo-wide `tsc --noEmit` clean at this commit |
-| common `pnpm --filter yt-dlp-transcript-common test` | **4255/4255** [4253] (+2 in `bench.test.ts`: the verdict from the parts and the counts; evidence, the withheld heading, dedupe and the hash) |
-| `pnpm --filter umtool test` | 33/33 [33] |
-| `archilyzer docs files --check` | clean after regenerating REPORT.md |
-| umtool e2e `verdict-bench.spec.ts` (foreground, queued) | run 1: 3 passed, 1 failed (the V1 test still asserted V1's CORROBORATED meaning — the expectation updated to v3's meanings and the parts rule); run 2: **4 passed**, 0 failed, 17.4 s. The spec gains the what-the-model-saw and parts assertions |
-| qwen runs | **not run**: the transcription lane and the memory floor; commands below |
-
-**The runs** (the orchestrator's; each behind the heavy lock, ≥ 7000 MB available, the transcription lane idle):
-
-- q2, prompt-2 baseline, through the live editor (from the primary):
- `pnpm ops bench-verdicts --json '{"models":["qwen3:8b"],"itemsFrom":"vb-r28","run":"vb-r30-q2"}' --wait`
-- q3, v3 (from `~/Projects/r30-bench-v3/common`): `pnpm exec tsx $T/r30v-run.mts vb-r30-q3`
-- q4, v3 attempt B: `R30V_COMMON=$T/r30v-snap-q4/common pnpm exec tsx $T/r30v-run.mts vb-r30-q4`
-- score on the shared claims, with the diagnosis categories: `pnpm exec tsx $T/r30v-score.mts vb-r28:qwen3:8b vb-r30-q2 vb-r30-q3 vb-r30-q4`
-
-**Proposed paid run** (after the better qwen attempt): sonnet + opus on v3's 74 items, `maxUsd` 3 (v2's 147-item
-run spent $4.99; half the items, plus the evidence and the parts' output). Expected: the 14 evidence and 22
-compound-claim disagreements are where opus's 51.4 % was lost; recovering two thirds of them would put opus near
-65–70 % against the 52.7 % baseline.
-
-## Ruling (operator, 2026-10-17) — release 32 R8
-
-- **(a) only.** The meanings reversal is kept: a claim with a part the evidence does not show is PARTLY (REPORT.md's
- definitions as regenerated here).
-- **Dedupe is not the default.** A fresh bench asks every claim; dedupe is an explicit option (`--dedupe`, the
- `bench-verdicts` body's `dedupe: true`). Merged into `r32/rulings` and changed there (`plans/release-32/rulings.md`).
-- **No paid run.**
diff --git a/plans/release-30/frame-derive.md b/plans/release-30/frame-derive.md
@@ -1,64 +0,0 @@
-# Release 30, lane P follow-up: the frame derivation (`r30/frame-derive`)
-
-The first live scan (`v7gkv5w`, 1,139 readings, $4.06 on Haiku 4.5) read well and derived badly: 26 tournaments
-where there is one, false double-ups from mid-hand dips, a final table from a table's seat count, stacks of 730 BB
-from a misread big blind, six "won" banners on other players' hands. The readings were kept; only the derivation
-changed, and a re-derive brings the sidecar up to date with no model call.
-
-### D1–D6, as shipped (2026-10-15, lane P, `r30/frame-derive` from `main` `14d09aa2`)
-
-- **D1 One tournament unless the hero is out.** A name read is no longer evidence of a tournament: the model put hand
- descriptions, seat names and title misreads in the field. A tournament changes only after a CONFIRMED bust (a stack
- of 0 held on the reading beside it, a bust/eliminated banner on it or beside it, or the hero's "has finished the
- tournament" line within a minute), a screen away from the table, and chips in front of the hero again. Its name is
- `canonicalTitle` of its title-like names (`looksLikeTitle`: not a hand description, not a name the log shows as a
- player — `speakersOf` — not the hero, at 75% letter similarity), clustered (case and punctuation, one name's words the
- start of the other's, or 75% alike) and named by the biggest cluster's most frequent spelling when it is read at
- least 3 times (or is the only one). The old field-size split (totalPlayers changing by 1.5×) is gone (misreads).
- A Day/structure change in the header is not a trigger: Day 1B → Day 2 is one tournament, and the header's "Day" was
- misread ("Day 18's").
-- **D2 Dips are not events.** `dropExcursions` (`series.ts`): a run of stack readings that leaves a level and comes back
- to it (within 1.1×) inside 90 s of the last reading before it is set aside (a stack read mid-hand: chips in the pot
- are not in front of the player; a misread), before `dropMisreads`. A double-up or big loss needs its new level held
- by the next reading (within 1.25×).
-- **D3 Players left from the header only.** A reading's players left counts only with a position beside it, the
- position within it, and not a table's seats (≤ 10 of ≤ 10); else the log's finishing places. Players left never rise:
- a reading followed within ten minutes by one 1.5× and 3 larger is a misread. A spoken number with no agreeing frame
- point in its 90-s window flags every one of them, and a flagged point makes no event; a gap is filled by a spoken
- number only when it fits a reading either side (within 2×), else it is flagged. The final table needs a field of more
- than 9 read EARLIER in the tournament.
-- **D4 The log's blinds.** "Blinds are now a/b" is the big blind from the line on, carried until the next; a read
- that disagrees with it by more than 2× is a misread (recorded). Before the log says any, reads only go up and never
- above the first the log will say. Stack in big blinds is the kept stack over the big blind of its moment (or the
- client's own figure).
-- **D5 The model's banners.** `won` is not an event (the model said it for other players' pots; a hand the hero takes
- is the log's `pot`/`big-pot`; the tournament won is the players-left series reaching one); `bust`/`eliminated` stand
- only with no table frame showing the hero's chips in the next two minutes; `final-table` only beside a header of 9 or
- fewer.
-- **D6 Re-derive.** `rederiveRecord(record, {cues?, hero?})` and `deriveOf` (`lib/frames/scan.ts`): `derived` (and,
- with cues, `spoken`) from the stored readings and duplicates, no model, no frame; readings, runs and spend kept,
- `rederivedAt` set. `pnpm ops frame-scan --json '{"slug","id","rederive":true}'` (no job; refused while a scan of the
- video is queued or running; answers `{rederived: {before, after, tournaments, eventsByKind}}`) and
- `archilyzer frames rederive <slug>/<id> [--profile] [--hero] [--dry] [--json]` (offline: cannot see the editor's
- jobs).
-- **Measured on the live sidecar, in memory (nothing of it committed; a scratch copy for the CLI):** tournaments 26 →
- 1 ("VENOM", 130–13,500 s); events 35 → 18 (big-pot 2, pot 11, buy-in 3, bust 1 at 13,480 "out from 66,429",
- eliminated 1 at 13,500; no double-up, big loss, final table or won); flags 1 → 6 (85 said vs 65 read at 5:40; 15
- said at 53:38 against a field of 67, the other tournament; a stack, two places and a stack in BB said that disagree);
- big blind 625 → 1,250 → 1,600 read, then the log's 1,800 … 5,500; players left 65, 67, then 115 … 86 from the header.
- Left: the header's 65/67 at the start are probably misreads of 85 (flagged); the tournament's `buyIn` fact takes the
- first said ($5, the viewer tournament's).
-
-| Commit | What |
-| --- | --- |
-| `2c98d31e` | common, editor, scripts: the derivation rebuilt (D1–D5), re-derive (D6) on ops and the CLI, the fixtures and tests, COMMANDS.md |
-| (this commit) | plans, CHANGELOG, FACTS: this record |
-
-Gates (from the worktree root; every tsc and suite under the shared heavy2 lock; no build or e2e — the user bus was down):
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean.
-- common 4362/4362 (lib/frames 72/72: `pokerDerive.test.ts` 12 on `testing/frames/pokerReadings.mjs`, the derivation's
- old tests moved to the new rules, `dropExcursions`); editor unit 319/319 (`_frameScan.test.ts` 7/7 with re-derive);
- test:scripts 1033 (1030 + 3 skipped); umtool 33/33; mcp 373/373.
-- `docs cli` regenerated; `docs cli --check`, `docs files --check`, `docs env --check`, `settings example --check` clean.
-- Not run: the editor e2e and builds (bus down). The panel and supercut code are unchanged; the one `frameScanActions`
- line is a type narrowing.
diff --git a/plans/release-30/frame-scan.md b/plans/release-30/frame-scan.md
@@ -1,102 +0,0 @@
-# Release 30, lane P: the frame scan (`r30/frame-scan`)
-
-The operator's ask (2026-10-15): scan a stream on the Jeralyzer, break it into frames and analyse them for a poker
-tournament's progress, toward a supercut with a stats overlay. First stream: `the-quartering-rumble/v7gkv5w`
-(3:45:54, 1920×1080, the saved container `original`).
-
-### P1–P4, as shipped (2026-10-15, lane P, `r30/frame-scan` from `main` `59fdc486`)
-
-Built as the brief's design (generic engine, poker as its first profile), with these as built:
-
-- **Sampling** (`common/lib/frames/sample-server.ts`): one ffmpeg per half hour of stream, keyframes only
- (`-skip_frame nokey`, `-ss` before `-i`), `fps=1/N` then an optional CROP (fractions `[x, y, w, h]`: the part read and
- hashed — the poker client, not the webcam beside it), then split into a JPEG at the profile's width (poker 1280) and a
- 17×16 grey thumbnail on stdout for the dHash. `t` is the grid time in SOURCE seconds. The cache is resumable by grid
- time (`index.json`, keyed by step, width, decode mode and crop). Measured on `v7gkv5w` (no model): the whole stream,
- 1,355 frames at 10 s with the crop, in 268 s from the media drive.
-- **Duplicates** (`dhash.ts`): a frame within `dupMaxBits` (poker 2) of the last READ frame is not asked, re-read every
- `rereadEvery` (6); the derivation reads duplicates as copies. On `v7gkv5w` with the crop: 1,139 of 1,355 kept (0
- bits: 1,290; 4: 1,039; 6: 929). Without the crop the webcam makes nearly every frame differ.
-- **Reading** (`scan.ts`, `structuredAnswer` with images): up to 4 frames an ask on the API, 1 on a local model; each
- reading coerced in code (`coercePokerReading`: enums, ranges, card format, misread pairs dropped, the log's lines kept
- as written). Prompt version 2 (calibrated on the first stream's frames, read locally): the stats header ("position N
- of M", average stack), the dealer log copied line by line, the hero's bounty, the break countdown, an action label in
- a name box. Rules only, no worked example (Q0). Capped: the run stops before an ask whose estimate (image tokens from
- the JPEG's size, the price table) would pass `maxUsd`; three failed asks in a row stop it; a cancelled or cut run keeps
- what it read (the sidecar is written every 5 asks).
-- **Spoken numbers** (`numberWords.ts`, `pokerSpoken.ts`): the transcript's numbers normalized to digits (words,
- "$2,750", "311 K", "233k", ordinals after a tens word), then rules: players left, the field, average stack, the
- hero's stack (scaled ×1000 beside an average said in thousands within half an hour, marked `approx`) and big blinds,
- the hero's place, buy-in (and the ASR's "buying is"), first prize, prize pool, the blind level said as poker says it
- (never a bare "level N": the streamer games), blinds. A stack, big-blind count or place said as a supposition ("once
- I'm down to…", "it's not like I'm sitting on…") is left out. On `v7gkv5w`'s 1,672 cues: 30 readings, every one checked
- by eye against its cue (scratch only, nothing committed).
-- **Derivation** (`poker.ts` `derivePoker`, pure): tournaments keyed by the name on screen (unnamed readings take the
- name before; a field-size change over 1.5×, or chips again after the hero was out and away from the table, is another
- tournament); series per tournament (stack, stack in BB — shown, else stack over the big blind, the blinds carried
- until they change — players left, level, position, average stack, big blind), a point both neighbours agree against
- set aside as a misread (an end point only when it disagrees by the square of the ratio; a last 0 is kept); events
- judged on every kept point, a change needing the reading after it (double-up ×1.8, big loss ½, bust, final table, won),
- the frame's own banners once a minute, and the log's: the hero's pots (`big-pot` at 25 BB or more), a knockout, a bust
- ("<hero> has finished the tournament in Nth"); "Blinds are now a/b" and "<name> has finished the tournament in Nth"
- fill blinds and players left a frame did not show. A spoken number within 90 s of a frame value of its field agrees
- or is a FLAG; with none it fills the series (`[t, v, "spoken"]`) and never makes an event.
-- **The job** (`controller/frameScan.ts`, kind `frame-scan`, `needsMedia`): queue `frames` on the API, `draft:local` on
- a local model (GPU arbiter, unloaded after); the model is the body's, else `settings.generation.routes.frames`
- (`code` = name one) and `settings.generation.frames {apiModel: claude-haiku-4-5, localModel: qwen2.5vl:7b, maxUsd 5,
- everySeconds 10}`; refused with no saved video (the sentence is the `persist-videos` body), past `caps.daily`, or with
- `maxUsd` over `caps.max`; spend to the usage ledger (`task: "frame-scan"`); `@@frame-scan {…}` ends the log. Body:
- `{slug, id, profile?, everySeconds?, from?, to?, maxFrames?, model?, maxUsd?, hero?, framesPerAsk?, crop?, fresh?,
- evict?}`; `hero` and `crop` are kept with the sidecar for the next run; `fresh` reads every frame again (another model)
- keeping the runs and the spend; `evict` removes the cache, no job.
-- **Surfaces**: `pnpm ops frame-scan` / `POST /api/ops/frame-scan`; the video page's **Frame scan** panel (phase strip,
- a stack and players-left chart per tournament, events linked to the moment on the platform — Rumble `?start=`, YouTube
- `t=`, Twitch `t=XhYmZs` — the flags, the summary; the hero's small pots counted, not listed) and **Scan frames** when
- the video is saved; the jobs list's `frames` progress. Not a registry operation: those are corpus-wide lanes.
-- **umtool** (`report-to-video/frames-cut.mjs`, ledger-totals' pattern, and `umtool new <slug> --from <channel>/<id>
- --seed frames`): a clip around each event (bust, final table, knockout, double-up, big pot, big loss, all-in, won;
- windows widened to the cues' sentence edges within widen's budgets, merged when they touch, at most 20), its
- on-screen subtitle the running stats (code's draft, `drafted.onscreen` `model: "code"`), and the manifest's
- `frameScan.overlay` (the stats at each clip's start and every change inside it). No render reads `frameScan` yet.
-- **The test kit**: the fake Anthropic takes and checks image blocks (and counts them at (w·h)/750), the fake ollama a
- message's `images` (1,200 tokens each against the cap); `testing/frames/syntheticPoker.mjs` paints a fake client with
- ffmpeg (`color` + `drawtext`) into a 210-s stream, with `pokerTruthAt(t)` and `SPOKEN_CUES`.
-- **OCR** (the brief's option (b)): not added. `tesseract` is not installed and no OCR package is in the tree.
- `tesseract.js` would be a dependency (the JS, a 4–7 MB wasm core) plus a language file (`eng` fast ≈ 4 MB, best ≈ 15
- MB) that it downloads from a CDN at first use unless vendored, run in worker threads at roughly 0.1–0.3 s a small
- region; no system dependency. The first stream's layout is fixed (the hero's stack box, the pot, the 4-line dealer
- log, the header), so a digits-only reader of those boxes is viable as a second reader beside the model — the next
- step once a live run shows where the model misreads.
-
-| Commit | What |
-| --- | --- |
-| `ba992f00` | common, mcp: the engine — sampling, dHash, the poker profile, spoken numbers, derivation, images in `structuredAnswer`, `settings.generation.frames` and the `frames` route, the job kind and controller, the sidecar, the fakes' images, the synthetic stream |
-| `77f9720c` | editor, scripts: `pnpm ops frame-scan`, the video page's Frame scan panel and Scan button, COMMANDS.md |
-| `77127aaa` | umtool: `frames-cut.mjs`, `umtool new … --seed frames` |
-| `e8449230` | umtool, plans: the draft's on-screen text is code's; FACTS; CHANGELOG |
-| `1f2b1a0c` | common: the spoken numbers calibrated on the first stream's transcript |
-| `ab82ee65` | common, editor, umtool, mcp, scripts: calibrated on the first stream's frames — the crop, prompt version 2 (header, log, bounty, break countdown), the log's pots, knockouts, busts, blinds and finishing places, generations after a bust, the position and average-stack series, carried blinds, `fresh`, a kept `hero` and `crop`; the mcp preset test names `frames` |
-| (this commit) | editor: the e2e spec's button locators (a StreamActionLog button is named by its text); this record; CHANGELOG |
-
-Gates (from the worktree root; every tsc and suite under the shared heavy lock):
-- tsc: common, editor, mcp, umtool, export, homepage clean (package-scoped through the slice; the recursive run before
- the last commit — see the report).
-- common: 4253 at the branch's start (1 failing that run, not reproduced) → 4310 at `1f2b1a0c`, all pass; lib/frames
- 59/59 at `ab82ee65` (the synthetic stream end to end on both fakes, the cap, resume, `fresh`, the crop).
-- editor unit: 310 → 318 at `1f2b1a0c`, all pass; `_frameScan.test.ts` 6/6 and `frameScanView.test.ts` 2/2 at the tip.
-- test:scripts: 1024 (1021 + 3 skipped) → 1029 (1026 + 3 skipped) at `1f2b1a0c`; `frames-cut.test.mjs` 5/5 at the tip.
-- umtool unit: 33 → 33. mcp: 372 with 1 failing at `1f2b1a0c` (the preset test did not name `frames`) → fixed in
- `ab82ee65` (`generation.test.ts` 16/16).
-- `docs cli` and `settings example` regenerated; `docs files --check`, `docs env --check` clean.
-- editor e2e, one spec: `frame-scan.spec.ts` 1/1 (5.0 s; the e2e build 482 s) — the synthetic stream saved, **Scan
- frames**, the job against the fake Anthropic, then the panel: 21 frames, the break segment, double-up and bust with the
- Rumble `?start=90` link, the tournament's chart, the spoken/frame flag. (The first run, 1 failed: the spec named the
- button by the log's label.)
-- Measured without a model on `v7gkv5w`: the whole stream sampled in 268 s; 1,139 of 1,355 frames kept with the crop.
-
-Found and left:
-- The sampler runs `ffmpeg`/`ffprobe` from PATH, not `paths.ffmpegBin` (`FFMPEG_BIN`): the editor e2e server points
- `FFMPEG_BIN` at a fake that makes no frames, and the scan needs real ones. A later slice may give the scan its own
- override.
-- `frameScan.overlay` is data only: no chrome region draws it.
-- OCR of the client's fixed boxes (above) and a per-channel crop/hero setting are next steps.
diff --git a/plans/release-30/q.md b/plans/release-30/q.md
@@ -1,125 +0,0 @@
-# Release 30, lane Q — corrupt-source recovery (as shipped)
-
-Branch `r30/corrupt-recovery` from `main` `59fdc486`. Brief: `r30q-brief.md` (the plan of record for this lane).
-FACTS: "Release 30 lane Q: corrupt-source recovery".
-
-## Q1, as shipped (2026-10-15): a retry of a corrupt full source refetches it
-
-The kept container made the corruptFullSource bucket's only control a no-op (the retry-bucket prefilter read it as
-"already complete"). Built:
-- **The retry asks again.** `retry-bucket` passes `refetchCorruptFullSource` to `destinationExists`
- (`common/ytdlp/runYtdlp.ts`): a video whose `download-outcome.json` is corrupt-full-source is never "complete" to
- the retry, whatever is on disk (the kept file, a salvage transcript). Only the retry: download-missing and sync still
- count the kept file, so no sweep re-fetches these.
-- **Every managed download of a corrupt-full-source video is a refetch** (`common/ytdlp/corruptRefetch.ts`, around
- `runManagedDownload` in `downloadOneManaged` — so retry-bucket, the video page's re-download and any batch that
- reaches the video all take it). `prepareCorruptRefetch` moves each real audio file aside as
- `<name>.corrupt-kept`, tier-aware (`renameMediaFile`, new in `lib/mediaTier-server.ts`: a tier link's bytes are
- renamed beside themselves in `media/<id>/` and the link re-pointed). `settleCorruptRefetch` decides by what the
- download ended as:
- - `ok*` with a fresh audio file: the aside file is removed (`removeMediaFile`);
- - `corrupt-full-source` again: whichever copy decodes longer stays (`scanDecodable`, one tolerant ffmpeg decode),
- the other removed; a tie keeps the new copy, both unmeasurable keeps the old;
- - anything else (a 429 at the prefetch — the live case — the network, a filter, a cancel, a short file): a fresh
- file is removed, the aside file renamed back, and the sidecar rewritten as the previous record (status
- corrupt-full-source) with the new attempts appended. **The caller still gets the download's own record** (status
- `failed`, its `failureClass`), so a batch backs the platform off as for any 429.
- - Each retry is a `CorruptRefetch` in the sidecar's new `corruptRefetches[]` (result, status, failureClass, error,
- kept, decoded seconds of each copy).
- - A run cut short leaves `.corrupt-kept`; the next `prepare` settles it first (restore; or the longer of two copies;
- or remove after a clean record; a non-ok record it finds is rewritten corrupt-full-source).
- - A kept file that cannot be moved aside fails that video's download (it is never downloaded over).
-- `*.corrupt-kept` and `audio.salvage.wav` are media-tier scratch (`lib/mediaTier.ts`): never tiered, never text.
-- **Surfaces.** `corruptFullSource` is a `ReplayBucket`; the channel's Download stage has a **Corrupt full sources**
- card with the bucket's Retry (`retry corrupt full sources bucket`); the channel flow's siding, the video list's dot
- title, the video page's outcome badge and the snapshot's comments say a retry downloads again (the "futile" sentence
- is gone). Ops help for `retry-bucket`; COMMANDS.md.
-- Test kit: `common/testing/audio/corruptAudio.mjs` — a synthetic AAC tone-burst recording, the same with a seeded run
- of bytes overwritten, a WAV reader and a burst-onset finder (README not touched — a later kit pass can list it).
-
-## Q2, as shipped (2026-10-15): salvage transcription
-
-A plain transcription of a corrupt file failed at the first bad window. Built:
-- **The decode** (`common/lib/salvageAudio-server.ts`): `-err_detect ignore_err -fflags +discardcorrupt`, 16 kHz mono;
- one ffmpeg run with two outputs — the framecrc of the unpadded decode (decoded seconds; a pts jump is a hole; the
- tail to the container's duration is one) and a WAV through `aresample=async=1:first_pts=0,apad=whole_dur=<duration>`
- (each hole silence of its own length). **The timestamp claim is verified**: over the synthetic damaged recording the
- bursts after the damage are at their source times in the salvage WAV (±50 ms) and absent inside the gap, while a
- plain decode (the control) puts every later burst early by the gap's length.
-- **The transcription** (`controller/transcribeOne.ts`): `salvage` on `transcribeOneVideo` / `transcribeWithWorker` —
- true forces, false forbids, absent = **automatic when the download outcome is corrupt-full-source** (my call: the
- file is known to be malformed and a plain run fails at the first bad window; nothing else transcribes such a video
- automatically, so this only changes an explicit Transcribe). The engine reads `audio.salvage.wav` in the video dir
- (removed in a `finally`; parakeet's window cache survives a pause). Recorded in `transcribe-outcome.json` as
- `salvaged: {source, decodedSeconds, totalSeconds, gaps}` — only when something is missing; a salvage of a file that
- decodes whole is a clean transcript.
-- **parakeet-stitch `--salvage`** (passed by the parakeet app on a salvage run; whisper.cpp and chough ignore it): a
- window whose slice or parakeet-cli run fails is a gap, not the end of the file; its neighbours own their whole reach
- on that side; the output gains `salvage.failedWindows`, which transcribeOne merges into the gaps; every window failing
- is still exit 1.
-- **Not a clean full transcript**: the snapshot's new `salvagedTranscript` bucket (still counted as transcribed; a
- corrupt full source stays in its own bucket — a retry can still bring a clean copy), a transcribe siding in the
- channel flow, and on the video page a status line ("Salvaged transcript — 38:55 of 1:40:00 of audio.mp4 decoded. No
- transcript for …") with the transcribe card's tone at attention. Not the `incompleteTranscript` bucket: its action
- is delete-and-re-download, which is the corrupt-full-source retry's job here.
-- **Ops**: `transcribe-one {…, "salvage": bool}` (checked a boolean at the door); help and COMMANDS.md.
-
-## Q3: the bucket stays honest
-
-A failed refetch keeps the corrupt-full-source status and its history (Q1's "anything else" path, pinned by the
-whole-path test: a fake yt-dlp answering the prefetch with a 429 leaves the sidecar corrupt-full-source with
-`["metadata-prefetch", "audio-checked-primary", "metadata-prefetch"]` and the kept file in place). The snapshot stays
-the single classifier: it reads the sidecar's status as before; the only addition is `salvagedTranscript`.
-
-## Follow-ups (2026-10-15, orchestrator's ruling and brief)
-
-- **A clean refetch retires a salvage transcript** (ruling: yes). In `settleCorruptRefetch`'s clean branch: when
- `transcribe-outcome.json` has `salvaged`, `transcript.json`, `transcript.cues.json` and `transcribe-outcome.json` go
- through `removeMediaFile` (the one remover of a video-dir entry — the editor's `clearIncompleteTranscriptOne` uses
- it too, but also takes the audio, which is the point here to keep); the clean `CorruptRefetch` records
- `retiredSalvage` (the salvage and its `transcribedAt`); the snapshot then has the video in `downloadedNoTranscript`
- (pinned through the real `generateChannelSnapshot`). A transcript that is not a salvage is left alone.
-- **Salvaged transcripts are marked downstream.** The index record gains `salvaged: {decodedSeconds, totalSeconds}`
- (`TranscriptSummary.salvaged`, a `SalvageMark`; omitted otherwise so every other page is byte-identical) from the
- sidecar, for whisper records only; the published transcript pages carry it (pinned through the real `buildIndex`).
- The export's video page (TranscriptModal) shows "Partial transcript: N of M min decoded" under its date line; MCP
- `get_transcript` adds a "⚠ PARTIAL TRANSCRIPT … do NOT conclude that something was never said" meta line (primary
- track only) and `get_video_metadata` carries the field and the same line. Not on `DisplaySummary`; no e2e (unit
- tests; the export suite at merge).
-
-| Commit | What |
-| --- | --- |
-| `fc0942e7` | Q1: corruptRefetch.ts, renameMediaFile, the retry prefilter, scanDecodable + the test kit, the replay bucket, the Retry card, the sentences; ops help, COMMANDS.md |
-| `72ef936b` | Q2: salvageDecode, transcribeOne salvage, parakeet-stitch --salvage, transcribe-outcome `salvaged`, the `salvagedTranscript` bucket, the video page's status; ops help, COMMANDS.md |
-| `1d327f32` | Q2: a salvage that finds nothing missing is a clean transcript |
-| `88e03d2f` | editor: the status is not a chore card (videoChoreCards); the e2e retry scenario; CHANGELOG |
-| `ebd2d95f` | this record, FACTS |
-| `74310acc` | the test kit README lists `testing/audio` |
-| `ff9c2c51` | a clean refetch retires a salvage transcript |
-| `b606cebe` | the record's `salvaged` mark: buildIndex, the export's status line, the MCP caveat |
-| `4c6468ae` | the follow-ups' record, FACTS, CHANGELOG |
-| `c932e29f` | e2e: the retry scenario on a real-shaped Odysee claim URL (fake yt-dlp reads its id as the app does) |
-| (this commit) | the e2e result |
-
-Gates (from the worktree root; every tsc and suite behind the shared heavy lock after 16:29):
-- tsc: common, editor, mcp package-scoped clean at each commit; `pnpm -r exec tsc --noEmit` clean at the branch tip.
-- common: 4253 at the branch's start (1 failing that run — the run overlapped my first edits; not reproduced) →
- 4279, all pass. New: `ytdlp/corruptRefetch.test.ts` 9 (one through `downloadOneManaged` with a fake yt-dlp),
- `lib/salvageAudio-server.test.ts` 7 (real ffmpeg), `controller/transcribeSalvage.test.ts` 2 (the real stitch
- wrapper over a fake parakeet-cli that "transcribes" tone bursts: cues at the source's burst times ±60 ms, none in the
- gap), `mediaTier-server` +3, `mediaTier` +3 rows, `channelSnapshot` +1, `transcriptionApps` +1, `jobSpec` +1 bucket.
-- test:scripts: 1024 (1021 + 3 skipped) → 1027 (1024 + 3 skipped), none failing (`parakeet-stitch.test.mjs` +3).
-- editor unit: 310 → 310, all pass (the transcribe-one door check is inside an existing test).
-- mcp: 372/372.
-- `docs cli --check`, `docs files --check`, `docs env --check`: clean.
-- After the follow-ups (`b606cebe`): `pnpm -r exec tsc --noEmit` clean; common 4283/4283 (+2 corruptRefetch, +1
- buildIndexSalvaged, +1 salvageMark); editor 310/310; mcp 372 → 373/373; test:scripts 1027 (1024 + 3 skipped);
- export unit 117/117.
-- e2e (after the bus came back, on the orchestrator's word), `audio-check-scenarios.spec.ts`, foreground: run 1 —
- 15 passed, 1 failed (the new retry scenario: the fixture's bare `https://odysee.com/abc123` reads as no id to the
- app, so the retry's allowlist kept 0 of 1 URLs — a fixture shape, not the refetch); fixed in `c932e29f` (the scenario
- uses a real-shaped Odysee claim URL; the fake yt-dlp reads such a URL's id as the app does); run 2 — **16/16
- passed** (1.3 min).
-
-Not done: no live run (the orchestrator's, after merge); the editor's video page does not list `corruptRefetches`
-(the sidecar has them); the summaries pages (`DisplaySummary`) do not carry the mark.
diff --git a/plans/release-31.md b/plans/release-31.md
@@ -1,44 +0,0 @@
-# Release 31 — mirrors, find a copy of every gone video, the audio audit, the poker overlay
-
-Lanes run overnight 2026-10-16 after release 30, each from a brief; the per-lane records are in `plans/release-31/`.
-
-| Lane | Branch | Record | State |
-|---|---|---|---|
-| D — a mirror channel and the creator it copies | `r31/mirrors` | [mirrors.md](release-31/mirrors.md) | merged `1ed16ffc`, live |
-| C — find a copy of every gone video | `r31/find-copy-all` | [find-copy-all.md](release-31/find-copy-all.md) | merged `c9ec3bc8`, live |
-| A — the audio-integrity audit | `r31/audio-audit` | [audio-audit.md](release-31/audio-audit.md) | merged `2c387f0e`, live |
-| P3 — poker events and the stats overlay | `r31/poker-overlay` | [poker-overlay.md](release-31/poker-overlay.md) | merged `a77c9f39`, live |
-| E — the `poker` article's i1 (the 2021 casino promise) | — | the iterations store | filed, not current |
-
-Also on `main`: umtool's create.spec and settings.spec expect the `frames` route in the generation policy summary
-(`60759f41`; stale since release 30 P).
-
-## Gates
-
-On `main` `2c387f0e`: tsc clean; common 4427, editor 322, mcp 377, export 117, umtool 33, scripts 1041 (+3 skipped);
-docs files, env, cli and settings example checks clean. e2e, one suite at a time: editor 711 passed (12 skipped);
-export 276, report 47, hub 39 passed; umtool 546 passed, 2 failed (the stale policy-summary text, fixed in
-`60759f41`; both specs 17/17 after).
-
-## Live
-
-Editor and umtool rebuilt and restarted on `60759f41`.
-
-- D: cornbreadman's config gains `recordedDate` and `mirror.of` (the-quartering, quartering-live, jeremy-hambly,
- the-quartering-rumble); `mirror-scan` wrote `transcripts/mirrors/cornbreadman.json`: 337 videos, all dated;
- YouTube 1 public / 66 gone / 270 none, Rumble 268 public / 69 none; only-copy 69, creator-deleted 66,
- never-uploaded 201, creator-public 1; creator side 75 removed in the window, 65 held.
-- C: find-copy over Jeralyzer's 13 gone videos with no transcript: 12 none found; one Wayback capture held the watch
- page but not the stream (404), recorded as failed at the source. paramount-tactical and timcast-irl hold no gone
- video without a transcript.
-- A: audio-audit over Odysee: 4 held audio files decoded, all clean; cornbreadman's corrupt full sources left to
- their retry.
-- P3: `the-quartering-rumble/v7gkv5w` re-derived (18 → 27 events); supercut `v7gkv5w-poker-2` seeded (5 clips,
- 235 s) and rendered fast with the stats region (7051/7051 frames, verify ok).
-
-## Owed
-
-The operator's rulings: making `poker` i1 current (it cites the private cornbreadman channel), the `deleted`
-article's count (65 of 75 from the scan), Wayback "found" meaning a captured page; the `poker` i1 clip windows on
-cornbreadman (Odysee answered 429); the umtool On-screen preview does not draw the stats region; the video page does
-not show `audio-integrity.json`.
diff --git a/plans/release-31/audio-audit.md b/plans/release-31/audio-audit.md
@@ -1,67 +0,0 @@
-# Release 31, lane A — the audio-integrity audit (as shipped)
-
-Branch `r31/audio-audit` from `main` `3ef1b558` (`main` `c9ec3bc8` and then `1ed16ffc` — lanes C, P3, D — merged in
-before the final gates). Brief: `r31a-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane A: the
-audio-integrity audit".
-
-## What and why
-
-Only a download that went through the audio check is ever classified (release 30 Q's `corrupt-full-source`). Audio
-held from before the check, or from a channel without it, was never checked; the media scan on /review read
-containers, fed no bucket and no refetch. This lane measures what is on disk and routes the damage into Q's refetch.
-
-- **`audio-integrity.json`** (`lib/audioIntegrity.ts`, `lib/audioIntegrity-server.ts`, declared with `sidecar()`):
- one record per video dir, for one file (name, size, mtime); verdict clean | damaged | undecodable by
- `integrityVerdict` (`AUDIO_INTEGRITY_MIN_DECODED_RATIO` 0.98, or any listed gap).
-- **The job** (`controller/audioAudit.ts`): `pnpm ops audio-audit {slug | platform, scope?, max?, force?}` → one
- `audio-audit` job per channel (`needsMedia`) on the `audio-audit` queue, so one file is decoded at a time
- machine-wide; the decode is `scanDecodable` with the new `lowPriority` (`ionice -c3` when on PATH, nice 19 by
- `os.setPriority`; only this caller asks). Resumable by name+size+mtime; `max` a counter shared by the run's jobs;
- corrupt full sources left to Q. Stall-aware: `channelMediaStall` before each file, the stat through `onDrive`, a
- deadline per decode (60 s + 0.1 s per audio second), two missed in a row stop the job; a stop by the drive fails
- the job with the sentence. `ffmpeg -version` first (refused without it). Log ends `@@audio-audit {…}`.
-- **Bucket `corruptHeldAudio`** in the one classifier (`channelSnapshot.ts`, after the corrupt-full-source
- short-circuit): damaged held audio with no transcript (short-circuited out of downloadedNoTranscript and the
- wrong-format sweep) or a salvage transcript. Normalized in `stageStatus`, a download siding in `channelFlow`, the
- Download stage's **Damaged held audio** card with the bucket's Retry, an attention chip, the video list's dot.
-- **The retry** (`ytdlp/corruptRefetch.ts`): a second trigger, `damaged-held-audio`; the audio check is forced on
- for it (`downloadOneManaged`); a failed refetch restores the previous record (or keeps the download's own); the
- kept file is re-audited after clean / still-malformed. `destinationExists` `refetchDamagedAudio` (retry-bucket).
- Salvage transcription is automatic for such a file (`transcribeOne`).
-- **/review**: `scanCorruptMedia` attaches the audit's verdict (`audit`) to a finding and lists a readable file the
- audit found damaged as `damaged`; the finding row shows the audit line.
-
-| Commit | What |
-| --- | --- |
-| `68e87ea5` | the audit, the sidecar, the bucket and its surfaces, the refetch trigger, salvage, /review, ops route/help, COMMANDS.md, the e2e fake ffmpeg, the e2e scenario, CHANGELOG |
-| (this commit) | this record, FACTS |
-
-## Gates (from the worktree root, every one behind the shared heavy lock)
-
-- tsc: `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` clean on the merged tree.
-- common: 4362 at the branch's start → 4427 after merging main (lanes C, P3, D) and this lane, all pass. This lane's
- own: `controller/audioAudit.test.ts` 11 (real ffmpeg over the synthetic damaged recording), `lib/audioIntegrity
- .test.ts` 3, `ytdlp/corruptRefetch.test.ts` +7, `lib/sidecar-server.test.ts` (fifteen declared).
-- editor unit: 319 → 322 (with the merged lanes), all pass.
-- test:scripts: 1030 (+3 skipped) → 1041 (+3 skipped), all pass.
-- `docs cli --check`, `docs files --check`, `docs env --check`, `settings example --check`: clean (COMMANDS.md
- regenerated).
-- e2e `audio-check-scenarios.spec.ts` (with the new scenario: audit → corruptHeldAudio → Retry → clean, re-audited):
- run 1 — **17/17 passed** (1.2 min, foreground, behind the lock; the build through the heavy slot first).
-- Decode speed measured on a synthetic 30-minute AAC file: 1168× realtime at normal priority, 1039× at the audit's
- low priority (≈ 3.5 s per hour of audio on an idle machine; a slow drive dominates).
-
-## Rulings and calls
-
-- Corrupt full sources are not audited (Q's path covers them); counted in the log.
-- The bucket holds untranscribed damaged files and salvage-transcribed ones; a damaged file under any other transcript
- stands, in no bucket (/review lists it). Untranscribed members are held out of the transcription lane until a
- retry, as a corrupt full source is.
-- The snapshot matches the record by name and size only (no extra stat); the audit and the refetch by name, size and
- mtime.
-- Q's leftover rule tightened: an aside is removed as "since clean" only with a clean record newer than the aside.
-
-## Not done
-
-No live run (the orchestrator's). CHANNEL.md needs nothing (per-video sidecars are not in it). The video page does
-not show the audit record (the bucket, the row dot and /review do).
diff --git a/plans/release-31/find-copy-all.md b/plans/release-31/find-copy-all.md
@@ -1,96 +0,0 @@
-# Release 31, lane C — find a copy of every gone video (as shipped)
-
-Branch `r31/find-copy-all` from `main` `3ef1b558`. Brief: `r31c-brief.md` (the plan of record for this lane).
-FACTS: "Release 31 lane C: a gone video's whole audio from a copy".
-
-## What and why
-
-find-copy (release 29 E2 and the r29/fix-copy follow-up) fetched only the cited WINDOWS of gone recordings an
-article cites. The hole on Jeralyzer is gone videos with no transcript at all. This lane brings a gone video's WHOLE
-audio home from its copy — the Wayback Machine holding the video, or an archive.org mirror of the upload — into the
-video's own record, where the transcription lane transcribes it like any downloaded audio.
-
-- **The scope mode** (`publish/findCopy.ts` `enumerateGoneVideos`, `findWholeCopies`, `runFindWholeCopies`):
- `pnpm ops find-copy {slug | siteId, gone: "no-transcript" | "all", dryRun?, max?, retryFailed?}`. Candidates are the
- video dirs of the channel (or of every channel in `site.json` `channels`, in its order) that hold no media
- (`holdsMedia`: finished audio, a `source-media.*` container, a `saved-video.json` pointer), have no transcript for
- `no-transcript` (`isVideoTranscribed`), and are gone by THE reading (`sourceGoneState`: deleted or private);
- untranscribed first, then (for `all`) the transcribed ones. A video whose newest copy attempt is terminal
- (none-found, failed) and younger than `COPY_ATTEMPT_RETRY_DAYS` (30) is left out unless `retryFailed`. A channel
- whose text cannot be read is named and skipped. The lookups are the article mode's, factored into `lookForCopy`
- (Wayback when it holds the video, then an archive.org mirror of the upload of its length, never a copy that failed
- before) — at most `max` YouTube lookups per run (default 10, ceiling 200); a non-YouTube record costs none and is
- listed `not-youtube`; archive.org refusing stops the run. Not a dry run: a video neither source holds is recorded
- `none-found`, and every copy found goes to ONE fetch-copies job. A dry run asks the same paced questions and
- records and fetches nothing. The `{siteId}` body without `gone` is still the article mode (the site's reports).
-- **fetch-copies** (new job kind: drainable, needsMedia, an ingest kind, not replayable; queue `platform:archiveorg`;
- `controller/fetchCopies.ts`, per item `ytdlp/fetchCopyManaged.ts`): yt-dlp `-f ba/b -x --audio-format <the
- channel's audioFormat, default mp3>` on the copy URL, no cookies and none of the channel's platform or extra args,
- `--sleep-requests 2`, the writers negated, `-o data/<id>/audio.copy-part.%(ext)s` → renamed `audio.<fmt>` and
- tiered (`tierMediaFile`). `metadata.info.json` is never written. Then the copy's provenance through the existing
- writers — `wayback.json` (`ensureWaybackProvenance`, from the URL) or `archiveorg.json`
- (`ensureArchiveOrgProvenanceSidecar`, the standard `ArchiveOrgProvenance`) — and a `fetched` attempt. A
- source-side failure is recorded in `failed` and as a `failed` attempt; ours (the extraction, a disk) is not. Paced
- as platform `archiveorg`: hold and cooldown asked before every fetch, a 429 records the backoff and stops the run,
- 30 s between fetches. A video holding media by its turn is skipped; each channel's media guard is asked once. The
- editor action asks each channel that gained audio for its report (`requestChannelSnapshot`).
-- **`copy-attempts.json`** (`lib/copyAttempts-server.ts`): `{failed: [...], attempts?: [{at, outcome: fetched |
- none-found | failed, source?, url?, identifier?, file?, captureTs?, audioFile?, detail?, error?}]}`, newest 20 each;
- both writers update under the file's lock and keep the other list (release 29's `recordFailedCopy` rewrote the file
- with `failed` alone).
-- **The transcription lane picks it up**: a gone video with `audio.<ext>` lands in `downloadedNoTranscript` (the
- snapshot applies no availability filter there) and so in `backfill.transcription.ids`; `whisperBatch` asks only
- "transcribed?" and "downloaded?". It stays in `excludedFromDownload.deleted`. Pinned by a unit test over
- `generateChannelSnapshot` (noTranscript → downloadedNoTranscript).
-- **The video page**: `latestFetchedCopy(copy-attempts.json)` → "Audio from a copy: Wayback Machine, <capture date>"
- or "… archive.org <identifier>", linking the copy, IN PLACE of the source's own provenance line and under its label
- (`Wayback provenance` / `archive.org provenance`) — the brief's "extend it rather than add a second". A record that
- IS a copy (no fetched attempt) keeps its line.
-- **archive.org refresh** (`refreshArchiveOrgRecords`) now skips a record whose metadata is not archive.org's
- (`isArchiveOrgRecordInfo`), so a YouTube original carrying a copy's `archiveorg.json` is never re-titled from it.
-
-| Commit | What |
-| --- | --- |
-| `243b25c0` | common: the scope mode, `lookForCopy`, fetch-copies (controller + managed fetch), copy-attempts' `attempts`, the job kind, the archive.org refresh guard; tests |
-| `f57d1ccf` | editor, scripts: the route's scope mode, `findWholeCopiesAction` / `fetchCopiesJobAction`, the video page's copy line; ops help, COMMANDS.md, CHANGELOG; the route test and `e2e/find-copy-whole.spec.ts` |
-| (this commit) | this record, FACTS |
-
-## Gates (from the worktree root, every heavy step through the shared lock)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean before each commit.
-- common 4362 → 4379/4379 (+17: `lib/copyAttempts.test.ts` +2, `ytdlp/fetchCopyManaged.test.ts` 4,
- `controller/fetchCopies.test.ts` 6, `publish/findCopyScope.test.ts` 4, `controller/archiveOrgRefresh.test.ts` +1;
- `jobs/jobKinds.test.ts` pins the new kind). `publish/findCopy.test.ts` (the article mode, over the refactored
- lookup) unchanged and green.
-- editor unit 319 → 320/320 (`_research.test.ts`: the scope mode's refusals at the door, nothing queued).
-- `docs cli --check`, `docs files --check`, `docs env --check`: clean (COMMANDS.md regenerated).
-- e2e (editor, one spec, through the lock): `find-copy-whole.spec.ts` 1/1 passed (17.2 s; its start-mode build 332 s in the heavy slot, 5 GB cap; 395 s in all). The spec writes the sidecars as fetch-copies does and checks the Wayback and archive.org copy lines, their links, and that a record that IS a Wayback copy keeps "Archived copy (…) of".
-- MCP not touched (lane D owns its tool definitions); no settings, env or file-schema doc changed.
-
-## Rulings and calls
-
-- **One whole-copy path for both sources, not downloadOneManaged for Wayback.** The brief suggested Wayback "through
- downloadOneManaged as today", and also "do not overwrite metadata.info.json from the copy": the managed download's
- prefetch rewrites that file from the Wayback extractor's answer (keepProvenanceFields keeps only fields a provenance
- writer set — a YouTube original's title and date are not), and it would also fetch subtitles and write an archive
- line. So both sources go through `fetchCopyManaged` (audio only, `-x`), which never writes metadata; Wayback's id
- unwrapping is not needed because the record is explicit.
-- **`archiveorg.json` keeps its one declared shape** (`ArchiveOrgProvenance`, identifier, file, downloadUrl,
- fetchedAt and the item's fields) rather than a second, ClipCopy-like shape under the same name, which the existing
- coerce would reject (the page line and the refresh read it). The attempt in `copy-attempts.json` carries the
- ClipCopy-like fields (source, url, identifier, file, captureTs).
-- **`source` uses the file's existing vocabulary** (`"wayback" | "archive.org"`, as `failed` and the windows'
- `copy.from`), not the brief's `archiveorg`.
-- **No cookies and no channel args to a copy**; pace `--sleep-requests 2` (archive.org's client gap); 30 s between
- whole fetches; queue `platform:archiveorg` (one stream to archive.org, behind its imports).
-- **Terminal = the NEWEST attempt** (none-found or failed) within 30 days; a lookup error and a dry run record
- nothing; a failure on our side is never terminal.
-- **A YouTube original with `wayback.json`** is now cited by compose as "Original (may be gone)" plus the Wayback copy
- (the existing `waybackCitationLinks`) — the copy plays where the original does not. Nothing is published by this
- lane; it takes effect at a site's next compose after a live run.
-- `max` counts YouTube lookups; a non-YouTube gone record costs no request and is listed, never fetched.
-
-## Not done
-
-- No editor button for the scope mode (ops only, as the article mode). No replay handler for fetch-copies (a re-run of
- find-copy is the retry). Nothing ran against the real archives (the orchestrator's live run).
diff --git a/plans/release-31/mirrors.md b/plans/release-31/mirrors.md
@@ -1,94 +0,0 @@
-# Release 31, lane D — a mirror channel and the creator it copies (as shipped)
-
-Branch `r31/mirrors` from `main` `3ef1b558` (`main` `c9ec3bc8`, lane C, merged in before the final gates). Brief:
-`r31d-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane D: a mirror channel and the creator it
-copies".
-
-## What and why
-
-A channel that MIRRORS another creator's streams (a VOD archive on another platform) was invisible as one: the
-duplicate finder clusters only short videos, so a 1–5 h stream never folds with its original, and nothing said which
-of the mirror's videos survive nowhere else, or which of the creator's removed videos the mirror still holds. The
-research that answered it once did so by hand, in two scripts whose counts did not reconcile. This lane makes it one
-source, both directions.
-
-- **Config `mirror: {of}`** (`lib/mirrors/config.ts`): the creator's channel slugs (every platform). Declared in the
- channel schema (drop-invalid like its siblings; CHANNEL.md regenerated), written by the Configure form's
- "Mirror of (channel slugs)" field and so by `ops channel-config` `{"patch": {"mirrorOf": "a, b"}}` (the route's
- allowlist is the form's value list; `mirrorOf` added).
-- **The matcher** (`lib/mirrors/match.ts`, pure, every threshold a named constant): the research's rules
- (`match.py`) for a match and its strong cut (`status.py`), over records dated by recorded date else upload date,
- with the mirror's title reduced to its topic (after the date the recorded-date rule reads). Per mirror video: every
- match (rule, score, strong, gone), `presence` per creator platform, and the status `only-copy` | `creator-deleted`
- | `never-uploaded` | `creator-public` (defined in the module doc and FACTS). The other way: the creator's gone
- uploads inside the mirror's window and the mirror videos that hold them — from the SAME strong matches, so the two
- directions reconcile by construction.
-- **The scan** (`controller/mirrorScan.ts`, job kind `mirror-scan` (needsText) on its own queue, `pnpm ops mirror-scan
- {slug, dryRun?}`): records from the index (`mtimes` → `sums`; a dir the index has not seen off disk), recorded
- dates from the index or the channel's rule, the gone state through THE gone reading (`sourceGoneState`) only
- where it can matter; `transcripts/mirrors/<slug>.json` written atomically (`archilyzer-mirror-scan` v1); a dry
- run writes nothing; refused before any job without `mirror.of`.
-- **The editor**: a **Mirror** stage on a channel with `mirror` only — the totals both ways, a filter per status,
- each row linking the mirror video and the creator's copies (removed ones marked), the creator's removed videos in
- the window with what holds them, Scan / Scan again; "No scan yet" with the button when the file is missing. The
- stage summary is on the overview's switcher.
-- **The MCP**: `get_video_metadata`'s `- copies:` line and `enumerate_matches`' `copies: "only-here"`, from the
- scans on a LOCAL source; a remote or hub source says "not available" (`instructions.ts` names the filter).
-- **Private**: the scan file is corpus-side only. Checked: nothing in `export/`, `common/publish/`, the index build or
- the stats build reads `transcripts/mirrors/` (the only `readdir(transcriptsDir)` in publish is the
- `duplicates*.json` listing; `reader-fs` lists a composed site's `transcripts/`, not the corpus). No new key reaches
- a record, a page or a site.
-
-| Commit | What |
-| --- | --- |
-| `70bef53e` | common, editor: the `mirror` config key (schema, form field, CHANNEL.md), the matcher, the synthetic mirror corpus in the kit |
-| `fb08bd35` | common, editor, scripts: the scan controller, the job kind, the scan file, the ops route and action, ops help, COMMANDS.md |
-| `08d76737` | merge `main` `c9ec3bc8` (lane C) — clean, no conflicts |
-| `ffec8a82` | common, editor: the Mirror stage, `e2e/mirror-panel.spec.ts` |
-| `af67049b` | mcp: the copies line, `copies: "only-here"`, instructions |
-| `c9201d97` | mcp: the filter's refusal asserted as a tool error |
-| (this commit) | this record, FACTS, CHANGELOG |
-
-## Gates
-
-From the worktree root, every heavy step through the shared lock, on `08d76737` (main merged in) and after.
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean before each commit (last on `08d76737`
- with the UI and MCP changes in the tree).
-- common 4379 → 4398/4398 (+19: `lib/mirrors/match.test.ts` 11, `lib/mirrors/config.test.ts` 2,
- `controller/mirrorScan.test.ts` 6 — off disk, through the REAL `buildIndex`, the dry run, the refusals, the job).
-- editor unit 320 → 322/322 (`parseChannelForm.test.ts` +2: the `mirrorOf` field and its ops patch).
-- mcp 373 → 377/377 (`mirrorCopies.test.ts` 4: local/remote, the copies line, get_video_metadata,
- `copies: "only-here"`).
-- `pnpm run test:scripts` 1030 passed + 3 skipped (1033), unchanged (the ops CLI's new action is a list entry).
-- `docs files --check`, `docs env --check`, `docs cli --check`, `settings example --check`: clean (CHANNEL.md,
- COMMANDS.md regenerated).
-- e2e (editor, one spec, through the lock): `mirror-panel.spec.ts` 1/1 passed (20.3 s; its start-mode build 102 s;
- 173 s in all).
-- A read-only run of the matcher over the real corpus (the scan's own readers, no write; the orchestrator's live
- sequence is in the lane report) reproduced the research's forward figures exactly.
-
-## Rulings and calls
-
-- **The statuses are one exclusive partition, by platform presence** (only-copy > creator-deleted > never-uploaded >
- creator-public). The brief's four names overlap as written (an only copy is also deleted or never uploaded); the
- partition keeps a filter per status meaningful, and the file's `presence` and `totals.byPlatform` keep the
- research's per-platform figures (YouTube public / removed / none, Rumble public).
-- **`live-duration` uses the CREATOR's duration > 3000 s**, as `match.py` does (the brief's prose said the mirror's;
- with durations within 25 % the difference is a hair). wasLive is the record's `isLivestream` (was_live, or
- live_status was_live / is_live / is_upcoming) — `match.py` read live_status `was_live` only.
-- **Strong is judged on the score rounded to two decimals**, as `status.py` did on `match.py`'s rounded `j`; the rules
- themselves use the exact Jaccard.
-- **Gone is the gone reading** (deleted or private, effective availability), not "anything but public": the research
- counted unlisted, members-only, error probes and never-checked videos as not public. The counts move accordingly
- (the report's prediction says by how much).
-- **The removed window is the mirror's first to last dated video**, with no day margins; a removed upload is held
- when a mirror video STRONGLY matches it (the research's held-gone used ±1 day and Jaccard > 0.3, a looser,
- separate rule).
-- **The scan derives a missing recorded date from the channel's rule itself**, so it is right before the index is
- rebuilt for a new pattern (the index's own `recordedDate` wins when present).
-- **The Mirror panel is a channel stage** (`?stage=mirror`), listed only for a mirror — the channel page's panels are
- its stages.
-- **The MCP reads the scans only for a local source**, from the archive's own `transcripts/` (TRANSCRIPTS_DIR or the
- checkout's): a LocalSource is a composed site dir, but its ids are the corpus's, and mirror data exists nowhere
- else. Remote or hub: "not available".
diff --git a/plans/release-31/odysee-integrity.md b/plans/release-31/odysee-integrity.md
@@ -1,20 +0,0 @@
-# Release 31 — the audio check on every Odysee download, clip windows included (as shipped)
-
-Operator ask (2026-10-16): Odysee downloads with cookies from the browser, and always through the audio-integrity
-pipeline; try to salvage clip downloads before grabbing whole streams. Ruling: a window gets the pipeline's final
-probe (the periodic `.part` probe has nothing to do on seconds of media) and one re-fetch.
-
-## What
-
-- `lib/audioCheckPolicy.ts`: the audio check is on for an Odysee video unless its channel says `enabled: false`; the
- channel's opt-in elsewhere. Used by the full download and by clip windows.
-- `fetchWindowManaged`: a window the rule covers is probed (`probeAudioStream`) before it becomes a window; malformed →
- re-fetched once after 20 s; twice malformed → a `per_video` failure, nothing kept; the verdict in the provenance.
-- CHANNEL.md `audioCheck` documents the default.
-- cornbreadman: `cookieMode: "always"` (inherits `cookiesFromBrowser: firefox`), set through `pnpm ops channel-config`.
-
-## Gates
-
-tsc clean; common 4448, editor 322, mcp 377, export 117, umtool 33, scripts 1042 (+3 skipped); docs checks clean.
-New `ytdlp/fetchWindowAudioCheck.test.ts` (5): the policy, clean kept, malformed once then kept (attempts 2), twice
-malformed failed with nothing kept, no probe off-platform or when turned off.
diff --git a/plans/release-31/poker-overlay.md b/plans/release-31/poker-overlay.md
@@ -1,117 +0,0 @@
-# Release 31, lane P3 — poker events and the stats overlay (as shipped)
-
-Branch `r31/poker-overlay` from `main` `3ef1b558` (main `c9ec3bc8` merged in before the last gates). Brief:
-`r31p3-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane P3: poker highlight events, the
-frames-cut budget, the `stats` region".
-
-## What and why
-
-The frame scan of `the-quartering-rumble/v7gkv5w` derived 1 tournament and 18 events after release 30's derivation,
-and the seeded supercut had 3 clips; `frameScan.overlay` was data nothing drew. This lane gives the derivation the
-moments a highlight reel is cut from, ranks them into a length budget, and draws the running numbers over each clip.
-
-- **The events** (`common/lib/frames/poker.ts`, pure; `DerivedEvent` gains `rule`, `evidence`, `confidence`):
- - hero pots — rule `log-pot`: the log's "Dealer: <hero> takes the [main|side] pot N", `big-pot` at `BIG_POT_BB` (25)
- big blinds; a hero pot line within 180 s of an earlier one at a size within 1% is that line misread (live:
- "60,025"/"60,026", "10,350"/"10,360"); `confirmed` when the kept stack after the line is above the stack before;
- - all-ins — rule `all-in`: a log line naming the hero first with "all in" (or "<hero> calls" beside one), the action
- text naming the hero, or an unnamed action / the model's all-in banner ONLY on a reading with the hero's cards and
- the stack read 0; one per 60 s; the outcome from the kept stack within `ALL_IN_OUTCOME_WINDOW_S` (180 s), flagged
- points left out: `busted` (the stack at 0 and staying, or the log's hero-out line), `doubled` (×1.8), `won`
- (×1.1), `lost` (under ×0.9), `unclear`, `unknown` (no reading; a 0 with chips again past the window);
- `confirmed` with a known outcome. The model's banner alone is no longer an event (it says it for any shove);
- - level-ups — rule `log-blinds`: each new big blind of "Blinds are now a/b" once per tournament (an `INFO`/`Dealer:`
- prefix read); a logged big blind a LATER line undercuts is a misread: no event, and (new) not carried in the
- big-blind series either (recorded once per run of the line); `confirmed` when the big blind before it is lower;
- - players-left milestones — rule `players-left-milestone`: `PLAYERS_LEFT_MILESTONES` [100, 50, 27, 18] and
- `FINAL_TABLE` (9), on the kept unflagged players-left points (P2's: the header with a position beside it, or the
- log's finishing places; never a spoken number), once each per tournament, at the first point after the LAST point
- over the mark (players left never rise), the lowest when one point crosses several; the final table keeps its
- kind (`final-table`, not at 1), the rest are `players-left`; `confirmed` when the next point holds it.
- P2's guarantees hold: a flagged reading makes no event, one tournament until a confirmed bust. The test kit gains
- `syntheticPokerHighlights()` (`common/testing/frames/pokerReadings.mjs`): every rule's evidence and a trap beside
- each (a misread blinds line, a pot line read twice, another player's banner, a flagged header).
-- **The ranking** (`umtool/report-to-video/frames-cut.mjs`): `rankOf` → tiers scoop (the tournament won, big pots,
- all-ins won/doubled, double-ups, knockouts), milestone (bust, final table, players-left marks), swing (other
- all-ins, a big loss), pot, level; `compareRank` (tier, confirmed first, score, earlier). `framesCut(scan, {target =
- 240, short: {pre: 6, post: 10}, stats})` takes ranked events while the merged, sentence-widened windows fit `target`
- seconds and `maxClips`, passing over one that would not fit for a later, smaller one; each clip keeps its
- `frameScan.overlay` points; `seconds` is returned. `umtool new … --seed frames [--target S]` turns on the deck with
- `render.chrome.stats: {}` (the QR off without `--site-origin`) and each subtitle is the event's own words.
-- **The `stats` region** (`stats.mjs`, `chrome-stats.mjs`; the stamps' path): `render.chrome.stats {position
- (bottom-left), fields, name}` per cut, a clip's boolean `stats` per clip; a clip declares it when it asks and
- `frameScan.overlay` has points for it. The schedule's `stats` maps source seconds into the cut's clock (`start + t −
- playWindow.from`), a state per change, the panel up from mid-dissolve to mid-dissolve and held across a cut between
- two clips that both carry it. The page draws one block per state (seek-safe), on the palette's roles (bg 84%, fg,
- muted, an accent rule), 648×150 at 1920 (48 + 150 a field; 112 tall without the name). compose-chrome `--region
- stats`, the build lays it after the stamps (`statsRegion`, `-reinit_filter 0` + rgba like the deck's), the build and
- the lint refuse bad `stats` keys (`validateStatsEntries`; `validateChrome` takes `stats`), and `verify-build` fails
- on a declared clip the schedule does not draw, or a missing or short `stats-frames`.
-
-| Commit | What |
-| --- | --- |
-| `bd9a486f` | common: the highlight events (rules, evidence, confidence), the blinds-line misread, the test kit's highlights |
-| `56d4159f` | umtool: frames-cut ranking and budget, `--seed frames --target`, the `stats` region, verify-build, lint, docs |
-| `1c5a41ff` | merge `main` `c9ec3bc8` (lane C) |
-| `499f1b9d` | umtool: `stats-overlay.spec.ts` and its `stats-build-fixture` |
-| (this commit) | plans, CHANGELOG, FACTS: this record |
-
-## Gates
-
-From the worktree root; every tsc, suite, docs check and the e2e spec through the shared lock (`r31-locked.sh`,
-`r31-locked6.sh`).
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean at each commit and after the merge of `main`.
-- common: 4362 at the branch's start → 4370 at `bd9a486f` (lib/frames 80/80: `pokerEvents.test.ts` 8 new on
- `syntheticPokerHighlights`; the P2 all-in banner test moved to the new rule; `scan.test.ts` gains the lobby's
- 120 → 85 crossing of 100) → 4387 after merging `main` (lane C's), all pass.
-- test:scripts: 1033 (1030 + 3 skipped) → 1044 (1041 + 3 skipped): `frames-cut.test.mjs` 7 (2 new, 3 moved to the
- ranking), `stats.test.mjs` 9 new (one a tiny real deck build of two lavfi clips beside the manifest with a stub
- renderer: verify-build passes, then fails on the pruned record losing `stats-frames` and on a declared clip missing
- from the schedule), `scaffold-frames.test.mjs` 1 (the deck, the subtitles, `--target`); `fixtures-r28.test.mjs`
- green (the kit's manifests lint clean).
-- umtool unit: 33 → 33. editor unit: 319 → 320 after the merge (lane C's), all pass.
-- `docs cli --check`, `docs files --check`: clean (no CLI row or file schema changed; `umtool new`'s help and
- `umtool/docs/cli.md` updated by hand — not generated). The lint on the e2e fixture's manifest: 0 errors, 0 warnings.
-- umtool e2e, one spec: `stats-overlay.spec.ts` 1/1 (6.3 s; the umtool e2e build 544 s, then the heavy slot's
- queue) — the fixture built offline through `/api/report/build` (preset fast) to `done`, its chain ending in
- verify-build: the stats region composed and rendered after the deck, the schedule's states held from the scan's
- points, the page's numbers, `stats-frames` as long as the deck's (pruned and recorded).
-- A chromium still of the region on synthetic numbers (scratch only) checked by eye: legible at 1080p, the stack's
- cell a third wider for "323.2K".
-- Measured on the live sidecar in memory (read-only; nothing of it committed): events 18 → 27 — big-pot 2 (both
- `unconfirmed`: the kept stack did not rise across them), pot 9 (11 → 9: two lines read twice with a digit off),
- level-up 10 (1,800 at 24:10 … 5,500 at 3:44:50; all confirmed), players-left 1 (under 100 at 3:04:50,
- confirmed), buy-in 3, bust 1, eliminated 1; no all-in (the client's log on this stream carries none and no reading
- has an all-in action with the hero's chips in). `framesCut` with the cues: 240 s → 5 clips, 234.6 s (two big pots,
- a pot, under 100, the bust with the last level-up); 360 s → 10 clips, 354.3 s.
-
-Not done:
-- umtool's On-screen preview does not draw the stats region yet (it composes the deck, the posts and the stamps);
- the build, `--chrome-only`/`--chrome-preview` and `compose-chrome --region stats --still` do.
-- No all-in on the live stream to calibrate against: the all-in rule rests on the synthetic shapes.
-
-## Rulings followed and decisions
-
-- The brief's "stats header only" for milestones is read as P2's players-left points (the header with a position
- beside it, or the log's finishing places), the same points the final table already used; never a spoken fill.
-- An all-in is the hero's only with evidence naming the hero or the hero's chips in the middle; the model's banner
- alone was an event in release 30 and is not now (the P2 test that pinned it was moved to the new rule).
-- Plain pots are clips again, as filler between the milestones and the level-ups (release 30 left them out).
-- The seed turns the deck on (the stats region is the deck's); its QR is off without `--site-origin`.
-- A re-seed over an existing project is refused as before (the operator's edits live there): re-seed to a new slug.
-
-## Live (for the orchestrator, after merge)
-
-1. Re-derive the scan (no model call). The CLI runs the checkout's code (no editor restart needed); dry first:
- `pnpm archilyzer frames rederive the-quartering-rumble/v7gkv5w --dry --json`, then without `--dry`. Expected
- events 18 → 27: `{big-pot: 2, pot: 9, level-up: 10, players-left: 1, buy-in: 3, bust: 1, eliminated: 1}`. (Or, after
- the editor restart, `pnpm ops frame-scan --json '{"slug":"the-quartering-rumble","id":"v7gkv5w","rederive":true}'`.)
-2. Re-seed to a NEW slug (the scaffold refuses an existing directory; `~/reports/v7gkv5w-poker` keeps its edits):
- `node umtool/bin/umtool.mjs new v7gkv5w-poker-2 --from the-quartering-rumble/v7gkv5w --site-origin
- https://jeralyzer.pages.dev --seed frames --target 240` → 5 clips, ~235 s (`--target 360` → 10 clips).
-3. The preview: `node umtool/bin/umtool.mjs build reports/v7gkv5w-poker-2 --preset fast` prints the chain (or the
- piece's Build in umtool); run it through the heavy slot (`pnpm heavy -- …`) inside the shared lock, then
- `node umtool/report-to-video/verify-build.mjs ~/reports/v7gkv5w-poker-2/video.manifest.json` (expects
- `stats: N/N frame(s) over 5 of 5 declared clip(s)`). A still of the panel without a render:
- `node umtool/report-to-video/compose-chrome.mjs ~/reports/v7gkv5w-poker-2/video.manifest.json --region stats
- --still <s> --png <file>` once a build has written `out/sourced/schedule.json`.
diff --git a/plans/release-31/respell.md b/plans/release-31/respell.md
@@ -1,28 +0,0 @@
-# Release 31 — respellings: a transcript's mis-hearing corrected in an article's quotes (as shipped)
-
-Operator ask (2026-10-16): the cornbreadman article's quotes carry "cake cup"/"cakeup" for K-Cup; correct the text in
-the article as an operation that can be previewed. Ruling: bracketing is per respelling and OFF by default (an obvious
-correction reads plainly); `--bracket` marks an altered quote `[K-Cup]`.
-
-## What
-
-- `archilyzer reports respell <article> --heard <a,b,…> --reads <word> [--bracket] [--note] [--iteration n] [--apply]
- [--json]`: a dry run listing every change per file as word hunks (`«cakeup» → «K-Cup»`); `--apply` backs each file
- up and writes it through the registry / iterations store; exit 1 when nothing would change.
-- Reports and video manifests gain `respellings`; every quote check (compose, verify-quotes recall + strict, umtool's
- cut-to-quote) applies them to both sides, so a corrected quote verifies exactly and an undeclared one does not.
-
-## Files
-
-`common/lib/citations/respell.mjs` (+ `.d.mts`), `common/lib/citations/verify.ts`, `common/publish/composeReports.ts`,
-`common/bin/reports-check.ts`, `common/lib/report/{schema.ts, respellReport.ts, respellManifest.mjs (+ .d.mts),
-respellArticle.ts}`, `common/bin/{reports-respell.ts, archilyzer.ts}`, `common/package.json` (exports),
-`umtool/report-to-video/resolve-windows.mjs`, `umtool/app/api/report/cut/route.ts`; COMMANDS.md, REPORT.md.
-
-## Gates
-
-tsc clean (all packages); common 4443, editor 322, mcp 377, export 117, umtool 33, scripts 1042 (+3 skipped); docs
-files/env/cli and settings example checks clean. New: `respell.test.ts` (9), `respellReport.test.ts` (4),
-`reports-respell.test.ts` (3), a cut-to-quote case. Live dry run on `cornbreadman-then-and-now`: 16 changes in 3
-files; `reports verify-quotes` on the respelled report 58/58 ok (the four K-Cup quotes score 1, strict ok); the same
-report without `respellings` flags them `inexact`.
diff --git a/plans/release-32.md b/plans/release-32.md
@@ -1,70 +0,0 @@
-# Release 32 — the UI works without AI, and Docker is the first-class install
-
-The operator's rules (2026-10-16): "Prioritize the ability to be able to do as much as possible with the UI outside of
-AI in situations where the compute becomes hard to come by", and "make it as easy as possible for anyone to use all the
-features of Archilyzer — Docker is a core component of that". Four lanes from briefs; records in `plans/release-32/`.
-
-| Lane | Branch | Record | State |
-|---|---|---|---|
-| R1 — verify by playing the citation: the drafts review as a swipe deck | `r32/review-player` | [review-player.md](release-32/review-player.md) | merged `9872f4f9`, live |
-| R2 — author by hand in umtool | `r32/by-hand` | [by-hand.md](release-32/by-hand.md) | merged `4fbda602`, live |
-| R3 — every operation has a button in the editor | `r32/ops-buttons` | [ops-buttons.md](release-32/ops-buttons.md) | merged `45c5a583`, live |
-| R4 — Docker feature parity, and both modes as systemd services | `r32/services` | [services.md](release-32/services.md) | merged `2b912e30`, live |
-| R5 — a clip window from the stored media URL (`fetch-windows storedUrl`) | `r32/stored-url` | [stored-url.md](release-32/stored-url.md) | merged `82787a0e`, the ffmpeg cut `c62390b4`, live |
-| R6 — the owed UI items (stored-URL toggle everywhere, Inbox at phone width, bulk buttons) | `r32/owed-ui` | [owed-ui.md](release-32/owed-ui.md) | merged `42c9fc40`, live |
-| R7 — full Odysee downloads read the player's way (page open, ranged, audio check) | `r32/odysee-ranged` | [odysee-ranged.md](release-32/odysee-ranged.md) | merged `eb8d9523`, live |
-| R8 — the operator's rulings of 2026-10-17 (bench v3 (a); Wayback found check; full audio before salvage) | `r32/rulings` | [rulings.md](release-32/rulings.md) | merged `17207fb8`, live |
-| R9 — the Odysee loop (cut opens the page; one rest; lane takes held work; browser lookup) | `r32/odysee-loop` | [odysee-loop.md](release-32/odysee-loop.md) | merged `72f777ae`, live |
-| R10 — a stored-URL download survives connection drops | `r32/ranged-resume` | [ranged-resume.md](release-32/ranged-resume.md) | merged `80288e89`, live |
-| R11 — e2e over the release: rsync 3.5.1's progress lines (a product fix), spec isolation | `r32/e2e-fixes` | [e2e-fixes.md](release-32/e2e-fixes.md) | merged `8fa210c6`, live |
-
-Also on `main`: umtool's rail on a narrow window is two compact rows (`4dcbf1e3`); a job's log is flushed before the
-job settles (`ad3182cf` — a reader on `done` could miss the log's last lines).
-
-## The live apps are systemd user units
-
-Since 2026-10-16 the live editor and umtool run as `archilyzer-editor.service` and `archilyzer-umtool.service`
-(host mode; linger on; restart on failure; MemoryMax 8G / 6G with their jobs inside). `archilyzer service install
---mode host` renders them identically and adopts them. Docker is the first-class mode elsewhere
-(RUNNING_IN_DOCKER.md, the feature table).
-
-## Gates
-
-On `main` `9872f4f9` + `ad3182cf`: tsc clean; common 4487, editor 327, mcp 377, export 117, umtool 42, scripts 1048
-(+4 skipped); docs files/env/cli and settings example checks clean. e2e (lane specs, single): review-player and
-draft-review 5/5, by-hand + article-iterations 7/7, ops-buttons 4/4, the rail's shell/create/running/inbox 59/59.
-Docker: editor image 2.60 GB, umtool image 4.28 GB, container smoke and 98/99 render tests inside the umtool image
-(the one failure is a control assertion of the old crossfade drift that ffmpeg 7.1 no longer shows).
-
-## Live
-
-Editor `MLVuXdgVfv-FpDu4Ou7Ru`, umtool `ZYc1-qcf0sWkC32PERnBd`, both through their units. Smoke: the channel
-Download stage shows Find copies of gone videos and Audit audio; Configure shows the Odysee audio check on by default;
-a frame-scanned video shows Re-derive (no model) and Media tools; umtool offers the frames seed; a respell preview of an
-already-respelled article finds 0 changes.
-
-## Odysee, measured live
-
-yt-dlp's lookup AND its generic fetch of the stored original-file URL got 429 (cookies and `--impersonate chrome` made
-no difference); a browser (headless Chromium via Playwright) got 200 on every API call and 206 on ranged reads of the same
-file, with only Referer/Origin and a browser user agent — no cookies, no token. A plain ranged request with those headers
-also got 206. So a stored URL is now cut with ffmpeg the way the player reads it (`c62390b4`): the first window landed
-(`ga-casino`, audio check clean); the next, a minute later, got 429 — the CDN allows one new original file after a rest.
-The remaining windows run one per 20 minutes (a transient user unit). Full Odysee downloads still go through yt-dlp.
-
-## Shipped 2026-10-17
-
-Also merged: `research/cornbreadman-import-sweep` (`478ac0e7`, the operator's ruling). Final gate on `8fa210c6`: tsc clean;
-common 4602, editor 346, mcp 378, export 117, umtool 45, scripts 1049 (+4 skipped); docs checks clean. Full e2e:
-editor 720 passed (3 failed, fixed by `3ca67cd4` and R11, re-run green), export 276, report 47, hub 39, umtool 555 ×2.
-Live: editor `8Yk42QnNwwtFBgH76y3JY`, umtool `6MDvhF4YHXhXhhtaNdWrm`.
-Odysee: the CDN serves an original file only after a player opened its page (a headless page view), then ranged reads
-work; a long read is dropped after a while and resumes (R10). All 26 clips of `cornbreadman-then-and-now` i1 rendered
-(287 s); poker i1's windows on disk. The media drive was unmounted after the reboot into Sway (40 channels auto-paused
-until mounted by hand) — a boot-time mount (fstab) is the operator's to add.
-
-## Owed
-
-Vulkan and CUDA images not built after R4's changes; the full editor and umtool e2e suites over the release (lane specs
-only so far); the Inbox's rows lose their titles at ~380 px; the bulk CLI-only rows (channel-wide media attach and
-playable, persist-videos); an e2e for adding a spelling by hand (the editor stub has no corpus).
diff --git a/plans/release-32/by-hand.md b/plans/release-32/by-hand.md
@@ -1,89 +0,0 @@
-# Release 32 lane R2 — by hand, no model (as shipped)
-
-Operator rule (2026-10-16): every step a model can do, a person can do in the UI, with no model. An audit found six
-gaps in umtool; this lane closes them. Nothing here calls a model.
-
-## What
-
-1. **Fix a mishearing** (respell had no UI). On an article's Iterations tab (`HandTools`, "by hand" region): heard
- forms, reads, bracket, note → **Preview** (every change per file as word hunks, `wordHunks`) → **Apply** (the
- CLI's `applyRespell`, its backups listed) → **Rebuild the video →** (the iteration's project's Build tab) when the
- manifest changed. The report's respellings are listed with their heard forms. Apply waits for a fresh preview when
- a field changed since. `?tab=iterations&heard=<words>` (R1's drafts-review link) opens it with Heard filled,
- scrolled into view.
-2. **Add a claim by hand.** Same region: section (existing or new), title, text, verdict (fact-check only), the
- report's citations as checkboxes, and new ones from a pasted moment (archive link, the house citation,
- `channel/id@m:ss`) whose cues are listed to click — the quote, start and end come from the lines picked. Saved
- through the iterations store as a `hand` iteration (or into a hand draft no one uses); every new quote is checked
- strictly against the record first (verify-quotes' check: `ok`/`fragment` pass), else refused with nothing written.
- Nothing is made current.
-3. **A blank start.** Create's article form: "blank (no model: write it by hand)" — title, kind (fact-check | sweep),
- id → an article in the making, i1 a `hand` iteration with a titled empty report; the page opens on its
- Iterations tab, where Add a claim fills it.
-4. **Learned spellings by hand.** Series page: **Add spelling** (spelling + the watched name it means) →
- `report-schedule add-spelling`: counted in scope and its proving line found by code (`proveByHand`), kept with
- source `"hand"` ("added by hand") only when it occurs.
-5. **A "frames" seed** in the new-project form: the seed is a select (empty, digest chapters, frame scan events),
- each offered when the video has it (`GET /api/projects/new?from=`), with the frames cut's target seconds.
-6. **Fill empty fields by hand** on the Media tab (under the drafts): every empty clip on-screen title, teaser lines,
- YouTube title/description, X and Bluesky post as blanks; the flips or the threads whole when the deck is on.
- Written through `writeDraftedField` with no drafted mark — the operator's, "written by hand", never replaced.
- Found missing and added: hand editors for YouTube, X/Bluesky, flips and threads (teaser lines already had
- StructureEditors; on-screen titles OnscreenSection).
-
-## Files
-
-common: `lib/report/iterations.ts` (kind `hand`), `controller/handEdits.ts` (+ test), `controller/learnedSpellings.ts`
-(`addSpellingByHand`, + test), `controller/reportLearn.ts` (`handProver`), `controller/reportScheduleOps.ts`
-(`add-spelling`, body key `means`), `lib/report/draft/triage/confirm.ts` (`proveByHand`, + test in learned.test.ts),
-`lib/report/draft/triage/learned.ts` (`SpellingSource` + `"hand"`). editor: `app/api/ops/_reportSchedule.ts`
-(`proveSpelling`), `app/api/ops/report-schedule/route.ts` (comment). scripts: `archilyzer-ops.mjs` (help). umtool:
-`app/api/articles/{respell,by-hand}/route.ts`, `app/api/report/hand-fill/route.ts`, `app/api/projects/new/route.ts`
-(GET), `app/api/schedules/route.ts`, `components/articles/{HandTools,IterationsView,IterationsTab,NewArticleForm}.tsx`,
-`components/series/LearnedSpellings.tsx`, `components/NewProjectMenu.tsx`, `components/projects/HandFill.tsx`,
-`components/projects/report/MediaTab.tsx`, `lib/articles/hand-types.ts`, `lib/report/hand-fill.mjs` (+ test),
-`lib/projects/{scaffold.mjs,scaffold.ts}`, `lib/scaffold-frames.test.mjs`, `lib/inbox.ts` ("by hand"),
-`e2e/by-hand.spec.ts`. COMMANDS.md, FACTS.md, CHANGELOG.
-
-## Interfaces
-
-- `startBlankArticle(id, {title, kind?}, paths?, now?)`, `addClaimByHand(id, HandClaimInput, paths?, now?)` →
- `{n, amended, claim, section, added: [{id, check}], warnings}`, `defaultHandBase`, `checkAddedCitations`,
- `parseMoment(text)`, `cuesAround(channel, id, from, to, paths?)`, `HandEditError {problems}`, `HAND_MODEL`.
-- `addSpellingByHand(id, {spelling, means}, {paths, prove, now?})` → `{added, unblocked}`; `HandProver`;
- `proveByHand(i, {corpus, count})` → `HandProof`; `handProver(draftDeps)`.
-- `pnpm ops report-schedule --json '{"action":"add-spelling","id","spelling","means"}'`.
-- umtool: `POST /api/articles/respell`, `GET|POST /api/articles/by-hand`, `GET|POST /api/report/hand-fill`,
- `GET /api/projects/new?from=`; `handFillView`, `applyHandFill`, `seedsFor`.
-
-## Rulings followed / decisions
-
-- A hand claim on a hand draft no one uses amends it (one draft, not one iteration per claim); any other base gets a
- new `hand` iteration. Model name `"hand"`.
-- New quotes: `ok` and the `fragment` warning pass; every other status refuses.
-- A spelling a person removed and then adds by hand lifts its block (the person's word, again).
-- Fill by hand writes only what is filled; a blank is a form field, never a manifest placeholder. Flips/threads:
- the one the cut has, else both offered and the last edited saved (a cut has one or the other).
-- Fill by hand is its own section under the drafts on the Media tab, not inside the Draft everything row.
-
-## Gates
-
-Final, on `3f4e20c0` + `6132db61` (main `45c5a583` merged), all through the shared lock:
-
-- tsc (all packages) clean, before every commit.
-- common 4465 (4464 pass, 1 skipped, 0 fail; baseline 4448 on `977917c7`, +17: handEdits 8, citedCues 1, add-spelling
- 1, proveByHand 1, the rest from main's merge). An earlier run caught a new layer back-edge (controller/ →
- publish/): `cuesAround` moved to `publish/citedCues.ts`.
-- umtool 33 (unchanged); scripts 1048 (1044 pass, 4 skipped, 0 fail; baseline 1042 + 3 skipped: +3 tests —
- hand-fill 2, seedsFor 1; one more environment skip than the baseline, not from this lane); editor 327 (main's
- 322 + R3's); mcp 377.
-- docs env, files, cli and settings example `--check` clean (COMMANDS.md regenerated for `add-spelling`).
-- e2e umtool (single specs, foreground/detached under the lock): by-hand.spec.ts 3/3 (11.9 s); final run
- by-hand.spec.ts + article-iterations.spec.ts 7/7 (41.4 s). Earlier runs: 1 passed 1 failed (the respell
- fixture's word occurred in the title and claim too — the spec now respells a word only the quote holds), then 2/2.
-
-## Not done
-
-- No e2e for "Add spelling" (the editor stub runs report-schedule without a corpus to count in: `add-spelling`
- answers "not wired" there); covered by unit tests over the corpus fakes.
-- The flips/threads hand editors are form editors only (no preview of the panel).
diff --git a/plans/release-32/e2e-fixes.md b/plans/release-32/e2e-fixes.md
@@ -1,82 +0,0 @@
-# Release 32 lane R11 — three e2e failures over release 32 (as shipped)
-
-Three specs failed on `main` in the full suites of 2026-10-17 and passed alone in their lanes. One was the product (a
-newer rsync), two were umtool specs that depended on another spec's fetch.
-
-## What
-
-1. **editor `channel-storage.spec.ts:112`** (relocate a channel's media, and move it back) — **the product.** Nothing
- in the relocate code or the Storage panel changed since `3ef1b558`. rsync did: Arch's 3.5.1-3 (installed on this
- machine 2026-10-16 15:37) writes `--info=progress2` frames with a `B` on the byte count and an unscaled,
- digit-grouped rate:
-
- ```
- 30,000,000B 99% 1,248,634,666B/s 0:00:00 (xfr#1, to-chk=0/5)
- ```
-
- `RSYNC_PROGRESS_RE` read "digits, whitespace, percent", so every frame of that rsync failed to parse: no
- `Copying… · N % ·` decile line, no `relocate` task bar, and the redraws went into the job log verbatim (they fail
- `parseRsyncProgress`, so `rsyncTree` passes them through). That affects a real media move, a saved-video store move
- and `migrate-tier` alike. The parser now accepts an optional ` ?B` after the count. A rate of digits and grouping
- then `B/s` is scaled back to the older wording, in units of 1024 (`1.16GB/s`, `0.00kB/s`), and a rate already scaled
- is returned verbatim. The older format still parses unchanged.
-2. **umtool `review-player.spec.ts:33`** — the deck's first card cited vid1 3–6 s, and vid1 is shared. clip-bench's
- "an after-only fetch leaves the before edge exactly where it was" fetches bench-fixture c01 with padBefore 3,
- padAfter 8, which leaves the corpus window `channels/testchan/data/vid1/clips/0.00-14.00.mp4`. That window covers
- the card's span, so the player chose it over the project's own `vid1_0.00-9.00.mp4`. The card now cites its own
- source, **vid9**: cues written by `review-player-fixture.mjs` (vid1's first three, so the run-on quote is the same
- seven words) and the project's cached window copied as `out/clips-raw/vid9_0.00-9.00.mp4`. Nothing else cites vid9.
-3. **umtool `stored-url.spec.ts:38`** — its "no stored URL, no option" half borrowed `editor-fetch-many-fixture`.
- report-fetch-via-editor (earlier in the run) fetches that project's clips (vid4 0–23 covers both), so its
- "Fetch N unfetched clips" button was gone. (The brief named the R1 spec; the stub's request log and the corpus
- windows show it was report-fetch-via-editor.) The spec now has its own **`stored-url-plain-fixture`**: one unfetched
- clip on **vid10**, whose record stores no media URL, written by `make-fixture.mjs` beside `stored-url-fixture`.
- Nothing ever fetches it. The stored-URL answer's negative case asks vid10 too.
-
-The two primary-checkout spec fixes the brief listed (frame-scan's exact `1:30` link, reconstruct-download-url's Odysee
-audio-check opt-out) were committed on `main` by the orchestrator (`3ca67cd4`) before this lane started, so the
-worktree carried them from `main` and nothing was copied.
-
-## Files
-
-`common/jobs/progressParsers.ts`, `common/jobs/progressParsers.test.ts` (+1 test: rsync 3.5.1-3's frames, the
-`--no-human-readable` form, a spaced unit, the summary line still not a frame), `umtool/e2e/fixtures/review-player-fixture.mjs`,
-`umtool/e2e/review-player.spec.ts`, `umtool/e2e/fixtures/make-fixture.mjs`, `umtool/e2e/stored-url.spec.ts`,
-`editor/CHANGELOG.md`, `plans/FACTS.md` ("Relocate progress").
-
-| Commit | What |
-| --- | --- |
-| `dcc4e1ce` | common: rsync 3.5.1-3's progress frames parse (the `B` on the count, the raw rate scaled); FACTS, CHANGELOG |
-| `87493cf1` | umtool: e2e — review-player's first card on vid9, stored-url's plain project on vid10 |
-| (this commit) | this record |
-
-## Gates
-
-All through the shared heavy lock, from the worktree root:
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean.
-- common: 4602 at `main` `80288e89` (R10's record: 4601 pass + 1 skipped) → **4603 (4602 pass, 0 fail, 1 skipped)**.
- `progressParsers.test.ts` + `relocateDir.test.ts` alone first: 33/33.
-- test:scripts: **1053 (1049 pass, 0 fail, 4 skipped)**, unchanged from R8's 1053. editor unit and mcp: not touched,
- not run. No CLI row, env var, settings or file schema changed (no docs check needed).
-- editor e2e `channel-storage.spec.ts`: **15/15 (42.8 s)**, then **15/15 (36.5 s)** again (the first run built the
- editor's e2e tree, 169 s).
-- editor e2e `frame-scan.spec.ts` + `reconstruct-download-url.spec.ts` (main's fixes, in this tree): **2/2 (13.0 s)**.
-- umtool e2e `review-player.spec.ts` + `stored-url.spec.ts`: **4/4 (20.2 s)** (built umtool's e2e tree, 46 s).
-- umtool e2e, the WHOLE suite: run 1 **561 tests: 555 passed, 0 failed, 6 skipped (12.0 m)**; run 2 **555 passed, 0 failed, 6 skipped (12.0 m)**. (Before:
- 553 passed, 2 failed, 6 skipped, the two above.)
-
-## Rulings followed
-
-- Each spec owns its fixture data: its own project and, since a corpus window is keyed by video and shared by every
- project, its own source. No spec depends on the order the suite runs in.
-- No model and no network in any test. The rsync shape was captured from the machine's own rsync on synthetic files in
- the lane's scratch directory.
-
-## Decisions I made
-
-- **Fix the parser, not the spec.** The spec's `Copying…` assertion was right: a move under this rsync logged no
- progress line at all. Asserting less would have hidden a regression every live move has.
-- **A raw rate is rescaled** rather than shown as `1,248,634,666B/s`, so the `/jobs` row and the log read as they
- did. Units of 1024, as rsync's own scaled rate is.
-- **New sources rather than restoring vid1/vid4 after a fetch.** Deleting a window another spec made would still
- depend on order (the next spec to look at vid1 could be any of a dozen). vid9 and vid10 are cited by nothing else.
diff --git a/plans/release-32/odysee-ranged.md b/plans/release-32/odysee-ranged.md
@@ -1,113 +0,0 @@
-# Release 32 lane R7 — full Odysee downloads read the way the player reads (as shipped)
-
-Measured (2026-10-16): Odysee answers yt-dlp with 429 — its lookup API and its own fetch of the stored original-file
-URL — while the player's ranged GETs of `player.odycdn.com/v6/streams/<claim>/<sd>.mp4` (Referer/Origin odysee.com, a
-browser user agent, no cookies) get 206; the CDN allows one new original file after a rest. The clip-window path
-already cuts that way (R5); full downloads (transcribe handling, audio) still went through yt-dlp and failed.
-
-**Found live during the lane (the orchestrator, 2026-10-17):** the CDN serves a stream's original file to a connection
-only AFTER a player has opened that video's page. Cold ranged reads with the player's headers got 429 (four windows,
-20–40 minutes apart); right after a headless Chromium page view of the same video (the odysee.com page, ~10 s, play,
-~8 s) the player's own requests got 200/206 and the ranged cut landed (audio check clean). How long the unlock lasts is
-unknown.
-
-## What
-
-- **The ranged downloader** (`common/ytdlp/storedUrlDownload.ts`): the WHOLE stored file in sequential 8 MiB Range
- requests with the player's headers (`storedMediaHeaders`, `STORED_MEDIA_USER_AGENT` now in lib/storedMediaUrl.ts),
- into `audio.<ext>.stored.part` with a resume state `audio.<ext>.stored.part.json` (`{url, totalBytes, goodBytes}`);
- resumable from the last probed-clean byte; the abort signal honoured between and during reads; a 429/403 stops
- with the partial kept (`rate-limited`).
-- **The player's page first** (`common/ytdlp/storedUrlPageOpen.ts`): a named, injected `PageOpener`; the real
- `openPlayerPage` is headless Chromium (the workspace's Playwright via `social/playwrightRuntime.ts`, a fresh context,
- no cookies) on the video's page for 10 s, a play, 8 s more, never throwing. Odysee only (`PAGE_OPEN_PLATFORMS`).
- Opened before the first ranged read of each run, inside the same 20-minute gap; a 429/403 after bytes were served
- since the last open opens the page again and re-asks the range; one straight after an open gives up
- (`rate-limited`, no loop of opens). The attempt records `pageOpens`. Tests inject a fake opener (the fake CDN's
- `requireUnlock` / `unlockBytes` model the lock and its lapse) and never launch a browser.
-- **The audio integrity pipeline over it:** the audio check's knobs (`resolveKnobs`, exported) and AIMD cadence, a
- probe of the growing partial between reads, a malformed verdict rolling back to the last good byte (a truncate —
- this loop is the producer, so no SIGSTOP and no `.good` copy), more than `maxRollbacks` in a row →
- failed-corrupt-source; the final probe, one re-read from the last good byte, malformed again → corrupt-full-source
- with the file kept; then the configured extraction and the container removed unless `keepSourceVideo`. A partial
- ffmpeg cannot open yet, before anything probed clean, is `skip-not-yet-readable` (an MP4 index longer than the
- first reads), not corruption.
-- **In the managed download** (`downloadOneManaged`): `storedUrl: never | fallback | only` (else the channel's new
- `storedUrlDownloads`, else never), transcribe handling, STORED_URL_PLATFORMS only. `only`: no prefetch, no yt-dlp
- (no trusted stored URL → a per-video failure, nothing asked). `fallback`: after a rate-limited prefetch, or a
- download (primary / auth retry) that ended rate-limited. Outcome sidecar with the new attempt kind
- `stored-url-ranged` (`storedUrl: {host, why, bytes, totalBytes?, resumedFrom?, httpStatus?}` + audio-check stats),
- the media tier's hook (writeOutcome), the archive line, the short-audio guard, and the corrupt-full-source refetch's
- prepare/settle around it exactly as for a yt-dlp download.
-- **Paced:** one new stored-URL file per platform per 20 minutes (`STORED_URL_NEW_FILE_GAP_MS`, platformGap key
- `stored-url:<platform>`): waited out before, set at the start and the end, so a batch waits rather than 429s.
-- **Never a clean settle:** a stored-URL success after a rate-limited lookup backs the platform off (batch and lane);
- one that asked the platform nothing (`only`, held) does not count as a request (no clean settle of a manual run) and
- the lane retires the video without touching the backoff, hold or pace (`viaStoredUrl`).
-- **Editor:** `storedUrl` on `transcribe-one` (not with `file`), `retry-bucket`, `download-missing` (checked at the
- door, kept on Retry). A held platform's download-missing / retry with a stored mode runs as `only` (`storedUrlHeld`).
- Transcribe (the video page's and `transcribe-one`'s) with a stored mode downloads through the managed path, not the
- raw one-video run; a non-ok record fails the job before transcription.
-- **UI (the UI-without-AI rule):** the Configure form's **Stored media URL downloads** (never / fallback / only); the
- video page's re-download **Stored media URL** select (inherit / never / fallback / only, naming the CDN host), shown
- when the record stores a trusted URL, for both download modes. Ops help, COMMANDS.md, CHANNEL.md.
-
-## Files
-
-`common/ytdlp/storedUrlDownload.ts` (new), `common/ytdlp/storedUrlPageOpen.ts` (new), `common/ytdlp/downloadOneManaged.ts`, `common/ytdlp/audioCheckedDownload.ts`
-(exports), `common/ytdlp/fetchWindowManaged.ts` (the UA constant re-exported), `common/ytdlp/runYtdlp.ts`,
-`common/lib/storedMediaUrl.ts`, `common/lib/channelConfig.ts`, `common/lib/channelConfigSchema.ts`,
-`common/lib/downloadOutcome.ts`, `common/lib/mediaTier.ts`, `common/jobs/unitOutcome.ts`,
-`common/controller/autoRunner.ts`, `common/testing/web/fakeRangedCdn.mjs` (+ `.d.mts`, new),
-`common/testing/audio/corruptAudio.mjs` (`faststart`), `editor/app/api/ops/_storedUrl.ts` (new), the
-`transcribe-one`, `retry-bucket`, `download-missing` routes, `editor/app/channels/[slug]/pipelineActions.ts`,
-`editor/app/channels/[slug]/videos/[id]/videoActions.ts`, `…/[id]/page.tsx`, `…/components/VideoPanel.tsx`,
-`…/cards/RedownloadSection.tsx`, `editor/app/channels/components/{ChannelForm.tsx,parseChannelForm.ts,channelConfigToForm.ts}`,
-`editor/app/jobs/jobReplayRegistry.ts`, `scripts/archilyzer-ops.mjs`, `COMMANDS.md`, `CHANNEL.md`.
-Tests: `common/ytdlp/storedUrlDownload.test.ts` (14), `common/ytdlp/storedUrlManaged.test.ts` (10),
-`common/jobs/unitOutcome.test.ts` (+1), `common/ytdlp/managedDownloadsSleep.test.ts` (+2), `common/lib/mediaTier.test.ts`
-(+2 rows), `editor/app/api/ops/retry-bucket/route.test.ts` (+1), `editor/app/channels/components/parseChannelForm.test.ts`
-(+1), `editor/e2e/stored-url-downloads.spec.ts` (2).
-
-| Commit | What |
-| --- | --- |
-| `066702da` | common: the ranged downloader + the audio check over it; `storedUrlDownloads`; `stored-url-ranged`; the fake CDN |
-| `e750f34a` | common: the managed download's never/fallback/only, the 20-minute gap, never a clean settle (batch, lane) |
-| `9d6d6c6d` | editor: `storedUrl` on the three ops routes and actions, the held door, Transcribe through the managed path; ops help, COMMANDS.md |
-| `2689b720` | editor: the Configure field, the video page's option, the e2e spec |
-| `01717bf5` | common: the player's page opened first (and again on a refusal after served bytes); the key-count test |
-| (this commit) | this record, FACTS, CHANGELOG |
-
-## Gates
-
-All through the shared heavy lock, from the worktree root, at `01717bf5`:
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean (0 errors).
-- common: 4510 at the branch's start (4507 pass, 2 fail, 1 skipped — that run overlapped my first edits; the two were
- this lane's own, the channel-config key count and an undeclared env var, both fixed) → **4537 (4536 pass, 0 fail,
- 1 skipped)**.
-- editor unit: 331 → **333/333**.
-- test:scripts: **1052 (1048 pass + 4 skipped)**, unchanged count (ops help text only).
-- mcp: **377/377** (not touched; run once at `2689b720`).
-- `docs cli --check`, `docs files --check`, `docs env --check`: clean; `settings example --check` clean at `2689b720`
- (no settings change).
-- e2e `stored-url-downloads.spec.ts`, foreground: run 1 at `2689b720` 2/2 passed (17.4 s, start-mode build 64 s); run 2
- at `01717bf5` 2/2 passed (11.8 s, rebuild 56 s).
-
-## Rulings followed
-
-Opt-in (default never), the allowlist of one platform and its CDN hosts (R5's), one stream with real gaps (one new
-file per rest), the audio check keyed on the PAGE url, no model and no live network in any test (a fake CDN on
-loopback, a synthetic recording). Records state rulings.
-
-## Owed
-
-- The real page opener has never run in a test (by rule); the first live run is its proof. If the unlock turns out
- shorter than an 8 MiB read, every chunk would re-open (each open is ~18 s): the log says so.
-- The clip cut (fetchWindowManaged's ffmpeg path) does not open the page; `openPlayerPage` is exported for it.
-
-- The lane does not PICK units on a held or cooling platform even with `storedUrlDownloads: "only"` (the batch door
- lets them through; the lane's scheduler is unchanged).
-- The clip cut (fetch-windows, `clip-window:<platform>`) and the full download (`stored-url:<platform>`) keep separate
- gaps; a cut and a download within 20 minutes of each other are not spaced by this.
-- A yt-dlp `audio.<ext>.part` (and `.part.good`) left by a rate-limited audio-checked primary before a `fallback` is
- not adopted (its bytes may be of another format); it stays as scratch beside the stored partial.
diff --git a/plans/release-32/ops-buttons.md b/plans/release-32/ops-buttons.md
@@ -1,111 +0,0 @@
-# Release 32, lane R3 — every operation has a button, in the editor (as shipped)
-
-Branch `r32/ops-buttons` from `main` `977917c7`. Brief: `r32r3-brief.md` (the plan of record for this lane). FACTS:
-"Release 32 lane R3: every operation has a button" (and the Configure-form line of "The audio check's reach").
-
-## What and why
-
-The operator's rule for the release: every step a model or the CLI can do must also be doable by a person in the UI,
-and nothing built here calls a model. Each gap the brief named, verified, now has a surface where its object lives.
-
-- **Frame scan, with no model** (`common/lib/frames/corrections.ts`, `controller/frameCorrections.ts`; the video
- page's Frame scan panel): **Re-derive (no model)** beside the hero's screen name (the panel's action refused
- `rederive` before), and **Correct a reading** — open the reading at a time, or from an event's **Correct**
- (`?reading=<s>`), set fields to what the frame shows or **Mark misread**, **Clear correction**. A correction is kept
- in the sidecar's `corrections` beside the model's readings (never over them), only the fields that differ from the
- model's reading; the derivation lays the corrections over the readings (duplicates copy the corrected reading, a
- misread is copied nowhere) and every scan and re-derive keeps them. Saving re-derives at once. P2's guarantees hold:
- the poker rules are untouched, a corrected value goes through the same smoothing and flags.
-- **find-copy's scope mode** (`app/components/FindCopiesControl.tsx`, on the channel's Download stage and
- `/sites/<id>`): which gone videos, at most N lookups, try failed copies again; **Preview** is the dry-run job, its
- `@@find-copy` line read into the candidate list with the copy each would use; **Find and fetch copies** is armed by
- a preview of the same settings and links the find-copy and fetch-copies jobs.
-- **The audio audit** (Download stage, `audioAuditActions.ts`): scope, at most N files, decode again; the line is the
- channel report's new `audioIntegrity` tally (clean, damaged, undecodable, out of date, last checked). The video page
- shows the file's verdict (`describeIntegrity`, the gaps, out of date when the file changed).
-- **The video's media operations** ("Media tools", `mediaToolsActions.ts`): attach from a local archive (attach-media
- narrowed to this id: `items` when a file is named, else `match` = the escaped id; preview then attach), a playable
- copy (prepare-playable `ids: [id]`), and for a Wayback or archive.org record the channel's records refreshed
- (`refreshWaybackRecords` / `refreshArchiveOrgRecords` in the request; preview then refresh; a Wayback record's title
- and date as `titles`).
-- **reports attach-video** (Articles tab, `sites/lib/attachVideoAction.ts`): per article, a video file, poster and
- caption → an `attach-report-video` job (new kind, queue `report-video`).
-- **The rest of COMMANDS.md's channel-level ops-only rows**: the Download stage's "More ways in" (import-archive-org
- one item, preview then import; feed-metadata, preview then complete; remote-listing on Odysee/BitChute), a posts
- channel's import-post and capture-posts, the Cleanup stage's **Keep videos matching** (keep-videos; preview then
- keep).
-- **The Configure form's audio check**: an Odysee channel with no `audioCheck` shows ticked, "on by default for
- Odysee"; ticked with nothing else writes nothing, unticked writes `{enabled: false}`; `channelConfigToFormData` ticks
- it the same way, so `pnpm ops channel-config` keeps the default and `{"audioCheckEnabled": false}` turns it off.
-- `StreamActionLog.onSettled` also hands over the run's log and job id (`{log, jobId}`), so a dry run's result marker
- can be read (`app/lib/resultMarker.ts`).
-
-| Commit | What |
-| --- | --- |
-| `d1575e95` | common: reading corrections (lib + controller), `frameScanBusy`, the snapshot's `audioIntegrity` tally; tests |
-| `68fc0cc7` | editor: the Frame scan panel's Re-derive and Correct a reading, the view's hero/corrections, `?reading=` |
-| `e7480d7c` | editor: find copies (channel + site), Audit audio, the video page's verdict line and Media tools, `onSettled` out, resultMarker |
-| `aa95ddb9` | editor: Attach video on each article; the `attach-report-video` job kind |
-| `9aeb1e20` | channels: the Odysee audio-check default on the Configure form and in the ops patch |
-| `790a72f5` | channels: archive.org import, feed backfill, remote listing, import-post, capture-posts |
-| `1ed526da` | channels: Keep videos matching |
-| `d406c560` | editor: `e2e/ops-buttons.spec.ts` |
-| (this commit) | this record, FACTS, CHANGELOG |
-
-## Gates (from the worktree root, every heavy step through the shared lock)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean (editor's tsc before each editor commit, the
- full workspace before the spec commit and at the end).
-- common: 4448 (4447 + 1 skipped) at the branch's start → 4455 (4454 + 1 skipped), all pass. New: `lib/frames/corrections.test.ts` 5,
- `controller/frameCorrections.test.ts` 2; `controller/audioAudit.test.ts` (the tally asserted in the report test);
- `jobs/jobKinds.test.ts` pins the new kind. `lib/frames/*` 87/87 with the new files.
-- editor unit: 322 → 327/327 (`lib/resultMarker.test.ts` 2, `frameScanView.test.ts` +1,
- `parseChannelForm.test.ts` +2).
-- `docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check`: clean (no CLI row, ops
- key, env or settings key changed; COMMANDS.md not regenerated).
-- e2e (editor, one spec, through the lock): `ops-buttons.spec.ts` **4/4 passed** in 20.9 s on its first run (the
- start-mode build in the heavy slot first: TypeScript 33 s; the slot waited 1 m 52 s and 3 m 25 s behind another
- project's jobs) — find-copy preview (a gone non-YouTube record: listed, no network), Audit audio (the fake
- ffmpeg's damaged file: the job's `@@audio-audit`, the tally on the Download stage after the regen, the verdict on
- the video page), Re-derive then Mark misread from an event and a field corrected, the Odysee audio-check default.
-- test:scripts, mcp, export, homepage, umtool: not run — nothing under `umtool/`, `scripts/`, `mcp/`, `export/` or
- `homepage/` changed, and the common changes they import (`deriveOf`, the frame-scan sidecar's coerce) change
- nothing for a sidecar without `corrections`.
-
-## Decisions I made
-
-- **Corrections live beside the readings, and the derivation reads both** — the model's readings stay as read, so a
- correction can be cleared and the record says who said what. Only differing fields are stored, so the form can
- send every field it shows.
-- **A correction does not bypass the derivation's rules** (P2: "keep the guarantees"): the person's value replaces
- the model's in the reading, and smoothing, flags and the one-tournament rule apply as before. To take a reading out
- entirely, Mark misread.
-- **"Hero name" is the record's hint, not a reading field** (a reading has no hero name): it sits beside Re-derive,
- as `frame-scan {rederive, hero}` takes it.
-- **No ops key for corrections**: the brief asks UI for what the CLI does, not the reverse; the controller is
- callable if an agent needs it later.
-- **Corrections re-derive in the request and are no job** (as `rederive` is): pure code over one sidecar.
-- **The Wayback / archive.org refreshes run in the request**, not as jobs: offline, over one channel's records, and
- the controller already skips a record a live job holds. They are channel-wide (as the CLI) though offered on the
- video page of such a record; a rename links the new id.
-- **The audit tally is in the snapshot**, read where the `corruptHeldAudio` bucket already reads each sidecar — no new
- walk; it shows after the job's regen (the e2e polls for it).
-- **Attach video is a job on its own queue `report-video`** (an encode takes minutes), not gated by the heavy slot:
- `attachReportVideo` spawns ffmpeg itself and the CLI row never was; a ≤24 MiB output is a short encode.
-- **find-copy's Run is armed by a preview of the same settings** (the evict pattern), and runs its lookups again —
- the preview is not replayed (a copy may have appeared or gone since).
-- **The Odysee default**: ticked with no other audio-check field saves nothing (the default), so saving an Odysee
- channel's form never writes `{enabled: true}` it did not have; a stored `{enabled: true}` with no other field is
- saved as no key — the same behaviour.
-
-## Not done, and why
-
-- Channel-wide `media attach` (a whole archive, `--create-records`) and channel-wide `media playable`
- (`--trackers`, `--root`): the buttons are per video; the channel-wide runs stay `pnpm ops attach-media` /
- `prepare-playable`.
-- `feeds backfill-metadata --feed <url>` (another feed than the channel's URL): the button reads the channel's URL.
-- `persist-videos` in bulk: the video page's existing Persist source video covers one video.
-- `storage migrate-tier` (runs only with the editor stopped), `reconcile video-dirs` (every report regen runs it),
- `verify transcripts` and `diarize backfill` per video (passthrough diagnostics; the Cleanup stage's Diarize speakers
- covers a channel): left on the CLI.
-- No live run (the orchestrator's).
diff --git a/plans/release-32/owed-ui.md b/plans/release-32/owed-ui.md
@@ -1,94 +0,0 @@
-# Release 32 lane R6: the owed UI (as shipped)
-
-Branch `r32/owed-ui` from `main` `23ea764b`. Brief: `r32r6-brief.md` (the plan of record for this lane). FACTS:
-"Release 32 lane R6: the owed UI".
-
-## What and why
-
-The operator's rule for the release: everything a model or the CLI can do, a person can do in the UI. Three items
-were owed after R5 and the release's smoke.
-
-- **"Cut from the stored media URL" wherever a window is fetched** (R5 shipped `fetch-windows {storedUrl}` with no UI).
- One label, one help line and one mode for every surface (`lib/storedMediaUrl.ts`: `STORED_URL_LABEL`,
- `STORED_URL_HELP`, `STORED_URL_UI_MODE = "fallback"`). Off by default, offered only where it can do something:
- - the editor's **Fetch missing evidence** (Reports and Articles tabs): once a preview — which now always counts the
- stored URLs, "odysee: N window(s) on clips:odysee · M with a stored media URL" — or a refused run shows windows on
- a stored-URL platform;
- - umtool's **Fetch clip** (`CitedClip`: the article evidence panel, the drafts deck, the audition deck), the
- research reader's Fetch clip, the clip bench's fetch-more row, the claim bench's fetch, and **Fetch N unfetched
- clips** on the Cut tab — each when the record stores one (`GET /api/cited/stored`, `lib/clips/stored.ts`).
- - `POST /api/media/fetch-window` takes `storedUrl` (the batch's rule for one window; fallback waits the clip gap
- after the page's 429), and the MCP's `fetch_clip` passes it through. `instructions.ts` lists no tool fields, so
- it is unchanged; the tool's schema describes the field.
-- **The Inbox at ~380 px**: a row's four fixed columns (56 + 190 + 112 px and gaps) left the title no width. Under `sm`
- the row now wraps — the title and why on the first row (two lines each at most), the count, the action and
- Park/Mute on the second; from `sm` up, the grid as before. Shots: `$T/shots/r32r6-inbox-{380,520}-{before,after}.png`
- and `r32r6-inbox-1366-after.png` (the e2e fixture's inbox).
-- **The bulk CLI-only rows get buttons where their object lives**:
- - the channel's Cleanup stage, **Media for the whole channel**: **Attach media from a local archive** (`media
- attach <slug> <source>` — only names matching, create records, replace) and **Playable copies** (`media playable
- <slug>` — trackers, folder). Both preview first (the job's dry run), the run is armed by a preview of the same
- settings, and the job's `summary:` line is said in plain words with the job linked.
- - **Save these videos** on `/saved-videos` (`persist-videos`): one video per line (`slug/id` or a video page
- link), quality, replace a taller one; Preview answers with the plan's buckets, Save starts one job per channel
- and links each.
-
-| Commit | What |
-| --- | --- |
-| `632ec204` | editor: the option on Fetch missing evidence; `storedUrl` on the single fetch-window route (+ Retry); the UI's words in common |
-| `0e98e714` | mcp: `fetch_clip` takes `storedUrl` |
-| `93c9ee69` | umtool: the option beside every window fetch; `/api/cited/stored`; `fetch-via-editor.mjs --stored-url` |
-| `c7709fb0` | umtool: the Inbox's rows wrap under `sm`; `e2e/stored-url.spec.ts` and its fixture |
-| `f3b26188` | editor: channel-wide attach and playable copies, Save these videos |
-| (this commit) | `e2e/owed-ui.spec.ts`, this record, FACTS, CHANGELOG |
-
-## Gates (from the worktree root, every heavy step through the shared lock)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean.
-- common: 4508 (4507 + 1 skipped) before and after (only constants added).
-- editor unit: 331 → 340, all pass (`api/media/fetch-window/route.storedUrl.test.ts` 5,
- `saved-videos/lib/videoList.test.ts` 2, `channels/[slug]/lib/mediaToolsWords.test.ts` 2).
-- mcp: 377 → 378 (`fetchClip.test.ts` +1; the tool-schema test lists `storedUrl`).
-- umtool: 42 → 45 (`lib/clips/stored.test.ts` 2, `cited.test.ts` +1).
-- test:scripts: 1052 → 1053 (1049 + 4 skipped; `fetch-via-editor.test.mjs` +1).
-- `docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check`: clean (no CLI row, ops
- key, env or settings key changed).
-- e2e, umtool: `stored-url.spec.ts` 2/2 (with the before shots, 4/4 in 14.8 s); `inbox.spec.ts` 13/13 with the after
- shots (15/15 in 22.4 s); on the final tree `stored-url.spec.ts` 2/2 with the 380/520/1366 shots (5/5 in 14.7 s).
- The shots spec was a scratch file, not committed.
-- e2e, editor: `owed-ui.spec.ts` — run 1: 2 passed, 1 failed (the attach preview found no id: the spec's id was not
- the eleven characters attach-media matches, and its archive was written outside the test corpus — both fixed in
- the spec); run 2: **3/3 in 10.8 s**.
-
-## Decisions
-
-- **A person's tick asks `fallback`, never `only`.** Fallback asks the page first and uses the stored file only when
- the platform refuses (or is held or cooling, when it goes straight to the file), so a tick on a platform that is
- answering changes nothing. `only` stays for the CLI and the MCP.
-- **Offered per record, not per platform.** umtool asks whether the record stores a trusted URL (which implies an
- allowlisted platform); the editor's batch offers it when the preview counted windows with one, or a refused group
- is on an allowlisted platform. A Preview always asks with the mode — a dry run starts nothing — so R5's
- "storedUrlItems only when a mode was asked" contract stands.
-- **The single window's fallback waits `CLIP_WINDOW_MIN_GAP_SECONDS`** (30 s; `E2E_CLIP_WINDOW_GAP_MS` in tests)
- between the page's 429 and the stored-URL cut, the batch's least clip gap. The single route has no gap state of
- its own; this is the "one stream, real gaps" rule for its one retry.
-- **The research reader got the option too** (not named in the brief, but it fetches windows): only when the cited
- record is in the editor's own corpus and stores a URL.
-- **Bulk tools live with the store.** Channel-wide attach and playable copies are on the Cleanup stage beside
- "Retention & persistence" (both write into, or beside, the saved-video store; the Download stage is hidden for a
- channel with no URL, which is exactly the channel a local archive serves). The cross-channel persist list is on
- `/saved-videos`.
-
-## Not done
-
-- No new video-page window fetch in the editor (there is none to put the option on; the batch and the single route
- cover the paths).
-- The full editor and umtool suites (the orchestrator's).
-
-## Live after merge (the orchestrator)
-
-No data step is owed. Rebuild and restart both apps through their units; then smoke: `/sites/articles` → Preview
-missing evidence (an Odysee window with a stored URL shows the count and the option); an umtool article's evidence
-for an Odysee citation not on disk shows the option under Fetch clip; `/saved-videos` → Save these videos → Preview
-with one `slug/id`; a channel's Cleanup stage → Media for the whole channel → Preview playable copies; the Inbox at a
-phone width.
diff --git a/plans/release-32/ranged-resume.md b/plans/release-32/ranged-resume.md
@@ -1,111 +0,0 @@
-# Release 32 lane R10 — a stored-URL download survives mid-file network drops (as shipped)
-
-Observed live (2026-10-17, one 3.3 GB Odysee file): the page opened (18 s, the player's reads 200/206), the ranged
-8 MiB reads ran ~4 min to 344 MB, then `the ranged read at 343932928 failed: fetch failed` (undici, no HTTP status).
-The resume (page reopened) restarted at the last probed-clean byte, 277 MB, read ~100 MB in under a minute, and failed
-the same way at 377 MB. R7 reopened the page only on a 429; a network drop ended the job and, under R8, spent one of
-the two full-audio attempts.
-
-## What
-
-- **A dropped connection is a continuation of the same file** (`common/ytdlp/storedUrlDownload.ts`,
- `continueSameFile`). Within one run, these go on with the same file: a mid-file network failure (the fetch throwing:
- `fetch failed`, ECONNRESET, socket hang up, ETIMEDOUT; the body read throwing: `terminated`, an aborted body; a 2xx
- with no bytes) and a 429/403 that follows bytes served since the last page open (R9's rule). A continuation is not a
- new file and not a spent attempt:
- 1. The next probe is brought forward (audio check on). A clean verdict makes the drop point the last clean byte. A
- malformed one is the usual roll-back, counted against `maxRollbacks`. Under the size gate, or before the container
- can be opened at all, the bytes stay unjudged, as between any two checkpoints.
- 2. The resume state is saved.
- 3. A pause of `STORED_URL_DROP_PAUSE_MS` (45 s, abortable).
- 4. The player's page is reopened (the injected opener; none when null).
- 5. The read goes on from the resume point.
-- **The limit:** at most `STORED_URL_MAX_DROPS` (6) continuations since the last progress, where progress is the
- resume point passing the run's furthest so far, and progress resets the count. The next drop gives up with the
- partial and its state kept, as `network` (or `rate-limited` for a refusal). **A 429 straight after an open still
- gives up at once** (no second open), including the open that followed a drop.
-- **The log**, one line each: `Connection dropped at <bytes> — reopening the page and resuming (k of N): <error>.
- Pausing 45 s; resuming from <bytes> bytes (the last probed-clean byte).` A refusal: `HTTP Error 429 at <b> bytes
- after <n> served since the page was opened — opening it again and resuming (k of N): …`. Giving up: `… — 6
- continuations since the last progress; giving up with the partial kept at <bytes> bytes: <error>`.
-- **The 20-minute new-file rest does not apply to a continuation**: it is waited before the call and noted at its
- start and end (`downloadOneManaged`), never between continuations inside it.
-- **R8's attempt count is unchanged:** however many continuations it took, a run is one `stored-url-ranged` attempt.
- A run that made progress and then ran out of drops counts as one of `FULL_AUDIO_ATTEMPTS`, as before. The attempt
- records `storedUrl.continuations` (> 0 only).
-- A failed write of the partial (the disk) is not a drop: no retry, `network` with "writing … failed".
-- **Test kit:** `testing/web/fakeRangedCdn.mjs` cuts the connection, either mid-body or before any response:
- `dropAfterBytes`, `drops`, `dropGapBytes`. `cdn.lock()` takes an unlock back. The fake is now in the testing README.
-
-## Files
-
-`common/ytdlp/storedUrlDownload.ts`, `common/ytdlp/storedUrlPageOpen.ts` (`abortableWait` exported),
-`common/ytdlp/downloadOneManaged.ts` (the attempt's `continuations`, a comment), `common/lib/downloadOutcome.ts`
-(`StoredUrlAttempt.continuations?`), `common/testing/web/fakeRangedCdn.{mjs,d.mts}`, `common/testing/README.md`,
-`editor/CHANGELOG.md`, `plans/FACTS.md`.
-Tests: `common/ytdlp/storedUrlDownload.test.ts` (+6, and the lapse test's pause zeroed with two more assertions),
-`common/ytdlp/storedUrlManaged.test.ts` (+2).
-
-| Commit | What |
-| --- | --- |
-| `9755b0fe` | common: the continuation (probe forward, pause, reopen, resume from the last clean byte; the no-progress limit), the attempt's `continuations`, the fake CDN's cuts, the tests |
-| (this commit) | this record, FACTS, CHANGELOG |
-
-## Gates
-
-Everything ran through the shared heavy lock (`r31-locked.sh`) from the worktree root, at `9755b0fe`:
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean.
-- common: 4594 at the branch's start (4593 pass + 1 skipped: `main` `17207fb8` is R8's gated tree `d135dee1`, the same
- tree, so it was not run again) → **4602 (4601 pass, 0 fail, 1 skipped)**.
-- The two touched files alone first: `storedUrlDownload.test.ts` + `storedUrlManaged.test.ts` **35/35** on the first
- run (real ffmpeg present, nothing skipped).
-- editor unit: **346/346** (unchanged count; nothing in the editor changed but the CHANGELOG).
-- `docs files --check`, `docs env --check`: clean. No CLI row, env var, settings or file schema changed (`docs cli`,
- `settings example` not needed). mcp, test:scripts and umtool are not touched and were not run.
-- e2e: none. No UI changed; the behaviour shows only in a job's log and the outcome record.
-
-## Rulings followed
-
-- R7's: one stream, real gaps. A continuation pauses 45 s and reopens the page; it never runs two reads at once, and
- "a 429 straight after an open gives up" still holds.
-- R9's: a 429 after served bytes opens the page again. It now pauses first and counts toward the same limit.
-- R8's: `FULL_AUDIO_ATTEMPTS` counts runs. A run exhausted by drops is one attempt, as the brief asked and as before.
-- No model, and no live network or browser in any test (a fake CDN on loopback, an injected opener, a recorded fake
- pause). Records state rulings.
-
-## Decisions I made
-
-- **The probe is brought forward at a drop.** The brief says to resume "from the resume file's last clean byte". With
- the audio check on, that byte trailed the drop by up to one probe interval: live, 344 → 277 MB. Probing at the drop
- makes it the drop point whenever what came down is clean. A malformed verdict rolls back, as any checkpoint does.
-- **Unjudged bytes are kept across a continuation.** That covers bytes under the size gate, and bytes before an MP4
- whose index is not down yet can be opened at all. Truncating them would lose the same bytes again at every drop, and
- a file whose container cannot be opened before its end could never progress. Within one run those bytes are an
- in-order prefix of the server's answer, the same trust the loop already gives bytes between two checkpoints, and
- the next probe judges them. The resume FILE still records only the clean byte, so a later run truncates to it, as
- R7 did.
-- **Progress is the resume point passing the run's furthest resume point**, not "some bytes were read". A drop whose
- bytes are rolled back (malformed) is not progress, and the count terminates. A limit of 6 means: the first drop
- after progress is 1 of 6, five more with no progress are 2–6, and the seventh gives up.
-- **A refusal after served bytes pauses too**, as the brief's "same for a 429 that follows bytes" reads. The 45 s is
- extra politeness on a CDN that just refused.
-- **A 2xx with no body bytes is a drop**, the brief's "aborted body". **A failed write is not**: no retry for a full
- disk.
-- **No opener (a non-Odysee platform):** a drop still pauses and resumes, without a page open. A 429 with no opener
- gives up at once, as before (R9's rule is about the open).
-- The managed download's test seam `sleep` waits out both the gap and the pause. The test that asserts no rest is
- waited relies on that.
-
-## What the live run must confirm
-
-- The first live drop says `Connection dropped at <bytes> — reopening the page and resuming (1 of 6): the ranged read
- at <bytes> failed: fetch failed (…)` and the next reads go on from that byte, or from the last clean byte. The
- attempt's `storedUrl.continuations` counts them.
-- If the CDN drops faster than one probe per drop can follow, each continuation costs a probe of the whole partial
- (ffmpeg decodes it) plus 45 s plus a page open (~18 s). The log shows the probe durations
- (`DLOM_PROBE status=done durationMs=…`).
-
-## Owed
-
-- The clip cut (fetchWindowManaged's ffmpeg path) is not touched: a window is short and ffmpeg reads it in one
- request, so a drop there is still a failed window.
diff --git a/plans/release-32/review-player.md b/plans/release-32/review-player.md
@@ -1,82 +0,0 @@
-# Release 32 lane R1 — verify by playing the citation: the cited clip, the audition deck, the article's checks (as shipped)
-
-Operator asks (2026-10-16): "can we not play the citation audio in the umtool review screen? We should be able to play
-the video, even, to verify it — that's the only point it should need to hit a human"; then, for the drafts review,
-"similarly to a mobile app like Tinder … move fast when auditing clips … the perfect mix of AI heavy lifting with a
-human auditing ear". The release rule: every step a model can do, a person can do in the UI; verification needs no
-model. Rulings followed: the drafts review becomes a one-card deck (keep → / cut ← / edit ↑ / skip ↓, undo z, space
-replays), the list one toggle away; decisions through the existing `drafts.review.json` writer; the CLI's
-`verify-quotes --article` and `check --article` as buttons running the same functions in-process.
-
-## What
-
-- **The cited clip** (`components/clips/CitedClip.tsx`, `lib/clips/cited.ts`): a span plays VIDEO first (a project's
- cached window, a corpus clip window, a saved video), else audio labelled "audio only"; **Play span** plays from the
- span's start and stops at its end; with nothing on disk, **Fetch clip** asks the editor's fetch-window exactly as
- the MCP's `fetch_clip` does (`requestedBy: "umtool"`), polls, and plays what lands; a failure is said plainly (a
- rate limit; corrupt audio from the audio check). Two faces: `panel` (native controls) and `card` (no chrome, tap
- replays, a span-only scrubber). Its buttons never take focus and the media gives focus back, so a page's keys keep
- working. Mounted in the evidence panel (so the article reader and the evidence walk get video-first and Fetch clip;
- the walk's space plays the span) and in the drafts list's reader.
-- **The audition deck** (`components/projects/review/AuditionDeck.tsx`), the default of `/projects/<id>/review`: one
- card per field awaiting review — the drafted value (Archivo, large), the span autoplaying after the first "Start
- review" gesture, the LIT LINE (the quote in the reader serif, each word underlined in Signal as playback reaches
- it; `lib/clips/words.ts` `spokenWords` spreads each cue's words over its span and finds the quote's words in
- order), the source and "drafted by". Swipe (30 % of the width or a 0.6 px/ms flick), key or button: KEEP approves,
- CUT rejects (a reason chip or a few words, else "cut on the deck"), EDIT rewrites on-screen text / narration /
- teaser lines / the YouTube title on the card (Enter keeps it as edited; other fields link the Media tab), SKIP goes
- to the back, z undoes keep/cut/skip (20 deep). Tapping a word marks it misheard ("misheard: …" in the note; on Edit
- a "fix this mishearing" link to the article's Iterations tab with `heard=`, where R2's form prefills it). The next card is rendered underneath with its
- media preloading; the card after the next has its play lookup warmed. The decided card flies out as a picture
- (160 ms; 80 ms fade with reduced motion) so no key is lost to the animation. Counter `n / N · k kept · c cut · s
- skipped`; the end is a summary listing cut and skipped, "Review the skipped ones", "Review the cut ones again",
- "Back to the Media tab". `?view=list` is the list (j/k, a, r), its reader now with the player.
-- **The drafts route's `edit` action** (`lib/report/draftEdit.mjs`): text → value, written through
- `writeDraftedField` as the operator's; a field still under review after the write (a narration) is approved.
-- **Verify quotes / Check report** on the article page (`components/articles/ArticleChecks.tsx`, mounted with one line
- in `ArticlePage.tsx`'s article line; `lib/articles/checks.ts`; `POST /api/articles/checks`): per quote its status,
- score, track, en-orig score, message and a **Play**; check's pass/fail summary, allowed and warning lines, each
- problem with its sentence and a **Play** where it names a citation; "allow missing media". In-process, no model.
-- **common:** `checkReports` (reports-check.ts) returns `reports check`'s findings as data; `checkMain` prints it,
- byte-for-byte as before.
-
-## Files
-
-common: `bin/reports-check.ts`, `bin/reports-check.test.ts`. umtool: `lib/clips/{types.ts, cited.ts, words.ts,
-cited.test.ts, words.test.ts}`, `app/api/cited/{play,fetch}/route.ts`, `components/clips/CitedClip.tsx`,
-`components/articles/{EvidencePanel.tsx, ArticleChecks.tsx, ArticlePage.tsx}`, `lib/articles/{evidence.ts,
-checks.ts}`, `app/api/articles/checks/route.ts`, `components/projects/{ReviewPage.tsx, MediaDrafts.tsx,
-ProjectView.tsx, review/AuditionDeck.tsx}`, `app/api/report/drafts/route.ts`, `lib/report/{draftEdit.mjs,
-draftEdit.test.mjs}`, `lib/hrefs.ts` (`reviewHref(p, {view})`), `package.json` (test glob `lib/clips/*.test.ts`);
-e2e `review-player.spec.ts`, `fixtures/review-player-fixture.mjs` (+ registered in make-fixture.mjs), and
-`draft-review`, `bench-shell`, `running`, `visual-audit` specs opening `?view=list`. FACTS.md, CHANGELOG.
-
-## Interfaces
-
-- `GET /api/cited/play?channel&video&from&to[&project&clip][&audio=1]` → `{play: CitedPlay | null, fetchLine}`.
-- `POST /api/cited/fetch` `{channel, video, from, to, reason?, report?, project?, clip?}` | `{job, …span}` →
- `{state: "ready", cached, play} | {state: "queued", job, status} | {state: "failed", message, detail?, job?}`.
-- `POST /api/report/drafts` `{project, action: "edit", address, text, note?, token?}`.
-- `POST /api/articles/checks` `{site, report, what: "quotes" | "check", allowMissingMedia?}`.
-- `checkReports(opts): Promise<ReportsCheckResult>` (common/bin/reports-check.ts).
-- `/projects/<id>/review?view=list`; the deck links the article's Iterations tab with `?tab=iterations&heard=<words>`
- for R2's "Fix a mishearing" form.
-
-## Gates
-
-tsc clean (all packages) before each commit and after merging `main` 45c5a583; umtool unit 42 (was 33: +6 words,
-+3 cited); common 4456 tests, 4455 pass, 1 skip (after the merge; +1 `checkReports`); test:scripts 1049, 1046 pass,
-3 skip (+4 draftEdit; the umtool build-trace test ran and passed); umtool `next build` with the corpus linked:
-clean. After the merge: review-player + draft-review 5/5. e2e (umtool, single specs, fixture run): review-player 2/2;
-draft-review + bench-shell 9/9; running + article-evidence 7/7; visual-audit + review-player 67/67. Screenshots of the
-deck at 390 and 1366 px and of the checks: `$T/shots/r32r1-*.png`.
-
-## Decisions
-
-- Word timing spreads each cue's words evenly over the cue (no transcript shape in the corpus carries word offsets;
- a parakeet `transcript.json` has chunk times only); fewer than half the quote's words found → even spread.
-- The writer still requires a rejection note; the deck writes the chosen reason or "cut on the deck".
-- An edit is not undone with z (it is a manifest write with a snapshot; the History tab restores it).
-- A field without a clip has no "cited moments" chips: nothing links such a field (YouTube text, a social post) to
- moments today.
-- Mishearing marks are kept in the session and written into the verdict's note, not a new file.
diff --git a/plans/release-32/rulings.md b/plans/release-32/rulings.md
@@ -1,136 +0,0 @@
-# Release 32 lane R8 — the operator's rulings of 2026-10-17 (as shipped)
-
-Branch `r32/rulings` from `main` `eb8d9523`. Brief: `r32r8-brief.md` (the plan of record for this lane).
-FACTS: "Release 32 lane R8: the operator's rulings of 2026-10-17", plus the rulings recorded in place under "Release 30
-lane V" and "Release 31 lane C".
-
-## The rulings
-
-1. **Verdict bench v3 — (a) only.** The meanings reversal is kept (a claim with a part the evidence does not show is
- PARTLY; REPORT.md's definitions as bench v3 regenerated them). Dedupe is NOT the default: a fresh bench asks every
- claim, and dedupe stays available as an explicit option. No paid run.
-2. **Wayback-only citations are OK on public sites** (a YouTube original with only a Wayback copy, cited as
- "Original (may be gone)" + the Wayback link — release 31 C). No code.
-3. **Build the Wayback "found" check.**
-4. **Partial transcripts: marked, but full audio first.**
-
-## What
-
-- **1, the bench.** `r30/bench-v3` (`acc876a4`) merged in (`a410f413`; the CHANGELOG conflict kept both sides).
- `benchItemsOf`'s `dedupe` is now off unless `true`; `BenchOptions.dedupe` → `--dedupe` (CLI), `"dedupe": true`
- (`bench-verdicts` body, checked a boolean at the door); validated (never with `itemsFrom`); a run made with it records
- `summary.dedupe: true`, and a continuation that names another setting is refused; a run made from `itemsFrom` carries
- its source's setting. The editor's bench and M8 proposal tests answered in v2's shape and failed after the merge (bench
- v3's lane did not run the editor suite); their stubs answer in v3's (parts, checkable, reason). V's record
- (`plans/release-30/V.md`) carries the ruling; FACTS' V section says default off and the reversal kept.
-- **2, Wayback-only citations.** Recorded in FACTS where find-copy and `waybackCitationLinks` are described.
-- **3, the Wayback found check** (`lib/waybackClient.ts`, `lib/archiveOrgClient.ts`, `publish/findCopy.ts`): a video
- the Wayback video index lists is a copy only when one of its formats' streams answers a ranged GET at yt-dlp's own
- URL (`/web/2id_/<format url>`, archiveorg.py `_parse_fmt`) — one `bytes=0-1023` request per format, at most 3, through
- the paced archive.org client (`ArchiveOrgClient.probe`: the chain, the 2 s gap, the back-off; the body cancelled).
- Listed with no answering stream → `page captured, no video (the video index lists N format(s); M probed, HTTP …)`:
- not a copy and not a lookup error, so archive.org is tried next and, with nothing there, the video is recorded
- `none-found` in `copy-attempts.json` — never handed to fetch-windows / fetch-copies to fail at its source. A probe
- Wayback keeps refusing is a lookup error (tried again later, nothing recorded). The article mode now records
- `none-found` as the scope mode does (a YouTube recording, no copy, no lookup error, not a dry run). The fake Wayback
- (`testing/web/fakeWayback.mjs`) serves streams (`streams`, default `videos`; `streamBusyTimes`).
-- **4, full audio first** (`lib/fullAudioFirst.ts`, `lib/fullAudioFirst-server.ts`, `controller/fullAudioFirst.ts`):
- `FULL_AUDIO_ATTEMPTS` = 2; an attempt is a `stored-url-ranged` attempt on the video's download record (a refetch
- appends its attempts to the corrupt-full-source record; refusals count). It applies to a corrupt full source whose
- record stores a trusted media URL (`storedMediaUrl`, STORED_URL_PLATFORMS), on a transcribe-handling channel, with a
- stored-URL mode other than `never` (the request's, else the channel's `storedUrlDownloads`).
- - **The refetch** (`downloadOneManaged`): a corrupt-full-source refetch with no mode asked (request or channel) runs
- as `storedUrl: "only"` while attempts are owed — R7's ranged reader, its audio check, its page open and its
- 20-minute gap — then from the page as before. `retry-bucket corruptFullSource` therefore reads the stored URL first.
- - **The salvage gate** (`transcribeOneVideo`): an automatic salvage (no `salvage` given) of such a video with attempts
- owed is refused as `TranscribeError("no-audio")` (a batch skips it, no failure recorded); `salvage: true` still
- forces one.
- - **Transcribe** (the video page's, and `pnpm ops transcribe-one` without `file`/with it, `salvage` unset): the owed
- downloads first (`fullAudioFirst`, each `downloadOneManaged({storedUrl: "only"})`): clean → the full transcript;
- exhausted → the salvage; a rate limit with attempts still owed → the job fails "transcribe again later" (no
- hammering).
- - **Marked partial wherever it shows:** the video page's salvaged notice adds "Full audio attempts: n of 2." (a record
- with a trusted stored URL); the video list's transcript dot is amber with "salvaged transcript (partial …)"
- (`VideoRow.salvagedTranscript`); MCP `get_transcripts` marks the video's block (whole and windowed) as
- `get_transcript` and `get_video_metadata` did; the export's TranscriptModal already says "Partial transcript: …".
- - **The pipeline view:** the snapshot's `fullAudio {of, attempts, awaiting}` (one `storedMediaUrl` read per corrupt
- full source); the flow's download siding **awaiting full audio** and the transcribe siding **salvaged — full audio
- attempts: n** (a range when they differ; "salvaged transcript" elsewhere).
- - Ops help (`transcribe-one`, `retry-bucket`, `bench-verdicts`), COMMANDS.md regenerated.
-
-## Files
-
-`REPORT.md`, `common/lib/report/**` and `umtool/**` (the bench-v3 merge); `common/lib/report/draft/bench/{items,run,store}.ts`,
-`common/controller/benchVerdicts.ts`, `common/bin/{archilyzer,reports-bench-verdicts}.ts`; `common/lib/archiveOrgClient.ts`,
-`common/lib/waybackClient.ts`, `common/publish/findCopy.ts`, `common/testing/web/fakeWayback.{mjs,d.mts}`,
-`common/testing/README.md`; `common/lib/fullAudioFirst.ts` (new), `common/lib/fullAudioFirst-server.ts` (new),
-`common/controller/fullAudioFirst.ts` (new), `common/controller/transcribeOne.ts`, `common/ytdlp/downloadOneManaged.ts`,
-`common/controller/channelSnapshot.ts`, `common/views/pipeline/channelFlow.ts`; `editor/app/channels/[slug]/videos/[id]/videoActions.ts`,
-`…/components/{VideoPanel,SalvagedTranscriptNotice}.tsx`, `editor/app/channels/[slug]/lib/{videoRows,videoRowsServer}.ts`,
-`…/components/VideoListPane.tsx`, `editor/app/api/ops/{bench-verdicts,transcribe-one}/route.ts`; `mcp/src/server.ts`;
-`scripts/archilyzer-ops.mjs`, `COMMANDS.md`.
-Tests: `common/lib/report/draft/bench/bench.test.ts` (dedupe off/on, the plan, the refusal), `common/lib/waybackClient.test.ts`
-(+2), `common/publish/findCopy.test.ts` (+1, and the none-found records), `common/publish/findCopyScope.test.ts` (+1),
-`common/controller/fullAudioFirst.test.ts` (4, new), `common/ytdlp/storedUrlManaged.test.ts` (+3),
-`common/controller/channelSnapshot.test.ts` (+1), `common/views/pipeline/channelFlow.test.ts` (+1),
-`editor/app/api/ops/{_benchVerdicts,_verdicts}.test.ts` (v3 stubs; the dedupe body), `mcp/src/search.test.ts`
-(get_transcripts), `editor/e2e/full-audio-first.spec.ts` (1, new).
-
-| Commit | What |
-| --- | --- |
-| `a410f413` | merge `r30/bench-v3` |
-| `d1c932e1` | common: the bench asks every claim by default; `--dedupe` / `dedupe: true` explicit |
-| `104b09cf` | common: find-copy's Wayback found check; none-found recorded by the article mode; the fake serves streams |
-| `3fca654d` | editor: the bench and M8 tests answer in v3's shape; the dedupe body |
-| `e2b39f14` | common, editor, mcp: full audio before a salvage; the flow, the marks; ops help, COMMANDS.md; the e2e spec |
-| `5a9c60af` | common: the snapshot reads each corrupt record's trusted URL |
-| `8abfcd54` | editor: the Transcribe row's full-audio line and Salvage now; e2e |
-| `cb9b2fdc` | this record, FACTS, CHANGELOG, V's ruling |
-| `8be5eb1e` | merge `main` `72f777ae` (R7, R9, the cornbreadman import sweep); FACTS and CHANGELOG keep both sides |
-| (this commit) | the gates |
-
-## Gates
-
-Everything ran through the shared heavy lock from the worktree root. Final run at `8be5eb1e` (`main` `72f777ae` merged in):
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean.
-- common: `main` was 4537 per R7's record → **4594 (4593 pass, 0 fail, 1 skipped)** after the merge. On the branch before
- the merge it was 4552 (4551 + 1 skipped). Only one earlier run had failures: `architecture.test.ts` flagged a lib test
- importing controller (the test moved to `controller/`), and COMMANDS.md was stale (regenerated).
-- editor unit: **346/346** after the merge, 342/342 before it. The bench-v3 merge left 2 failures (v2-shaped stubs),
- which are fixed.
-- mcp: **378/378**. test:scripts: **1053 (1049 pass + 4 skipped)**. umtool unit: **45/45**.
-- `docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check`: clean.
-- e2e, one spec at a time: umtool `verdict-bench.spec.ts` passed 4/4 at `e2b39f14` and again at `8be5eb1e`. Editor
- `full-audio-first.spec.ts`:
- - run 1 at `e2b39f14`: 1/1.
- - run 2: 0/1. The kept file was `audio.mp4`, which the video page lists for Transcode, not Transcribe, so the new row
- never showed. The fixture now keeps `audio.m4a`, the channel's format.
- - run 3 at `8be5eb1e`: 1/1 (1.8 s, start-mode build 64 s).
-
-## Decisions I made
-
-- **Dedupe as an explicit option** is a flag on every surface that starts a bench (CLI `--dedupe`, the ops body), not
- only the library's parameter — otherwise "stays available" would be unreachable. A run records it; resuming with the
- other setting is refused (as for `--limit`).
-- **The found check probes at most 3 formats**, audio first (fetch-copies asks yt-dlp for `ba/b`), with a 1 KiB ranged
- GET; a 200 that is an HTML page is not a stream. The copy's URL stays the watch-page replay URL yt-dlp takes.
-- **The article mode records none-found too** — the brief says to record "page captured, no video" as none-found, and
- only the scope mode wrote attempts. A recorded none-found makes the scope mode skip the video for 30 days (its rule).
-- **An attempt is any `stored-url-ranged` attempt on record, a 429 included** — the ruling counts attempts. A refused
- attempt with attempts still owed fails the Transcribe job instead of trying the next one at once.
-- **Full audio first applies to corrupt full sources only**, not to damaged held audio (release 31 A's other automatic
- salvage), per the brief's wording; damaged held audio is salvaged as before.
-- **An explicit mode is respected**: the request's or the channel's `never` keeps release 30's behaviour (salvage at
- once); an explicit `fallback`/`only` on the request or channel is used as given (the refetch is not switched).
-- **The editor's Transcribe makes the attempts inline** (each paced by R7's 20-minute gap), so a person can do it from
- the video page with no model and no CLI; `salvage: true` (ops) still salvages at once.
-- **The snapshot reads `metadata.info.json` for corrupt full sources only**, in the per-video fan-out (not the
- classification loop).
-
-## Not done
-
-- No live run (the orchestrator's, after merge — commands in the report). No paid bench run (ruled).
-- **Salvage now** is on the Transcribe row of a file in the channel's audio formats. A corrupt full source whose only
- kept file is a container (`audio.mp4` on an m4a channel) is listed under Transcode, so it gets no Salvage now; for
- that case `pnpm ops transcribe-one {"salvage": true}` remains.
-- Damaged held audio (release 31 A) is not gated (see Decisions).
diff --git a/plans/release-32/services.md b/plans/release-32/services.md
@@ -1,95 +0,0 @@
-# Release 32 — every feature in Docker, and both modes as services (as shipped)
-
-Operator ask (2026-10-16): "Could we have everything able to be run as a systemd service, supporting either on host or
-via Docker?" and "I want to make it as easy as possible for anyone to use all the features of Archilyzer, and I think
-Docker is a core component of that." Rulings followed: Docker is the first-class install with full feature parity,
-host mode the alternative, both run as systemd services from one command; on THIS machine the operator chose host-mode
-user units (written by hand 2026-10-16), which `service install --mode host` must reproduce and adopt; nothing in this
-lane installs, enables, starts or stops a unit here.
-
-## What
-
-- **`archilyzer service install|status|logs|restart|uninstall`** (`common/bin/service.ts`, units rendered by the pure
- `common/lib/service/units.ts`). systemd USER units; Linux only (a sentence elsewhere).
- - docker mode (default when `docker compose` answers and nothing is installed): ONE `archilyzer.service` running
- `docker compose -f … --profile … up --no-build` in the foreground, `down` on stop, Restart=on-failure; two
- ExecStartPre guards (wait ≤ 2 min for the daemon; refuse with the build line when an `archilyzer:` image is
- missing). `--apps` = profiles (editor, umtool, site, homepage, ollama); overlays from `--overlays` or found
- (anthropic when the key file EXISTS — never opened; storage when `docker-compose.storage.yml` exists).
- - host mode: `archilyzer-editor.service`, `archilyzer-umtool.service` — byte for byte the operator's units for this
- machine's paths (node directly, `next start -H <bind> -p 3001|3050`, UV_THREADPOOL_SIZE=16, explicit PATH with
- `~/.local/bin`, ExecStartPre BUILD_ID refusal, StartLimit 5/300 s, KillMode=mixed, TimeoutStopSec 90/60,
- MemoryHigh/Max from MemTotal: 7G/8G and 5G/6G at 16 GB) — and `archilyzer-site-<id>.service` per `--sites
- <id>:<port>` (`serve-out.mjs` over the built bundle, HOST=127.0.0.1; how the private sites were served by hand).
- - Adopt: an installed unit with identical text is left alone (no write, no daemon-reload); a different one is shown
- as a diff and refused unless `--force`; a replaced running unit is not restarted. `--dry-run` writes nothing.
- `--linger` runs `loginctl enable-linger`; `--no-start` enables only; `--idle-boot` adds ARCHILYZER_IDLE_BOOT=1.
- - `status` (read-only): each unit's state/enablement/pid/since, an app's build id, its port's answer, the
- transcription lane's held/armed state (host: settings.json; docker: `exec editor cat`), each container in docker
- mode. `logs` wraps `journalctl --user`, `restart` / `uninstall` systemctl.
-- **`archilyzer service storage-overlay`**: writes `docker-compose.storage.yml` (gitignored): every location root,
- every channel `media`/legacy `data` link and the saved-video store link no location covers, bind-mounted into the
- editor and umtool at the same absolute path, `create_host_path: false`; `--corpus <dir>` mounts a host corpus at
- `/data/transcripts`. Read by lstat/readlink on the corpus disk only.
-- **Image parity** (Dockerfile): a `runtime-umtool` target (trixie for ImageMagick 7; Pango coder asserted at build;
- rsvg-convert, qrencode, zbarimg, chromium, `hyperframes@0.8.24` + its headless shell, telemetry off) run by the
- umtool service; in every editor target gallery-dl (pinned 1.32.9, `GALLERY_DL_BIN`), Playwright's headless Chromium
- (`--with-deps`, `/opt/ms-playwright` — the editor's report exports, Bluesky/Nitter/X/forum fetchers need it too),
- espeak-ng, `REPORTS_DIR`, and links keeping TTS installs, the TTS cache and the generation ledger in volumes. The deps
- stage pre-fetches node-datachannel's prebuilt (prebuild-install timed out from the build container, the source
- fallback failed, and with it every image build since release 21).
-- **Compose**: `reports` and `ollama` volumes; an `ollama` service (profile, internal, `ARCHILYZER_OLLAMA_TAG`), `OLLAMA_URL`
- defaulting to it; `ARCHILYZER_EDITOR_URL=http://editor:3001`; `host.docker.internal` on Linux. Overlays
- `docker-compose.anthropic.yml` (the key file as a read-only bind — never an env value, so `docker compose config`
- cannot print it) and `docker-compose.browser.yml` (Firefox profiles read-only); vulkan/gpu overlays give ollama the
- GPU and no longer retarget umtool.
-- **Cookie spec `file:<path>`** → `--cookies <path>` for yt-dlp and gallery-dl (Chrome's keyring-encrypted cookies
- cannot be read from a container; a cookies.txt can).
-- **Editor first run**: the dashboard's **First steps** while there is no channel (add a channel; each enabled
- worker's model present or missing; sync and transcribe; publish).
-- **RUNNING_IN_DOCKER.md**: quickstart to a transcribed channel, Run it as a service, report → video, local models,
- the Claude API, browser cookies, X posts, TTS, the MCP from the container, the storage overlay (now the media tier's
- links), and the feature × install matrix.
-
-## Files
-
-`common/lib/service/{units.ts,units.test.ts}`, `common/bin/{service.ts,service.test.ts,archilyzer.ts}`,
-`common/lib/{cookiePolicy.ts,cookiePolicy.test.ts,envVars.ts,settingsSchema.ts,channelConfig.ts}`,
-`common/social/xGalleryDlFetcher.ts`, `common/publish/buildImage.test.ts`, `Dockerfile`, `docker-compose.yml`,
-`docker-compose.{vulkan,gpu,anthropic,browser}.yml`, `docker/entrypoint.sh`, `.env.example`, `.gitignore`,
-`editor/app/page.tsx`, `editor/app/components/dashboard/{FirstRunPanel.tsx,DashboardCockpit.tsx}`,
-`RUNNING_IN_DOCKER.md`, `AGENTS.md`; COMMANDS.md, ENVIRONMENT.md, CHANNEL.md, SETTINGS.md regenerated.
-
-## Gates
-
-On the branch after merging main `45c5a583`: tsc clean (all packages); common **4477** (4476 pass, 1 skipped; new:
-`service/units.test.ts` 9, `bin/service.test.ts` 9, `cookiePolicy` +1, `buildImage` +3); editor **327/327**;
-test:scripts **1045** (1041 pass, 4 skipped); `docs env`, `docs files`, `docs cli`, `settings example` checks clean.
-
-- **Host units vs the operator's live units** (read-only): `service install --mode host --dry-run` with the primary
- checkout as root → both `= … already installed, identical — adopted`; `service status` against them → active,
- enabled, build ids, `/` → 200 on 3001 and 3050, the transcription lane's state. No unit was installed, enabled,
- started or stopped.
-- **Image** (capped builder, 8 GB): `runtime` 457 s, **2.60 GB**; `runtime-umtool` 529 s, **4.28 GB** (rebuilt after
- the merge and the policy fix, 540 s). Not built: `runtime-vulkan`, `runtime-cuda` (their new lines — gallery-dl,
- espeak-ng, Playwright `--with-deps` on trixie/ubuntu 24.04 — are unverified by a build).
-- **Container smoke** (`-p r32smoke`, fresh volumes, `ARCHILYZER_FETCH_MODEL=none`, `ARCHILYZER_IDLE_BOOT=1`, editor +
- umtool, `down -v` after): `/api/pulse` 200; the dashboard shows **First steps** with "model missing"; `exec editor
- pnpm archilyzer --help` lists the six `service` rows; gallery-dl 1.32.9, espeak-ng, yt-dlp, whisper-cli; the three
- state links resolve into the volumes; headless Chromium launches in the editor (147.0.7727.15); `archilyzer doctor`
- exit 0 (2 warnings: the skipped model; qrencode, which only the umtool image carries); umtool `/` 200, umtool →
- `http://editor:3001/api/pulse` 200; ImageMagick 7.1.1-43 with PANGO, rsvg-convert 2.60.0, qrencode 4.1.1, zbarimg,
- Chromium 155, hyperframes 0.8.24 + its headless shell, Playwright's shell.
-- **Renders in the umtool container**: chrome-deck (hyperframes frames), brand (pango/rsvg cards), deck-build,
- chrome-posts, chrome-teaser, chrome-feed, audio-poster, av-sync: **99 tests, 98 pass, 0 skipped**. The one failure is
- av-sync's CONTROL assertion (that the old unpinned graph drifts ~60 ms) — with Debian's ffmpeg 7.1 it does not drift;
- the pinned assertion (the shipped behaviour) passes. Found and fixed on the way: Debian's ImageMagick policy refused
- `pango:@file` (every text card).
-- `docker compose config -q` clean for the base file and each overlay (vulkan, gpu, anthropic, browser) with the
- umtool and ollama profiles. The `ollama/ollama` image was not pulled.
-
-## Rulings followed
-
-Docker first-class, host the alternative, both as services from one command; host-mode units on this machine are the
-operator's and are adopted, never replaced without `--force`; nothing calls a model; the Claude key file is never
-read or printed by the command (existence only) and reaches a container only as a read-only mount.
diff --git a/plans/release-32/stored-url.md b/plans/release-32/stored-url.md
@@ -1,55 +0,0 @@
-# Release 32 lane R5 — a clip window from the stored media URL when the lookup is rate-limited (as shipped)
-
-Live (2026-10-16): Odysee answers 429 to yt-dlp's page/API lookup (`[lbry] … HTTP Error 429`) on the first request of a
-run, hours apart, with cookies; the fetch-windows job stops (`stopped: rate-limit`) and the platform is held, so later
-runs are refused at the door. Every held Odysee record's `metadata.info.json` already stores its media: one format on
-`player.odycdn.com`, a different endpoint. Ruling (operator): for this case, cut the window from that stored URL;
-opt-in per request.
-
-## What
-
-- `common/lib/storedMediaUrl.ts` (pure) + `storedMediaUrl-server.ts`: `storedMediaUrl(videoDir)` → `{url, host,
- platform, referer}` or null. Allowlist `STORED_URL_PLATFORMS = ["odysee"]`; CDN hosts `*.odycdn.com`; one format
- (or the top-level `url` when there are none), http(s) only, no manifest protocol, no credentials.
-- `fetchWindows({storedUrl})`, `"never" | "fallback" | "only"`, default `never` (the old path). `fallback`: the page
- first; on a page `rate_limit` the window is cut from the stored URL after the gap. `only`: no page request. A platform
- held, cooling or rate-limited earlier in the run does not stop its stored-URL items; its items without one are
- `notAttempted` and the run reports the stop. The backoff is still recorded; a stored-URL success never records the
- platform clean; a 429 from the stored URL itself stops the run. Same queue, same gaps. `result.storedUrl` lists them.
-- `fetchWindowManaged({storedMedia})`: yt-dlp gets the stored URL, `copyClipFormatSelector`, `--add-headers
- Referer:https://odysee.com/`, `--download-sections` as before; `videoUrl` stays the page URL, so the audio check
- (`audioCheckApplies(config, pageUrl)`) and its final probe + one re-fetch still apply.
-- Provenance: `source: "stored-media-url"` (`CLIP_WINDOW_SOURCES`, parsed tolerantly) and `sourceHost`. The log:
- `cut from the stored media URL (player.odycdn.com) — odysee lookup rate-limited` | `— odysee lookup held` |
- `(asked: only)`.
-- Editor: `fetchWindowsAction` / the ops route take `storedUrl` (validated; siteId bodies too); a held or cooling
- group with a stored mode starts its job with the windows that have a stored URL and refuses the rest
- (`storedUrlDoor`); the dry run's group carries `storedUrlItems`; the job spec keeps `storedUrl` for Retry.
-- `pnpm ops fetch-windows` help, COMMANDS.md regenerated.
-
-## Files
-
-`common/lib/storedMediaUrl.ts`, `common/lib/storedMediaUrl-server.ts`, `common/lib/clipWindow.ts`,
-`common/ytdlp/fetchWindowManaged.ts`, `common/controller/fetchWindows.ts`,
-`editor/app/channels/[slug]/videos/fetchWindowsAction.ts`, `editor/app/api/ops/fetch-windows/route.ts`,
-`editor/app/jobs/jobReplayRegistry.ts`, `scripts/archilyzer-ops.mjs`, `COMMANDS.md`. Tests:
-`common/lib/storedMediaUrl.test.ts` (7), `common/controller/fetchWindowsStoredUrl.test.ts` (13),
-`editor/app/channels/[slug]/videos/fetchWindowsStoredUrl.test.ts` (3), `editor/app/api/ops/fetch-windows/route.test.ts`
-(+1 test, +2 cases).
-
-## Gates
-
-tsc clean. common 4488 → 4508 (4507 pass + 1 skipped); editor 327 → 331; scripts 1052 (1048 + 4 skipped); docs cli,
-env, files and settings example checks clean. mcp not touched (its `fetch_clip` posts to the single fetch-window
-route, not to fetch-windows). No e2e named for this lane (no UI).
-
-## Rulings followed
-
-Opt-in per request, default `never`; allowlist of one platform and its CDN hosts; one stream, real gaps (the gap key
-and the gap are the page fetch's); the audio check keys on the page URL; no model, no live network in any test.
-
-## Owed
-
-- A UI toggle (the operator's UI-without-AI rule): "Cut from the stored media URL" on the Reports tab's Fetch missing
- evidence and the video page's window fetch.
-- `storedUrl` on the single `/api/media/fetch-window` route and the MCP's `fetch_clip`.
diff --git a/plans/release-33.md b/plans/release-33.md
@@ -1,64 +0,0 @@
-# Release 33 — montages, and auditioning them
-
-The operator's request (2026-10-17): a montage of every time TheQuartering said "slow news day/week/…", roughly
-chronological, with editing techniques that show the many instances well, auditioned as variants — and variant
-auditions in umtool. Also: `queue-lock --heavy` caps what it admits by default (the operator's go, same day).
-
-| Lane | Branch | Record | State |
-|---|---|---|---|
-| The heavy cap (`pnpm heavy` runs its command in an 8G/2G user scope) | `r33/heavy-cap`, `r33/heavy-cap-env` | WORKTREES.md "The heavy slot" | merged `643434f7`, `c3486f8f` |
-| M2 — `umtool new --seed phrase` (common/lib/montage/phraseScan.mjs) | `r33/phrase-seed`, `r33/phrase-fetchpad` | umtool/docs/cli.md | merged `da687578`, `4e514d40` |
-| M3 — `render.montage` and six montage styles | `r33/montage`, `r33/montage-number` | [montage.md](release-33/montage.md) | merged `301b627a`, `43884814` |
-| M1 — takes: make, recipe, Use this take | `r33/takes` | [takes.md](release-33/takes.md) | merged `d4a9021b` |
-
-## Gates
-
-On `main` `43884814` + `c3486f8f`: tsc clean; test:scripts 1109 (+4 skipped), umtool 45, common 4604 + the
-allowlist fix (envVars.test 9/9). Lane e2e: takes.spec 7/7 twice, bench-shell + visual-audit 71/71. A manifest without
-`render.montage` renders byte-identically (md5 of the final and every segment, main vs branch).
-
-## Live
-
-umtool `9S7H98hMHJAV5WWKdj4t5` (2026-10-17 17:41). The editor is unchanged by this release.
-
-## The slow-news project
-
-`~/reports/quartering-slow-news/`: `scan.py` (the first scan, which phraseScan reproduces exactly: 23,325 transcripts,
-121 hits, 75 instances), `seed-manifest.py` → `video.manifest.json`, `fallbacks.json`, `windows.json` (the editor's
-fetch-windows body), `takes/recipe.json`. One line left out (a chat line read out); clips on co-host shows carry a
-voice-check note. All 75 windows fetched through the editor: 60 Rumble, 19 YouTube (15 pre-Rumble + 4 stand-ins),
-5 cornbreadman via the stored media URL (4 + 1 stand-in). Rumble's embed lookup answered 403 for a few videos on every
-try while the rest fetched (not the Cloudflare clearance, which held for the 2-hour run); per the operator's ruling the
-same stream's YouTube upload stands in where one is public (s28, s29, s31, s33), else cornbreadman (s37); s43's
-YouTube copy is deleted and Rumble served it on the last try. Takes: seven over the first 42 s (2019–2021) and three
-over the whole cut (accelerate 2:44, wall-finale 3:13, flash-count 3:04), all from the current manifest.
-
-## Overnight 2026-10-18
-
-The operator's audition (2026-10-18): drop #4 (another speaker) and #6 (a read tweet); keep #58 as the guest's
-rebuttal right after #57; "accelerate with a wall finale … sync up those wall groups … the slide transition"; "the
-unison wall … shouldn't have had those same clips appear earlier". Merged, in order:
-
-| Branch | Record | Merge |
-|---|---|---|
-| `r33/wall-sync` — wall groups 1,1,2,4,8…, onsets matched on the sound, tail + exclusive, ramp into the wall, `build-to-wall` | [wall-sync.md](release-33/wall-sync.md) | `25886f3f` |
-| `r33/wall-audio-length` — the wall's audio exact to the sample (a frame short under load) | — | `2be6f0b7` |
-| `r33/montage-polish` — even loudness, same-stream tiles apart, tile labels | [montage-polish.md](release-33/montage-polish.md) | `ceda2d9c` |
-| `r33/silent-tile` — late-starting windows cut on their own clock (any report video); near-silence relocated | [silent-tile.md](release-33/silent-tile.md) | `fea1bdd1` |
-| `r33/takes-kind` — `makesTakes` on the kind registry (the umtool suite's one failure) | — | `5f562251` |
-| `r33/phrase-seed-e2e` — the phrase seed's form e2e | — | `89753763` |
-| `r33/dockerignore` — 7.7 GB of local trees out of the Docker context, incl. the private homepage build | — | `1dc06abe` |
-
-Gates on `1dc06abe`: tsc clean; test:scripts 1137 pass / 0 fail (+4 skipped); umtool e2e whole suite 558 passed,
-1 failed (fixed by `r33/takes-kind`), 6 skipped; projects + takes rerun 30/30; phrase-seed 2/2. Images (8 GB capped
-builder): `archilyzer:r33-vulkan` 4.14 GB (sees the RX 6600 XT via RADV; the Vulkan stage needs WHISPER_BUILD_JOBS=1
-in an 8 GB builder), `archilyzer:r33-cuda` 7.01 GB (whisper-cli links ggml-cuda/cudart/cublas). umtool live
-`48LwUWe4x9N0j6czeUpmR`. The slow-news `build-to-wall` take re-rendered at full quality: 116.5 s, −16.0 LUFS.
-Catchphrase candidates for further montages: `~/reports/quartering-catchphrases/REPORT.md`. Handoff:
-`~/reports/overnight-2026-10-18/MORNING.html`.
-
-## Owed
-
-The operator's pick on the Takes page; ear checks on the "voice check" clips and s38; whether montages keep the per-clip
-QR; the stale takes (made before the fixes); pruning old Docker images (`/` at ~74 GB free); the default `runtime`
-and `runtime-umtool` images rebuilt without the local trees.
diff --git a/plans/release-33/montage-polish.md b/plans/release-33/montage-polish.md
@@ -1,62 +0,0 @@
-# Release 33 lane M3c — montage polish (as shipped)
-
-After the build-to-wall audition (2026-10-18), three fixes to a montage, on `main` `2be6f0b7`:
-
-1. **The wall keeps a stream's repeats apart.** In the auditioned take, five pairs of tiles from one video sat side by
- side (v6ss2d5, v70yc82, v7arhpy — the crumbl pair — v7fucc4, v7gh5pq), and so did one day's Rumble/YouTube mirror pair
- (s59/s60).
- - **`wall.spread: "stream"`**: `wallCells` is a deterministic descent over swaps of two tiles' cells, scored as 100
- per touching pair (row or column) plus each tile's grid distance from its own cell. The groups keep their
- membership and date order; only cells move. A clip's stream (`clipStream`) is its `montage.stream`, else its day,
- else its video.
- - **`wall.distinct`** (one tile per stream; a tail takes the latest of each stream) works with spread or tail but is
- **refused with `exclusive`**. Trading a repeat for an earlier clip would put the later clip back in the run before
- the wall, so it would no longer be chronological. Build-to-wall uses `spread: "stream"` without it.
-2. **Even loudness** (`render.montage.loudness {target −16, mode "clip"}`). Each clip's cut and each wall tile is
- measured once (ebur128, integrated) and given one gain to the target. The gain is held to ±20 dB, with none under
- −60 LUFS. Then a −1 dBFS lookahead limiter (`level=0`, `latency=1`). The crowd beat is limited as before. Every style
- now carries it.
-3. **Tile labels** (`wall.label "year" | "number" | "both"`). `year: true` means "year" and draws the same drawtext as
- before. Wall-only clips get their `number` from `montage.n` (else their place among the clips) in `planMontage`.
- Build-to-wall uses "both" ("#52 · 2025").
-
-## Files
-
-`umtool/report-to-video/montage.mjs`, `montage-styles.mjs`, `build-video.mjs` (`measureLoudness`, `montageLevel`, the
-segment gain, the wall's cells / labels / levels and its record), `montage.test.mjs`, `README.md`,
-`umtool/docs/report-video.md`, `editor/CHANGELOG.md`, `plans/FACTS.md`.
-
-| Commit | What |
-| --- | --- |
-| `307634e7` | wall.spread "stream", wall.distinct, render.montage.loudness, wall.label; every style levels; tests |
-| `3c6933b4` | README, docs/report-video.md, FACTS, CHANGELOG |
-| (this commit) | this record |
-
-## Gates
-
-- tsc clean before each commit.
-- test:scripts: 1125 (1121 pass, 4 skipped) at `main` `2be6f0b7` → **1136 (1132 pass, 0 fail, 4 skipped)**. The montage
- files ran 61/61, with real renders of:
- - four clips 26 dB apart, each brought within 1 LU of the target;
- - a tail wall with three streams' repeats: none touch, every tile measured, a tile within 1.5 LU, verifyBuild clean.
-- **Byte-identical:** main's own style patches (wall-finale, accelerate, build-to-wall: no new keys) rendered by main's
- and by the branch's build-video give identical md5s.
-
-## Smoke
-
-A fresh copy of the project (73 clips) with build-to-wall, rendered whole: `$T/r33m3-smoke3/build-to-wall.mp4`,
-116.9 s, 49 chapters, verify-build ok, 405 s (with loudness passes). No chrome frame directories were made.
-
-**Loudness, integrated, per run clip (48 clips):**
-
-| | range | p10–p90 | std |
-|---|---|---|---|
-| The raw cuts | −38.6 … −11.9 LUFS = 26.7 LU | 10.6 LU | 4.8 |
-| The auditioned take's segments | 28.2 LU | 10.6 LU | 5.0 |
-| Leveled | −20.1 … −16.0 = 4.1 LU | 0.5 LU | 0.6 |
-
-The one outlier is s38: −38.6 LUFS raw, at the +20 dB cap. Wall tiles went from a 39.3 LU range (take) to 17.8; that
-remainder is s70 (raw −53.7 LUFS, near silent, capped). Without s70 the tiles are within 0.5 LU.
-
-The wall's cells moved 8 tiles; no same-stream pair touches. `wall-final.png` (the final wall, "#n · year" labels) and
-`wall-groups.jpg` are beside the mp4.
diff --git a/plans/release-33/montage.md b/plans/release-33/montage.md
@@ -1,74 +0,0 @@
-# Release 33 lane M3 — montage editing in report-to-video (as shipped)
-
-The operator asked (2026-10-17) for a montage of every time TheQuartering said "slow news day/week/cycle", kept
-chronological, with editing techniques worth auditioning as variants. This lane is the renderer half:
-`render.montage` in report-to-video and the named styles umtool's take maker (lane M1) lists.
-
-## What
-
-1. **`render.montage`** (`umtool/report-to-video/montage.mjs`, pure; build-video's hooks run only when it is set):
- - `tighten: "phrase"` cuts each clip to the phrase ± `phrasePad` (0.6 s) inside its extent. The phrase is the clip's
- `montage.match` (else `onscreen.title`), found by character position in the clip's cues, or by whisper.cpp's token
- offsets in the corpus's `transcript.json` when present. Edges snap to silence (the existing `snap`) only where the
- snap stays outside the phrase, inside the extent and under the ramp's cap. Not found: today's cut, and a note.
- - `cut: hard | flash | whip | dip` — made on each segment's own first/last frames (flash 3 frames from the colour;
- dip 2+2 frames through black; whip 4+4 frames sliding, wrapped, blurred along the move). Every segment's sound
- fades 15 ms at each edge.
- - `counter: {style: chip | big | tally, position, of, showDate, showSource}` and `yearStamp` — drawtext/drawbox over
- the frame.
- - `punch: {mode: snap | drift, scale, anchor: upper | center}`, `stutter: {every, clips, times 2–4, length, step}`,
- `ramp: {from, to}` (cut k ≤ lerp(from, to, k/(N−1))) — the segment's pieces (trim/crop/concat) and a zoompan.
- - `wall: {at: end | start, tiles: 9 | 16 | 25, build, year}` — one more segment: tiles appear at
- build·(1−(1−i/T)²), the newest heard and the rest ducked, then all together at the beat.
- - A montage's concat is always hard (the cuts are in the segments), so a segment's length is planned to the frame
- and recorded (`<id>.cut.json` `montage.frames`).
-2. **`montage-styles.mjs`** — the shared interface with M1: `MONTAGE_STYLES` (`straight`, `flash-count`,
- `accelerate`, `stutter`, `wall-finale`, `whip-years`; plain-words label and summary; an RFC 7386 merge patch under
- `render.montage` that sets every key), `montageStyle(name)` (deep copy), `mergePatch`, `applyMontageStyle`, and a
- `list` / `apply` CLI. Landed first (`dae55bc7`).
-3. **Validation** — `validateMontage` in the build's validators and the lint: unknown keys, bad values, a ramp without
- `tighten: "phrase"`, stutter ids not in the timeline, and a montage beside the deck, the rail, the chart band or a
- clip `muteFrom`, each in a sentence naming the key.
-4. **verify-build** counts the wall's chapter, and a phrase-cut clip's floor is 0.5 s.
-
-## Files
-
-`umtool/report-to-video/montage.mjs` (new), `montage-styles.mjs` (new), `montage.test.mjs` (new, 32 tests),
-`montage-styles.test.mjs` (new, 6 tests), `build-video.mjs` (imports, the validator, `montageCut` /
-`montageSegmentGraph` / `buildMontageWall`, the forced hard join, the wall in the entries and `--chapters-only`),
-`lint.mjs` (one validator), `verify-build.mjs`, `README.md` ("`render.montage` — montage editing"),
-`umtool/docs/report-video.md` ("Montages"), `editor/CHANGELOG.md`, `plans/FACTS.md`.
-
-| Commit | What |
-| --- | --- |
-| `dae55bc7` | montage-styles.mjs — the named styles (the shared interface), merge patch, CLI; 6 tests |
-| `bf3a0553` | render.montage in the renderer (montage.mjs + build-video hooks + lint); 32 tests incl. a render per style |
-| `6ec868a4` | verify-build knows the wall and the phrase-cut floor |
-| `b66e5399` | docs (README, docs/report-video.md, FACTS, CHANGELOG); the tally's date line on its own ground (found by the smoke) |
-| (this commit) | this record |
-
-## Gates
-
-All through the shared heavy lock, from the worktree root:
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean before each commit.
-- `pnpm run test:scripts`: **1056 (1052 pass, 4 skipped) at `main` `643434f7` → 1094 (1090 pass, 0 fail, 4 skipped)**.
- `montage.test.mjs` alone 32/32 (~33 s, real 320×180 renders of each style over lavfi clips: length to ±1 frame of
- the cut records' plan, pixel checks for the flash, the chip, the big number, the tally's newest mark, the punch-in,
- the whip, the dip, the year stamp, the wall's last tile, and verifyBuild on the wall).
-- Byte-identical: the same 4-clip manifest without `render.montage` rendered by `main`'s and the branch's
- build-video — identical md5 for the final and all four segments; in-suite, absent vs `null` identical.
-- Not touched, not run: common, editor unit, mcp, umtool TS (`pnpm --filter umtool test`), e2e (no UI in this lane),
- builds. No CLI row, env var, settings or file schema in the generated docs changed.
-
-## Live smoke (read-only on the project)
-
-`~/reports/quartering-slow-news/video.manifest.json` copied to the job's scratch. With the project's `fetchPad: 3`
-no clip was on disk for `--no-network`: the editor's windows are exactly each clip's extent. With `fetchPad: 0` on the
-copy, 17 of 75 were; 12 of them (2019–2026) were rendered with each style, `--no-network --cue-source local`, preset
-veryfast: straight 30.1 s, flash-count 30.1 s, accelerate 26.0 s, stutter 31.6 s, wall-finale 39.3 s (16 tiles
-over 12 clips), whip-years 30.1 s; every phrase found in the cues, verify-build ok on all six.
-
-## Rulings followed
-
-No cards (the wall and the counter are footage and overlays); plain words in labels and summaries; nothing calls a
-model; synthetic fixtures only; the project read only.
diff --git a/plans/release-33/silent-tile.md b/plans/release-33/silent-tile.md
@@ -1,70 +0,0 @@
-# Release 33 lane M3d — the silent tile (as shipped)
-
-In the build-to-wall smoke, the s70 tile (v7fucc4, window `clips/355.02-368.18.mp4`) measured −53.7 LUFS and was raised
-the full +20 dB. s38 (v4dl2pq @6331) measured −38.6 LUFS and was also raised +20 dB.
-
-## What was wrong
-
-- **s70: the window's clock.** The Rumble section cut keeps its source's timestamps: its picture starts 1.00 s in
- (audio 0.94 s). ffmpeg's `-ss X` counts from the file's start time, while the window's name counts from zero.
- Measured against the cues (silences vs cue gaps on s70 and s65), the content at `-ss X` is the source at
- `from + start_time + X`. So every cut from such a window landed start_time late; s70's phrase fell into the pause
- after "…slow news week". 5 of the project's 73 windows have this (s50 1.80 s, s56 1.59 s, s63 0.11 s, s65 2.11 s,
- s70 0.94 s).
-- **s38: the words were wrong, the clip was not quiet.** Whisper's token offsets put "slow news day" at
- 6333.18–6335.69. The window's speech (−23 dB RMS) ends at 6333.5 and is followed by 4 s of silence. So s38 was
- **mislocated**, not a genuinely quiet co-host clip.
-
-## What changed
-
-1. **`fetchClipAligned`** (every segment and wall tile): when a file's video stream starts > 0.05 s in, `fetchStart`
- moves by the container's start_time and the build says so. Anything else (an mp3's encoder delay included) is cut as
- before. `--fetch-only` still reports the raw value.
-2. **Near-silence is a mislocated phrase** (under `render.montage.loudness`). A clip cut that measures < −40 LUFS, or 15
- LU under the run's median once 5 clips are measured, is handled as follows:
- - its phrase is relocated by the sound (`relocateBySound`: the stretch of the phrase's length (≤ 1.5 s) nearest the
- estimate, within the clip's extent, with 75% of its frames at ≥ −40 dBFS);
- - the clip is cut again from there;
- - this is said in the build log and recorded in `montage.loudness.relocated {from, to, why}`, with
- `montage.found: "sound"`.
-
- An exclusive wall's tile is checked the same way at its phrase (`montageWall.sync[].relocated`). Near-silence is
- never raised: `loudnessGain` is 0 under −40 LUFS.
-3. **The consensus may not shift a tile into a pause.** A shift whose next 0.4 s is more than 10 dB quieter than the
- estimate's keeps the estimate (`shiftAllowed`; `by: "estimate"`, `held`). On the smoke this held s70: its
- consensus shift would have gone into the pause.
-
-## Files
-
-`umtool/report-to-video/build-video.mjs` (startOffset, fetchClipAligned, relocatePhrase, montageCheckSound,
-montageWallSource, wallOnsets), `montage.mjs` (nearSilent, median, relocateBySound, shiftAllowed, loudnessGain),
-`montage.test.mjs`, `README.md`, `editor/CHANGELOG.md`, `plans/FACTS.md`.
-
-| Commit | What |
-| --- | --- |
-| `19d9bf54` | the window clock, near-silence relocation, the consensus bound; tests |
-| `b0d5b477` | relocation tuned on the real windows (75% at −40 dBFS); README, FACTS, CHANGELOG |
-| (this commit) | this record |
-
-## Gates
-
-- tsc clean.
-- test:scripts: 1136 → **1141 (1137 pass, 0 fail, 4 skipped)**. Montage files 66/66, including two synthetic renders:
- - a long cue with the phrase at its end, then silence: relocated onto the speech and leveled within 1 LU;
- - a window whose picture starts 1 s in, cut on the same source seconds as its unshifted twin.
-- **Byte-identical without loudness:** wall-finale and build-to-wall manifests as main writes them, minus loudness,
- give identical md5s from main's and the branch's build-video.
-
-## Smoke (fresh copy of the project, 73 clips): `$T/r33m3-smoke4/build-to-wall.mp4`
-
-116.5 s, 49 chapters, verify-build ok, 318 s.
-
-| Clip | Before (r33m3-smoke3) | After |
-|---|---|---|
-| **s70 tile** | raw −53.7 LUFS, output −33.8 LUFS | raw −22.5 LUFS, output −16.1 LUFS |
-| **s38** | raw −38.6, output −40.1 (the take) | relocated 6333.18 → 6331.95 s, raw −21.9, output −16.1 LUFS |
-
-- **s70:** fixed by the window clock alone (its estimate is now on speech). Its consensus shift was held.
-- **Run clips, leveled:** range 0.7 LU, std 0.17. Before this lane: 4.1 LU and 0.6; the take: 28.2 LU.
-- **Wall tiles, raw:** −26.9 … −14.4 LUFS. Before: −53.7 … −14.4.
-- **Stills:** `s70-tile.png` and `s70-tile-1s.jpg` (the tile's first second, 6 frames).
diff --git a/plans/release-33/takes.md b/plans/release-33/takes.md
@@ -1,116 +0,0 @@
-# Release 33 lane M1 — `r33/takes`: variant auditions in umtool (as shipped)
-
-Operator request (2026-10-17): variant auditions for a montage project, in umtool. Operator rule (2026-10-16):
-everything a model can do is doable in the UI with no model. Before this lane takes were only ever made by a one-off
-script, and the winner was copied by hand. Now umtool makes them, from the Takes page or a terminal, and **Use this
-take** puts one in the project's place. Nothing here calls a model.
-
-## What
-
-1. **The take maker** (`umtool/lib/report/takeMaker.mjs`). `makeTake(projectDir, spec)` reads the project's
- manifest, applies a montage style's patch (lane M3's `report-to-video/montage-styles.mjs`, loaded at run time;
- none installed = no styles), then the take's own patch. Both are RFC 7386 merge patches (`mergePatch`: lane M3's, from
- `montage-styles.mjs`, which `report-to-video/package.json` now exports; arrays replace). It writes `takes/<id>/video.manifest.json` (the whole patched manifest) and
- `changes[]` (`style: <label>`, then one plain line per changed leaf, e.g. `render.crf: 34 (was 30)`), then renders.
- take.json is written only once the preview exists. It carries `builtAt`, `seconds` (ffprobe), `style`, `patch`,
- `window`, `quick`, `entries` and `baseHash`. An empty change is kind `reference`; otherwise `different`, or the
- given `kind`.
-2. **The render** (`takeRender.mjs`): build-video through `scripts/queue-lock.mjs --heavy` (capped by default since
- r33/heavy-cap; passes through under HEAVY_HELD), `--skip-fetch --continue-on-error`. It writes into the take's own
- `out/`, whose `clips-raw` and `narration` are links to the project's; nothing is copied or fetched. `--no-xfade`
- unless a patch sets `render.transition` > 0 (the `fast` preset). `--no-chapters` for a window.
- **Quick render** (`--quick`, on by default in the form) encodes the render with x264 veryfast and never touches the
- take's manifest.
-3. **The window is a sub-cut.** `{at, dur}` renders the entries that window touches, as a cut of their own. The
- entries are timed by the project's deck schedule when it names every entry, otherwise by the manifest's own
- lengths, on the base manifest. `"full"` renders the whole cut.
-4. **Recipes**: `makeTakes(projectDir, recipe)` makes one take at a time. It skips a take that exists unless forced,
- carries on past a failure, and exits 1 at the end. `allStylesRecipe` gives one take per style.
-5. **The CLI** (`lib/report/takeCli.mjs`, two dispatch lines in `bin/umtool.mjs`): `umtool take`, `umtool take --id X
- --rebuild`, `umtool takes make [--recipe F | --all-styles]`, `umtool takes styles`, `umtool takes pick [--anyway]`.
-6. **The pick** (`pickTake`) goes through a new manifest writer, `replaceManifest` (manifest.mjs). That takes the
- lock and the token, takes the auto snapshot `auto-before-pick-take` (so the Cut tab's **Undo last edit** restores
- it), keeps the drafted-mark rule and writes atomically, all inside `withEditNotes`. The pick is then recorded in
- verdicts.json (`setTakePicked`, takes.mjs): `picked: true`, one per group. The pick is refused when the project's
- manifest hash ≠ the take's `baseHash`, or when the take records none, until `anyway`. A take whose manifest
- already is the project's re-picks as a no-op write.
-7. **UI** (`/projects/<p>/takes`):
- - **New take** (`NewTakePanel.tsx`): style select, label (taken from the style), group (the newest take's),
- window (from/for, or Full cut; 0/60 by default), patch JSON (checked before submit), quick render, and "make it
- again if it exists".
- - **Make all styles**. The job is watched with JobProgress (per-take steps, log, Stop), and the page refreshes
- when it ends.
- - Per card: **Use this take**; on a stale base, "The project changed since this take was made." and **Use
- anyway**. Once used, "The project's manifest is this take's now." with a link to **Revisions** (the History
- tab).
- - Per card: a **picked** badge, and **Rebuild** (takes the maker made).
- - The Cut tab links **Make takes** when the project has no `takes/`. The notes digest marks the picked take.
- - Works at 390 px.
-
-## Files
-
-umtool: `lib/report/{takeMaker,takeRender,takeCli}.mjs` (new), `lib/report/takeMaker.test.mjs` (new),
-`lib/report/takes.mjs` (+ `parseWindow`, `setTakePicked`, parseTake's maker fields, `picked` rows), `takes.test.mjs`,
-`lib/report/manifest.mjs` (`replaceManifest`), `lib/annotations/digest.mjs`, `bin/umtool.mjs` (dispatch + usage),
-`app/api/report/takes/{make,pick}/route.ts` (new), `components/projects/{NewTakePanel,TakesBench,TakesPage}.tsx`,
-`components/projects/report/CutTab.tsx`, `e2e/takes.spec.ts`, `e2e/fixtures/make-fixture.mjs` (takes-make-fixture),
-`e2e/fixtures/montage-styles.e2e.mjs` (new), `playwright.config.ts` (E2E_UMTOOL_MONTAGE_STYLES), `docs/cli.md`,
-`docs/report-video.md` ("Making takes"). plans/FACTS.md, editor/CHANGELOG.md.
-
-## Interfaces
-
-- `makeTake(projectDir, {id, label, group?, kind?, summary?, style?, patch?, window?, order?, quick?}, {force,
- render, probe, styles, emit, log, ensureOut, now})` → `{id, skipped, take?}`; `RenderFn(job: {manifestPath,
- outDir, slug, full, xfade, emit, log}) → {file}`.
-- `makeTakes(projectDir, recipe, {...makeTake opts, only})` → `[{id, status: made|skipped|failed, error?}]`;
- `parseRecipe`, `allStylesRecipe(styles, {group, window, quick})`.
-- `pickTake({id, dir, kind}, takeId, {anyway, token, now})` → `{take, group, snapshot, token, editNotes, verdicts}`;
- `TakeStale`; `takeIsStale(projectDir, take)`.
-- `mergePatch`, `changeLines(before, after, patches)`, `patchLeaves`, `patchFromSets`, `windowEntries(timeline,
- {at, dur}, schedule?)`, `windowManifest`, `loadMontageStyles({file?})`, `montageStylesFile`, `takeSteps(project, req,
- ctx)`, `lastGroup`, `uniqueTakeId`, `hashText`, `QUICK_RENDER`, `renderManifestPath`.
-- takes.mjs: `setTakePicked(projectDir, takeId, groupIds)`, `parseWindow`.
-- manifest.mjs: `replaceManifest(dir, manifest, {token, op})`.
-- Reads M3's `MONTAGE_STYLES: Record<name, {label, summary, patch}>`. `montageStyle()` is not needed.
-
-## Decisions / rulings followed
-
-- One merge patch: the take maker imports M3's `mergePatch` (the module exported as
- `umtool-report-to-video/montage-styles`) and re-exports it, rather than a second implementation. The styles
- themselves are still loaded at run time, so `E2E_UMTOOL_MONTAGE_STYLES` can stand in for them.
-
-- The window is a sub-cut, not `--chrome-preview`/`--preview`. Those need every segment already built in the take's
- `out/`; linking the project's segments would show the old cut for any patch that re-cuts a clip; and `--preview` is
- the rail's.
-- The render manifest is `<project>/.take-<id>.render.json`, beside the project's (relative paths, drafts review,
- shadow channels hold), and is removed after.
-- A rebuild writes the new manifest under a work name until the render succeeds.
-- The UI's Make all styles writes `takes/all-styles.recipe.json`, never a hand-written `takes/recipe.json`.
-- The window is prefilled 0/60: the Cut tab's preview window is component state and is not kept.
-- Quick render is on by default in the form (an audition compares cuts); the CLI's default is off.
-- A pick of a take with no `baseHash` (made by hand) needs Use anyway.
-
-## Gates (all through the shared lock)
-
-- tsc (all packages) clean before every commit.
-- test:scripts 1073 (1069 pass, 4 skipped, 0 fail) before main's merges; 1113 (1109 pass, 4 skipped) after them. Baseline 1056 (1052 pass, 4 skipped) on `643434f7`, so +17:
- takeMaker 15, takes 2.
-- umtool `test` 45/45 (no take tests in it).
-- e2e umtool `takes.spec.ts` 7/7 (17.9 s; again 7/7 in 16.6 s after main's merges; +2 tests, one assertion more in test 1).
-- e2e umtool `bench-shell.spec.ts` + `visual-audit.spec.ts` 71/71 (1.4 min).
-- Smoke on a COPY of the montage project's manifest under `$T/r33m1-smoke/` (the real corpus read-only), with `--quick`:
- - window 0/20 s gives 7 clips and a 26.1 s 1080p preview in 14 s.
- - The first run failed by design, naming all 7 clips: the manifest's `render.fetchPad: 3` asks for wider windows than
- the editor fetched. It passed with `--set render.fetchPad=0`.
- - After main's merge (M3 on main, the project at `fetchPad: 0`), on a fresh copy:
- - `flash-count` over 0/20 s: kind `different`, 17.95 s, 7 clips, tightened to the phrase.
- - `as-built`: `reference`, 26.12 s.
- - Both takes together took 19 s.
-
-## Found and left
-
-- **The montage project's manifest:** at `render.fetchPad: 3`, every `--skip-fetch` build of it refused, because the
- editor's windows are the clip extents exactly. The orchestrator set it to 0 (2026-10-17).
-- **Window takes and position-counted montage features:** M3's `planMontage` numbers by position. A window take's
- counter starts at #1 and its ramp runs over the window. For `accelerate` and `wall-finale` audition the full cut,
- or have the counter read `montage.n`.
diff --git a/plans/release-33/wall-sync.md b/plans/release-33/wall-sync.md
@@ -1,86 +0,0 @@
-# Release 33 lane M3b — the montage wall in synced groups (as shipped)
-
-The operator auditioned the slow-news takes (2026-10-17/18): "I really like the wall finale … something with elements
-from accelerate with a wall finale … really sync up those wall groups and speeding up the pacing toward the end — the
-slide transition was cool too". Addendum: "if we do the unison wall finale it shouldn't have had those same clips
-appear earlier, use it as a way to condense the repetition."
-
-## What
-
-1. **`wall.groups: "single" | "double"`** — "double": groups of 1, 1, 2, 4, 8 … (`wallGroups`; a leftover smaller than
- the group before joins it: 9 → 1,1,2,5; 16 → 1,1,2,4,8; 25 → 1,1,2,4,8,9). Each group arrives together on a beat. The
- gaps between beats fall evenly from the first to half of it across `build` (`wallBeats`). The tiles slide in from the
- right over 4 frames. A group is heard in unison at min(1, 1.25/√size) and falls silent with a 40 ms fade just before
- the next group's beat (ruled: silent, not ducked, so each group's unison reads alone). Earlier tiles freeze. Then
- every tile together, the crowd at 1.6/√tiles, limited.
-2. **`wall.sync`** (default on with "double") — each tile is cut 0.12 s before its phrase onset and runs to 0.25 s past
- the phrase. It shows 0.12 s before its beat, so the onset lands on its group's beat and on the final beat, to the
- frame (`groupedWallPlan`).
- - **Onsets.** The estimate is whisper's token offset (the corpus's `transcript.json`) or the cue character estimate.
- Neither is good to better than a few hundred ms here, and one clip's loudness rise picks the wrong syllable in
- connected speech. So with 3+ tiles they are aligned to each other: `consensusLags`, an 8-band speech spectrum,
- ±0.4 s, median shift zero. The group is then anchored on its mean loudness's rise (`templateOnset`, ±0.3 s).
- - Fewer tiles keep `refineOnset`.
-3. **`wall.clips: "spread" | "tail"`, `wall.exclusive`** — "tail": the last `tiles` clips in date order. `exclusive`: the
- wall's clips are tiles only, outside the run (no segment, no chapter). `montageSplit` is the one place that says which
- clips are tiles; `planMontage`, the build and verify-build all read it. Fewer than 2 run clips is a lint error.
-4. **`ramp.into: "wall"`** — the ramp ends on the wall's first gap (`wallFirstGap`), `to` optional.
-5. **Whip into the wall** — the wall already enters with the cut style (`cutStyleParts` on the wall segment). With
- groups, each group slides in (above): cheap and clean, so no hard pop.
-6. **`build-to-wall`** (label "Build to the wall") — whip, ramp from 3.5 s into the wall, drift, tally (as accelerate; it
- reads over the whips because the counter is drawn after the cut style), and an exclusive tail wall of 25 in synced
- double groups (1,1,2,4,8,9) with years, build 7.5 s (first gap 1.67 s). The other six styles take `null` for the new
- nested keys (`ramp.into`, the four wall keys), so one style over another still leaves exactly the second. Their effect
- is unchanged.
-7. The grouped compose re-stamps its mix by sample count before the fades. On real tiles amix's clock ran ahead and the
- end fade silenced everything after the first tile (found by the smoke; today's single wall is left byte for byte as
- it was).
-
-## Files
-
-`umtool/report-to-video/montage.mjs`, `montage-styles.mjs`, `build-video.mjs` (`findMontagePhrase`,
-`montageWallSource`, `speechExcerpt`, `wallOnsets`, `buildMontageWall`, the exclusive split in the entries),
-`verify-build.mjs`, `montage.test.mjs`, `README.md`, `umtool/docs/report-video.md`, `editor/CHANGELOG.md`,
-`plans/FACTS.md`.
-
-| Commit | What |
-| --- | --- |
-| `9454a027` | groups, sync, tail, exclusive, ramp into the wall, build-to-wall, validation; tests |
-| `8acbc01b` | consensus alignment + template anchor; the grouped mix re-stamped; README |
-| `2075a5e7` | docs (docs/report-video.md, FACTS, CHANGELOG) |
-| (this commit) | this record |
-
-## Gates
-
-- tsc clean before each commit.
-- test:scripts 1113 (1109 pass, 4 skipped) at `main` `00f6da06` → **1125 (1121 pass, 0 fail, 4 skipped)**.
-- Byte-identical defaults: a wall-finale and an accelerate manifest built by main's and the branch's build-video →
- identical md5. In the suite, a wall + ramp manifest with the new keys spelled at their defaults matches the bare one.
- That test failed once in one run of the suite and passed in 5 runs after; it now names the differing segment on a
- mismatch. Main's wall built 4× concurrently was bit-identical, so the one-off mismatch was not reproduced.
-- Real render tests: build-to-wall over 12 synthetic clips. Three clips run and nine are tiles. Length is right to ±1
- frame. The last cut is no longer than the first gap. Every onset moved 2.0 → 2.25 s (the sound) within 15 ms. Each
- tile's own phrase starts at its 0.12 s lead. Groups are empty before their beat and filled on it. The wall is audible
- on every beat. 4 chapters; verifyBuild clean.
-
-## Smoke (the project read only; copied fresh after the operator's edits: 73 clips)
-
-`$T/r33m3-smoke2/build-to-wall.mp4`: 116.9 s, 49 chapters (48 run clips + the wall), verify-build ok, rendered in 198 s.
-
-- **Wall:** 8.7 s; tiles s49–s73; group beats 0.13, 1.80, 3.30, 4.63, 5.80, 6.80 s; final beat 7.63 s; anchor +175 ms.
-- **Run cuts near the wall:** s45 1.78, s46 1.66, s47 1.71 (cap 1.71), s48 1.56 s; first gap 1.67 s.
-- **Onset sources:** of the 73 clips, 40 have whisper token offsets, 16 a parakeet `chunk_data`, 17 neither. Of the 25
- tiles, 13 used whisper's words and 12 the cues.
-- **Onset spread:** each tile's broadband loudness envelope cross-correlated with the mean of the others' (±250 ms):
-
- | Alignment | median | p90 | within 50 ms |
- |---|---|---|---|
- | estimates | 155 ms | 345 ms | 4/25 |
- | per-clip loudness rise | 150 ms | 245 ms | 9/25 |
- | consensus (shipped) | 185 ms | 255 ms | 10/25 |
-
- This measure has a floor of its own: syllable ambiguity.
-- **Crowd sharpness:** the steepest 50 ms rise of all 25 tiles summed at their alignment points goes from 1.6 dB
- (estimates) to 9.4 dB (shipped). In the rendered wall, the crowd's sharpest rise is 8.6 dB at −10 ms from the final
- beat.
-- `wall-groups.jpg` (each group's arrival and the final beat), `wall-slide.jpg` (a group sliding in), `contact.jpg`.
diff --git a/plans/release-34.md b/plans/release-34.md
@@ -1,43 +0,0 @@
-# Release 34 — judging montage clips, and finding the next phrase
-
-The operator, judging the slow-news cut (2026-10-18): the stale takes and old images go; then "plan next steps you can
-do while I judge the cuts" — all five approved. Records in `plans/release-34/`.
-
-| Lane | Branch | Record | State |
-|---|---|---|---|
-| N1 — the montage clip deck (`/projects/<id>/clips`), `montage-rulings.json` applied at render, `umtool rulings` | `r34/clip-deck` | [clip-deck.md](release-34/clip-deck.md) | merged `9cffa720`, live |
-| N3 — the phrase finder (`/tools/phrases`), `phraseScanMany`, the cue-text cache, `umtool phrases` | `r34/phrase-finder` | [phrase-finder.md](release-34/phrase-finder.md) | merged `c7eb9e45`, live |
-| N2 — a local speaker score per montage clip (`voice-match.json`), Score the voices, `umtool voice-match` | `r34/voice-match` | [voice-match.md](release-34/voice-match.md) | merged `ffa3a449`, live |
-| The wall on ffmpeg 7.1 (Docker): `fps` before every tile's `tpad` | `r34/wall-ffmpeg71` | [wall-ffmpeg71.md](release-34/wall-ffmpeg71.md) | merged `93e5c61e` |
-| Docker parity: the umtool image's render suite on ffmpeg 7.1 (tests only) | `r34/docker-parity` | [docker-parity.md](release-34/docker-parity.md) | merged `702684a7` |
-
-## Gates
-
-On `main` `ffa3a449`: tsc clean; test:scripts 1163 (4 skipped), common 4620 (2 skipped), umtool 45; docs env/files/cli
-checks clean. e2e (umtool, merged tree): clip-deck + phrase-finder + phrase-seed + takes + visual-audit 79/79;
-voice-match + clip-deck + phrase-finder + takes 13/13. umtool live `cMZ2VDYUoGpgR4ip1IBGc`.
-
-## Live on the slow-news project
-
-The three earlier rulings imported into `montage-rulings.json` (two for clips the seed had already dropped; s56 keep
-with the wider phrase): "1 of 73 ruled; the next render: 73 clips". Voices scored against solo uploads: 66 likely,
-4 unsure (s44, s45, s46, s66), 3 unlikely (s40, s39; s56 is the kept rebuttal).
-
-## Also done
-
-- The 10 stale takes deleted through umtool's delete route; old images (`archilyzer:local*`, `r18smoke`) removed and the
- capped builder's cache pruned to 25 GB (`/` 71 → 105 GB free).
-- The late-cut audit (`~/reports/overnight-2026-10-18/late-window-audit/`): 7 of 45 projects cut a clip from a
- late-starting window; built: quartering-diet (6, ≤ 3.3 s), quartering-walmart-shelves (2, ≤ 2.8 s), cornbreadman i1
- (2, ≤ 0.8 s), quartering-employee-count (2, ≤ 0.13 s). Re-renders are the operator's call.
-- Default images rebuilt without the local trees: `archilyzer:r33` 3.98 GB, `archilyzer:r33-umtool` 5.65 GB (smoke:
- doctor clean; 102/103 render tests in the container — the wall-finale length test is 23 frames short on Debian's
- ffmpeg 7.1.5: lane `r34/wall-ffmpeg71`).
-
-After both: host test:scripts 1165 pass / 0 fail (4 skipped); `archilyzer:r33-umtool` rebuilt from `702684a7`
-(5.66 GB) — its whole report-to-video suite on Debian ffmpeg 7.1.5: 622 tests, 618 pass, **0 fail**, 4 skipped.
-
-## Owed
-
-The operator's rulings and pick; `seed-manifest.py` still reads `edits.json` (rulings now live in
-`montage-rulings.json` — the deck's file wins at render).
diff --git a/plans/release-34/clip-deck.md b/plans/release-34/clip-deck.md
@@ -1,137 +0,0 @@
-# Release 34 lane N1 — `r34/clip-deck`: the montage clip audition deck (as shipped)
-
-The operator rules montage clips by ear ("#4 is another speaker, #6 is him reading a tweet, #58 only makes sense if
-she's refuting his claim"), and until now the orchestrator hand-edited the seed's `edits.json`. This lane is the app
-surface for it: one card per instance, swiped keep / cut / not him / read aloud, persisted through the app, applied at
-render. Rulings followed: audits get an app-like UI, one decision per item, persisted; the UI works with no model
-(nothing here calls one); no cards in the video; plain words; synthetic fixtures only.
-
-## What
-
-1. **The rulings store** — `<project>/montage-rulings.json` `{version: 1, rulings: {"<channel>/<video>@<cutStart to 2
- decimals>": {verdict, reason, match?, at}}}`, keyed by the source moment so a re-seed keeps every ruling.
- - The key rule, the shape check and the render application are `umtool/report-to-video/montage-rulings.mjs`
- (exported as `umtool-report-to-video/montage-rulings`); `clipMomentKey(entry, manifest)` is the one key function
- (the clip's `channel`, else `provenance.channelSlug`; `cutStart`, else `start`).
- - The one writer is `umtool/lib/report/montageRulings.mjs`: an in-process queue, tmp + rename, keys sorted, a file
- that does not parse never overwritten (and never read as empty).
- - **Import**: a seed's `edits.json` maps to moments — the clip with that video whose cutStart is nearest and within
- 30 s, else the seed's `instances.json` (a moment the seed already left out). An exclude's verdict comes from its
- words; a match keeps the clip with the wider phrase. Offered while some mapped moment is unruled, so once imported
- it is not offered again (no extra state).
-2. **Applied at render** — `applyMontageRulings` in build-video (on the variant view; `whole` stays as written for the
- validators and a bench `--fetch-only`; `--only <id>` keeps that clip) and verify-build: cut / not-him / read-aloud
- clips are left out of the cut and the wall; `match` replaces `montage.match`; when anything was left out the kept
- clips' `montage.n` / `montage.of` are numbered 1…N of N. No file, or nothing that changes anything, returns the same
- object: today's render byte for byte. The build log names each clip left out and why. `--no-rulings` on both. A file
- that does not parse refuses the build. The take maker applies the rulings BEFORE windowing, so a window counts over
- the whole kept cut; the take's own manifest (what a pick copies) stays as written.
-3. **The deck** at `/projects/<id>/clips` (`clipDeckHref`; the Cut tab's **Clips — n of N to rule** on a cut whose clips
- carry `montage`): built on R1's AuditionDeck patterns (swipe threshold and flick, stamps, the decided card flying out,
- the next card underneath with its media loading, the card after warmed, 20-deep undo, the bar under the thumb).
- - A card: the counter's number, the phrase, the cut playing from the project's cached window (the cited clip;
- **Wider**/`w` plays the clip's whole extent), the quote with the phrase marked, date · platform · channel · video,
- the clip's note (the seed's voice check, a stand-in upload), and voice-match.json's label and score when present.
- - Keys: → / `k` keep, ← / `x` cut, ↓ / `n` not him, ↑ / `r` read aloud, `e` keep with an edited phrase (Enter), `s`
- skip, `w` wider, space replay, `z` / Backspace undo, `?` keys. Reason chips (co-host, guest, a clip played, a post
- read out, chat read out, wrong moment, says something else) or a few words ride with the next ruling.
- - Filters: Unruled, Doubtful first (voice unlikely by score, unsure, a voice check in the note, then the rest),
- Ruled, All; `?show=` keeps it. One counter row: `n / N · k kept · c cut · h not him · r read aloud`, and `R of N
- ruled`.
- - End card: the counts, the clips left out with their reasons, **the next render** (GET's `plan`: the build's own
- application, the kept clips as it numbers them) and **Re-render the take** (the take maker's Rebuild job on the
- single picked take, else the single whole-cut maker take; otherwise a link to the Takes page), with how many
- rulings were made since that take was built.
- - Phone width: one column, the five rulings in a fixed bar under the thumb, no sideways scroll.
-4. **`umtool rulings <project>`** — show (`--json`: each clip, its key and ruling, the plan), `import [--dry-run]`,
- `set <clip|key> <verdict> [--reason] [--match]`, `clear <clip|key>`: the same writer.
-5. **The route** `GET/POST /api/report/montage-rulings` (`{project, clip, ruling|null}`; `{project, import: true}`); a
- ruling must name a clip the manifest has.
-
-## Files
-
-report-to-video: `montage-rulings.mjs` (new), `montage-rulings.test.mjs` (new, 9 tests: 6 pure, 3 real renders),
-`build-video.mjs` (apply on the variant view, the log lines, `--no-rulings`), `verify-build.mjs` (same file,
-`noRulings`), `package.json` (export), `README.md` (module row, "`montage-rulings.json`" section).
-umtool: `lib/report/montageRulings.mjs` (new), `montageRulings.test.mjs` (new, 8), `lib/report/rulingsCli.mjs` (new),
-`lib/report/clipDeck.ts` (new: the page data, voice-match.json read leniently), `lib/report/takeMaker.mjs` (+ test 1),
-`lib/hrefs.ts` (`clipDeckHref`, `CLIP_DECK_SHOWS`; + test 1), `app/api/report/montage-rulings/route.ts` (new),
-`components/projects/ClipDeckPage.tsx` (new), `components/projects/review/ClipDeck.tsx` (new),
-`components/projects/ProjectView.tsx` (the `clips` view), `components/projects/report/CutTab.tsx` (the link),
-`bin/umtool.mjs` (one dispatch + usage block), `docs/report-video.md` ("Ruling the clips"), `docs/cli.md` (one row),
-`e2e/clip-deck.spec.ts` (new, 2), `e2e/fixtures/clip-deck-fixture.mjs` (new) + `make-fixture.mjs` (registered),
-`e2e/visual-audit.spec.ts` (+ `bench-clips`). `editor/CHANGELOG.md`, `plans/FACTS.md` ("Release 34 lane N1").
-
-| Commit | What |
-| --- | --- |
-| `1a0b5a69` | report-to-video montage-rulings.mjs; build-video, verify-build, the take maker apply it; umtool's writer + import; tests |
-| `91735315` | the clip deck page, route, `umtool rulings`, Cut tab link, e2e fixture + clip-deck.spec |
-| `b1dbc15a` | docs, the visual audit's page and one filled action, synthetic test ids, FACTS, CHANGELOG |
-| (this commit) | this record |
-
-## Interfaces
-
-- `umtool-report-to-video/montage-rulings`: `MONTAGE_RULINGS_FILE`, `RULING_VERDICTS`, `LEFT_OUT_VERDICTS`,
- `VERDICT_WORDS`, `momentKey({channel, video, at})`, `clipMomentKey(entry, manifest?)`, `isMomentKey`,
- `parseMomentKey`, `parseMontageRulings(raw)`, `readMontageRulings(dir)` (null | doc | throws),
- `applyMontageRulings(manifest, doc, {keep?})` → `{manifest, left: [{id, key, verdict, reason}], matched: [{id, key,
- match, was}], renumbered}`, `rulingsLines(applied)`, `leftOutWords`.
-- `umtool/lib/report/montageRulings.mjs`: `readRulingsState(dir)` → `{exists, doc, error}`, `setMontageRuling(dir, key,
- ruling|null, {now})`, `setMontageRulings(dir, entries, {overwrite})`, `normaliseRuling`, `montageClipsOf`,
- `hasMontageClips`, `momentKeysOf`, `resolveRulingKey`, `verdictFromWhy`, `mapEarlierRulings(manifest, edits,
- instances)`, `earlierRulingsOffer(dir, manifest, doc?)`, `importEarlierRulings(dir, manifest, {dryRun})`,
- `renderPlan(manifest, doc)` → `{kept: [{id, n, of, match}], left, matched, lines}`.
-- `lib/report/clipDeck.ts`: `clipDeckView(project)`, `readVoiceMatch(dir)` (reads N2's `clips[key].{score, label,
- speechSeconds}`; a row not that shape is skipped; no file = null), `doubtOf`.
-- `clipDeckHref(project, {show?, note?})`; `GET /api/report/montage-rulings?project=` → `{rulings, error, plan, offer}`.
-
-## Gates (all through the shared lock, from the worktree root)
-
-- tsc (all packages): clean before each code commit and at the end.
-- test:scripts: **1141 (1137 pass, 4 skipped) at `main` `9d5df831` → 1160 (1156 pass, 0 fail, 4 skipped)**: +9
- montage-rulings, +8 montageRulings (store, import, CLI), +1 takeMaker, +1 hrefs.
-- umtool `test`: 45/45 before and after (no tests of mine in its globs).
-- Byte-identical: in-suite, the same four-clip montage rendered with no rulings file and with a file whose rulings
- change nothing (a keep, a moment the cut does not have) — identical md5 for the final and two segments; a ruled cut's
- kept clip #2 of 2 is md5-identical to a hand-numbered two-clip manifest's (the counter is drawn from the renumbered
- values); a ruled-out clip is not a wall tile; `--no-rulings` builds all four and verify-build agrees.
-- `archilyzer docs cli --check`, `docs files --check`: clean (no generated doc changes; `umtool` rows are cli.md's).
-- e2e umtool, single specs: `clip-deck.spec.ts` 2/2 (12.1 s, after one fix of the spec's reload step); `clip-deck` +
- visual-audit's `bench-clips` 3/3 (15.1 s, screenshots at 1366/1440 × dark/light and 390 px); `takes.spec.ts` +
- `visual-audit.spec.ts` 73/73 (1.5 min).
-- No editor, export, homepage or common code touched; their suites not run.
-
-## Smoke (the project read only; its manifest, edits.json and instances.json copied to scratch)
-
-- `umtool rulings slow-news import --dry-run` → three: two excludes (no longer in the manifest) through instances.json
- as not-him and read-aloud, and the widened phrase on s56 as keep; `import` wrote them; the show reads "1 of 73
- ruled; the next render: 73 clip(s)" (the seed had already applied all three).
-- `set s04 not-him` → the plan: 72 clips, s05 numbered #4 of 72.
-- A quick window take (straight, 0/20 s, `--skip-fetch`, the corpus read-only): the log names s04 left out; segments
- s01–s03, s05, s06 and no s04; s05's chip reads "#4". 12.9 s.
-
-## Decisions
-
-- Keys on the deck: ↓ / `n` is not him and ↑ / `r` read aloud (R1's ↓ skip and ↑ edit moved to `s` and `e`), as the
- brief asked; `x`/`k` keep R1's cut/keep.
-- `e` saves as **keep** with the phrase (editing the phrase is a decision to keep it wider), as R1's edit decides its
- card. A ruling keeps a phrase it already had when it is changed by a swipe.
-- A reason applies to whichever ruling comes next (keep included), not only cuts.
-- Renumbering happens only when a clip was left out, so applying twice (the take maker, then the build over the render
- manifest) changes nothing, and a window keeps the whole cut's numbers. Only `n`/`of` a clip already carries are
- rewritten; a clip with none is numbered by its place (planMontage) as before.
-- The rulings apply whether or not `render.montage` is set: the slow-news project's own manifest has no montage key (the
- takes add it), and a ruled-out clip is out of any cut.
-- The import offer has no "done" flag (the prelude's shape is exact): it offers what maps to a moment not yet ruled.
-- The deck's Start overlay and the Import button are outlines and the Cut tab's Clips link an outline, so a page keeps
- one filled action (the visual audit's rule).
-- No take is re-rendered by the deck when the choice is ambiguous (several picked, or none picked and several
- whole-cut takes): it links the Takes page.
-
-## Found and left
-
-- The slow-news project's two excluded moments are not in its manifest (the seed dropped them), so their rulings only
- matter if the seed is run again without `edits.json`'s excludes. `seed-manifest.py` still reads `edits.json`; whether
- it should read `montage-rulings.json` instead is the orchestrator's call.
-- kbd hints in the deck's bar show at phone width (the same `hidden md:inline` classes R1's deck uses lose to kbd's own
- display rule); left as R1 has it.
diff --git a/plans/release-34/docker-parity.md b/plans/release-34/docker-parity.md
@@ -1,23 +0,0 @@
-# Release 34 lane — report-to-video's suite on Debian's ffmpeg 7.1 (as shipped)
-
-In `archilyzer:r33-umtool` (ffmpeg 7.1.5-0+deb13u1), after r34/wall-ffmpeg71, the whole
-`umtool/report-to-video/*.test.mjs` had 6 failures. Every one was in the tests; no renderer code changed.
-
-| Test | Cause on 7.1 | Fix |
-|---|---|---|
-| cut-edits 11 (muteFrom), cut-edits 12 (end fade + hold), deck-room 17 (move inside the hold), dip 17 (dipped crossfade) | The test ran a build's graph with ONE output mapped and the other into an in-graph `nullsink`/`anullsink`. ffmpeg 7.1 aborts on that: `Assertion best_input >= 0 failed at src/fftools/ffmpeg_filter.c:2122`. The same graphs with both outputs mapped, as build-video runs them, are fine on 7.1 (checked on the end-fade and muteFrom graphs). Not the tpad-after-trim behaviour of r34/wall-ffmpeg71. | The other output goes to a second output with `-f null -`. An input's own stream (`[0:v]`) is mapped as `0:v`. |
-| av-sync 1 (the crossfade concat) | Its CONTROL (the old unpinned graph drifting ~60 ms) lands only 20 ms early on 7.1: the drift is not there to see. The pinned assertion passed. | The control is asserted when the drift is observable (≥ 45 ms); otherwise a diagnostic says so. The pinned assertion stands on every ffmpeg. |
-| heavy-gate 2 (lock file in the git common dir) | The image ships the tree without .git, so there is no common dir and the code correctly returns null. | Skipped with that reason when git finds no common dir. Its "outside a checkout → null" half is its own test, run everywhere. |
-
-## Gates
-
-- **Image, whole report-to-video suite:** before 620 tests (611 pass, 6 fail, 3 skipped); **after 622 (618 pass, 0 fail,
- 4 skipped)**. The new skip is the git test.
-- **Host:** the touched files 59/59. **test:scripts 1169 (1165 pass, 0 fail, 4 skipped).** tsc clean.
-- **Host output:** no renderer file changed (`git diff main --stat`: five `*.test.mjs` only), so every manifest renders
- as on main.
-
-| Commit | What |
-| --- | --- |
-| `53592e2a` | the five test files |
-| (this commit) | this record, CHANGELOG |
diff --git a/plans/release-34/phrase-finder.md b/plans/release-34/phrase-finder.md
@@ -1,114 +0,0 @@
-# Release 34 lane N3 — `r34/phrase-finder`: find the next montage phrase in the UI (as shipped)
-
-The catchphrase ranking of 2026-10-18 was made by a script a model wrote (a patched phraseScan for many phrases in one
-pass, because one phrase took 2.5+ min under load). Operator rule (2026-10-16): what a model can do is doable in the
-UI with no model. This lane makes the search a umtool page and a CLI, and a montage one click from a result. Nothing
-here calls a model.
-
-## What
-
-1. **`phraseScanMany`** (`common/lib/montage/phraseScan.mjs`): every phrase in ONE pass over the transcripts — each cue
- file read and parsed once, its text joined once (`joinCues`), every phrase matched in it (`hitsInJoined`); up to 16
- reads in flight, used in order. Each phrase's `{instances, hits, dropped, scanned}` is what `phraseScan` returns for
- it alone: `phraseScan` keeps its code path, and the placing/folding is one shared `foldHits`. A phrase may carry its
- own `exclude`. A twin's cues are re-read only when a hit is placed in it, so the preferred channel is never held in
- memory (phraseScan holds every record of it).
-2. **The cue-text cache** (`common/lib/montage/cueTextCache.mjs`): per channel one NDJSON file of each video's joined
- cue text, times and five record fields, in video-id order, plus an index of each cue file's mtime and size. Streamed
- a line at a time; rewritten only when something changed; a missing line falls back to the cue file and drops the
- index. Never under the channels dir (umtool's is `<UMTOOL_CACHE_DIR>/phrase-text`).
-3. **Plain words** (`common/lib/montage/phraseSource.mjs`, client-safe): `phraseSourceOf(text, "auto"|"words"|"regex")`
- — words become `\bw1[\s,.\-]+w2…(?:s|es)?\b` (apostrophes optional, consonant+y → `(?:y|ies)`); `auto` takes a
- phrase with a regular expression's characters as written.
-4. **`umtool phrases`** (`umtool/lib/phrase-finder/{cli,scan,summary}.mjs`, one dispatch block in `bin/umtool.mjs`):
- `"<p1>" "<p2>" --channels … --prefer … --exclude … [--words|--regex] [--samples N] [--no-cache] [--json|--full]`, and
- the page's job form `--spec F --out F --progress` (NDJSON progress lines). `summarisePhrase`: count, by year (gaps as
- 0), sparkline, Rumble/other (by platform), preferred/other (by channel), placed, speaker changes, excluded, raw hits,
- per channel, 10 samples spread over the years.
-5. **`/tools/phrases`** (`app/tools/phrases/page.tsx`, `components/tools/PhraseFinder.tsx`, `lib/phrase-finder/server.ts`,
- `/api/phrase-finder`, `/api/phrase-finder/<id>`, `/api/phrase-finder/context`): phrase rows (Add phrase, ×, the mode,
- "as words: /…/" under each), suggestions from `candidates.json`, the channel picker (filter, picked chips), prefer,
- exclude, **Search** (a child process, one at a time, polled progress, Stop), Recent; per phrase the count, year bars,
- the split, ten samples with **Play** (CitedClip: a window or saved video on disk, else Fetch clip) and **Transcript**
- (the cues around it, the hit's lit); **Compared** for several phrases; **Create montage** (slug prefilled
- `<phrase>-montage`). The next visit opens on the last search's settings (`last.json`). Rail: Tools → phrases;
- `/tools` lists it under Montage; the jump palette has it.
-6. **Create montage → the scaffold's phrase seed, from this search**: `/api/projects/new` with the seed's settings and
- `scan: {id, row}`; `scaffoldReportVideo` takes `scan` (the finished answer) instead of reading the corpus again,
- refused unless phrase, channels, prefer and exclude match. Same manifest, `phrase-scan.json` and README as a fresh
- seed (unit-tested byte for byte). The seed's channel check now allows mixed-case channel dirs (`CHANNEL_SLUG_RE`).
-
-## Files
-
-common: `lib/montage/{phraseScan.mjs, phraseScan.d.mts, phraseSource.mjs, phraseSource.d.mts, cueTextCache.mjs,
-cueTextCache.d.mts, phraseScanMany.test.ts}`, `package.json` (two exports). umtool: `lib/phrase-finder/{cli.mjs,
-scan.mjs, scan.d.mts, summary.mjs, summary.d.mts, server.ts, types.ts}`, `lib/phrase-finder.test.mjs`,
-`app/tools/phrases/page.tsx`, `components/tools/PhraseFinder.tsx`, `app/api/phrase-finder/{route.ts, [id]/route.ts,
-context/route.ts}`, `bin/umtool.mjs` (usage + one dispatch line), `lib/hrefs.ts` (`phraseFinderHref`),
-`lib/hrefs.test.mjs`, `components/AppNav.tsx`, `components/shell/JumpPalette.tsx`, `app/tools/page.tsx`,
-`lib/projects/{scaffold.mjs, scaffold.ts}`, `lib/scaffold-phrase.test.mjs`, `e2e/phrase-finder.spec.ts`,
-`e2e/visual-audit.spec.ts` (one page), `docs/{tools.md, cli.md, README.md}`. `plans/FACTS.md`, `editor/CHANGELOG.md`.
-
-| Commit | What |
-| --- | --- |
-| `f6ad3897` | common: phraseScanMany, phraseSource, the cue-text cache; 5 tests |
-| `f8fa7ced` | umtool: the page, the API, `umtool phrases`, the scaffold's `scan`; 4 tests |
-| `f6bb9374` | umtool: phrase-finder e2e, visual audit page, the answer folder made before writing (found by the e2e) |
-| `e22f1ab3` | docs: tools.md, cli.md, FACTS, CHANGELOG |
-| (this commit) | this record |
-
-## Measured (the real corpus, read-only, 2026-10-18)
-
-Channels the-quartering-rumble (prefer) + the-quartering, jeremy-hambly, quartering-live, cornbreadman: 23,312
-transcripts. Slow-news phrase = the project's `scan.py` regex; 25 phrases = it + the first 24 of the catchphrase
-report's candidates. Page cache warm after the first run; one process per row (`/usr/bin/time`).
-
-| Run | Wall | Max RSS |
-| --- | --- | --- |
-| `phraseScan`, slow-news | 27.5 s | 560 MB |
-| `phraseScanMany`, slow-news, no cache | 17.3 s | 192 MB |
-| `phraseScanMany`, 25 phrases, no cache | 29.0 s | 424 MB |
-| `phraseScanMany`, 25 phrases, building the cache | 36.3 s | 336 MB |
-| `phraseScanMany`, 25 phrases, cache warm | 20.8 s | 278 MB |
-| `phraseScanMany`, slow-news, cache warm | 6.4 s | 168 MB |
-
-The cache is 473 MB on disk for the five channels. Equal to `phraseScan` (deep-equal) on the real corpus for the
-slow-news phrase (76 instances) and six of the report's candidates (61–141 instances each). A first cache design (one JSON per channel, parsed whole) peaked at
-1.5–2.0 GB; the streamed NDJSON replaced it.
-
-## Gates
-
-All through the shared heavy lock, from the worktree root.
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean before each commit.
-- common: **4606 → 4611 (4610 pass, 1 skip)**; +5 `phraseScanMany.test.ts` (equivalence in three settings × three
- cache states, the cache following a changed file and a removed video and a truncated cache file, nothing written
- when nothing changed, progress, plain words).
-- `pnpm run test:scripts`: **1141 → 1145 (1141 pass, 0 fail, 4 skip)**; +3 `umtool/lib/phrase-finder.test.mjs`
- (checkSpec, the summary, `umtool phrases` job and terminal forms), +1 `scaffold-phrase.test.mjs` (a given scan makes
- the same project). `hrefs.test.mjs` gains two assertions.
-- umtool TS (`pnpm --filter umtool test`): 45/45, unchanged.
-- `docs env --check`, `docs cli --check`, `docs files --check`: clean (no common env var, CLI row or file schema).
-- umtool `next build` with the corpus linked (`ln -sT` + 5 GB cap): clean, 14.2 s compile; the phrase-finder routes'
- `.nft.json` carry 1069 files, the same as `/api/phrases`, none under `transcripts/`.
-- e2e (umtool, single specs, fixture): phrase-finder + phrase-seed: 2 passed, 1 failed (the answer folder, fixed);
- phrase-finder **1/1** (12.9 s); visual-audit (with `/tools/phrases`) + a scratch screenshot spec (not committed)
- **67/67** (1.4 min) — no horizontal scroll at 390 and 1366 px in either theme.
-- Not run: editor, mcp, export, homepage (untouched).
-
-## Decisions
-
-- Suggestions come from catchphrase reports' `candidates.json` (`UMTOOL_PHRASE_CANDIDATES`, else every
- `<REPORTS_ROOT>/<dir>/candidates.json`); no n-gram "Suggest" job (the report's mining is a heavier, separate tool).
-- Create montage seeds from the finished search (`scan: {id, row}`) instead of scanning again in the request: on the
- real corpus a re-scan would hold the request 17–30 s. The scaffold still scans when no search is given.
-- A search is a child process (`umtool phrases`), not in-process: the memory stays out of the server, and the CLI and
- the page run the same code. One search at a time (a second gets 409); it is not in the rail's Running list.
-- The cache is on by default for the page and the CLI (`--no-cache` to skip).
-- Rumble/other is by platform (`platform === "rumble"`), as the catchphrase report counted; the preferred channel's
- share is in `--json` and `bySlug`.
-- Mixed-case channel slugs are allowed by the phrase seed (they were refused, so HasanAbiVODs3 could never be seeded).
-
-## Rulings followed
-
-Nothing calls a model; every step is a page control; plain words in labels; no cards; synthetic fixtures only (the e2e
-writes and removes its candidates file); the real corpus read only; the slow-news project not touched.
diff --git a/plans/release-34/wall-ffmpeg71.md b/plans/release-34/wall-ffmpeg71.md
@@ -1,44 +0,0 @@
-# Release 34 lane — the wall's length on ffmpeg 7.1 (as shipped)
-
-The umtool image (`archilyzer:r33-umtool`, Debian trixie, ffmpeg 7.1.5-0+deb13u1) failed `montage.test.mjs`
-"render: wall-finale" with "420 vs 443". The host (ffmpeg n9.0.2) passed.
-
-## What
-
-- **Reproduced in the image** with the worktree's `umtool/report-to-video` mounted read-only over `/repo`'s: the four
- clip segments are exact (83/83 each), and the wall is 88 frames for its planned 111.
-- **One tile's chain**, `trim=end=1.2,setpts=PTS-STARTPTS,tpad=start_duration=0.5:start_mode=add:…:stop_mode=clone:stop_duration=2,trim=end_frame=60`,
- gives 36 frames on 7.1 and 60 on 9.x. On 7.1, tpad after a trim pads nothing at either end. That holds after trim
- with `end` or `end_frame`, after `select`, `null`, `format` or `split`, and with `stop=` as well as
- `stop_duration=`; a plain input pads fine.
-- **The fix:** `fps=<render fps>` immediately before each tile's tpad. With it, 7.1 gives 87 frames, the same as 9.x.
- Applied to both compose paths, the single wall and the grouped wall. In the grouped wall the canvas source had held
- the length, so its symptom was tiles vanishing after their phrase instead of freezing.
-- **No change on 9.x:** md5 of a wall-finale and a build-to-wall manifest (main's patches) are identical between main's
- and the branch's build-video, for the wall segment and the final.
-
-## Gates
-
-- tsc clean.
-- **Host test:scripts:** 1164 (1160 pass, 4 skipped) on main's code → **1165 (1161 pass, 0 fail, 4 skipped)**, with one new
- test: every wall tile's tpad is fed by fps.
-- **In the image:** `montage.test.mjs` + `montage-styles.test.mjs` **66/66**.
-- **The image's whole `umtool/report-to-video/*.test.mjs`:** 620 tests, 611 pass, 6 fail, 3 skipped. None of the 6 are
- the wall, and all fail on main's code too; not fixed here:
-
- | File | Test |
- |---|---|
- | av-sync | 1, the crossfade concat |
- | cut-edits | 11, muteFrom |
- | cut-edits | 12, the end fade with a hold |
- | deck-room | 17, a move inside the hold |
- | dip | 17, a dipped crossfade |
- | heavy-gate | 2, the checkout's lock file beside the e2e queue in its git common dir |
-
- The heavy-gate failure comes from the container's git, not ffmpeg. The deck holds are `tpad=stop_mode=clone` too
- (`holdVideoFilter`), so the same 7.1 tpad behaviour is the likely cause of the ffmpeg ones.
-
-| Commit | What |
-| --- | --- |
-| `bf419ab0` | fps before each wall tile's tpad; the test |
-| (this commit) | this record, CHANGELOG |
diff --git a/plans/release-35.md b/plans/release-35.md
@@ -1,60 +0,0 @@
-# Release 35 — the clip finder: Archilyzer as an assisted clipping tool
-
-The operator (2026-10-18 night): a bespoke clip video of a reaction livestream, cut to where the host comments on and
-laughs at the narrated video, above all other video work — "a significant step in adding the ability to use the
-Archilyzer as an AI-assisting clipping tool", with "an easy way for a human to hop in and either comment or manually
-adjust clips created by an assistant". Quartering montages cancelled (the cornbreadman re-render kept). Plan of record:
-[clip-finder.md](release-35/clip-finder.md). Records in `plans/release-35/`.
-
-| Lane | Branch | Record | State |
-|---|---|---|---|
-| C1 — the clip finder's analysis: `common/lib/clips` (roles, laughs, moments, proposals, `assist`), `scripts/audio-tag.py` (CED-mini), voice centroids + the laugh voice check, `umtool new --seed reactions`, `umtool clips analyze\|propose\|show`, the Highlights seed | `r35/clip-analysis` | [clip-analysis.md](release-35/clip-analysis.md) | merged `151d7c55`, live |
-| C2 — the clip editor at `/projects/<id>/clips` for a non-montage cut: trim, split, merge, add, restore, keep/cut, comments as notes, This is the host + Re-propose | `r35/clip-editor` | [clip-editor.md](release-35/clip-editor.md) | merged `af6d3ead`, live |
-| O1 — montage operations: phrase-scan alternates, the phrase seed's cap, Fetch windows from umtool, stand-ins for refused windows | `r35/montage-ops` | [montage-ops.md](release-35/montage-ops.md) | merged `9d0ab192`, `51375531`, `6552cd6e`, live |
-| O2 — `render.chrome.fx`: ten opt-in overlay effects (reaction captions, punch-in, whip, kinetic quote, odometer, glitch, THEN/NOW, redaction, scrubber, receipts, zoom); the Takes page's Effect list | `r35/hyperframes-fx` | [hyperframes-fx.md](release-35/hyperframes-fx.md) | merged `c921d0a5`, live |
-
-## Gates
-
-On `main` `af6d3ead` (all four lanes): tsc clean; common 4651 (4649 pass, 2 skipped); test:scripts 1251 (1247 pass,
-4 skipped); umtool 45/45; docs env/files/cli and settings-example checks clean. umtool e2e (whole suite): 569 passed, 3 failed, 6 skipped — a kind literal in the phrase finder and the editor
-stub's new fetch-windows route writing into other specs' channels; fixed `r35/e2e-fixes` (merged `6552cd6e`), rerun of
-the five affected specs 31/31 (montage-ops, clip-editor, clip-deck, article-iterations, projects). umtool live
-`ZSRoW9GrxDQIsyZyAKYKf`; editor untouched.
-
-## The first case: "The Nik Drop" (Harmful Opinions, fGSRhEWc9M4, 2 h 34 min)
-
-- Channel `harmful-opinions` created (transcribe handling, no site, no playlist); the video imported and its saved
- video persisted; word timings (`pnpm ops transcribe {words:true}`, 24,524 words) and the corpus transcript through
- the GPU worker; diarization (sherpa-onnx, 24 min, 30 clusters).
-- The recording holds two narrated videos: the Nikandros video (≈290–6000 s) with the host's talk after it to ≈6300 s,
- then another narrator from ≈6500 s. Scope 0–6300 s.
-- Host = cluster 1, subject = cluster 4 (TitaNet centroids at cosine 0.02). The small clusters match neither voice.
- CED-mini laughs: 48 at laughMin 0.25, 34 re-attributed by voice — the narrator's voice-acted laughs are his, and
- the host laughing over the narration is the host's.
-- `~/reports/nik-drop-clips`: 20 assistant clips, 614 s of a 600 s target, 92 unused proposals → render
- `out/nik-drop-clips.mp4` (617 s, verify clean). Each clip's QR links the YouTube upload at its second.
-
-## Edits to the cut (2026-10-19 morning; the operator fixed only an invalid manifest)
-
-- Cut after ≈9:47 (r017, the host browsing for other videos: a Cut ruling through the clip editor); the cut now ends
- on "Nikandros' favourite DM". The "OSINT autist" comment (proposal p021, 1007–1050 s) brought in.
-- No on-screen UI for a one-video, no-site cut: `headerHeight: 0`, `footerHeight: 0`, `qr: false`. Joins dip through
- black: new `render.transitionStyle` (`fade` default, `fadeblack`, `fadewhite`, `dissolve`; merged `ff6d0fbb`).
-- Render: `out/nik-drop-clips.mp4` 620.9 s, 20 clips, 19 dips, verify clean.
-
-## Also done
-
-- Editor e2e over releases 33–34 on `6fda0f58`: 723 passed, 12 skipped, 0 failed.
-- Re-renders beside the old outputs (`out-r35-recut/`): Walmart (193.5 → 193.8 s; c09 +0.27 s) and cornbreadman
- then-and-now i1 (287.37 → 287.17 s; ga-deals starts 0.43 s earlier; 25 of 26 segments within a frame). Diet dropped.
-- Research: `~/reports/journalism-pitches-2026-10-19/PITCHES.html`, `~/reports/overnight-2026-10-19/ROADMAP.html`.
-
-## Owed
-
-- The clip finder's seed leaves `provenance.siteOrigin` empty for a channel on no site: write a per-clip `citeUrl` to
- the platform's watch URL instead (done by hand on nik-drop-clips).
-- Even loudness for highlights cuts (the montage has it; nik-drop-clips is −19.1 LUFS).
-- `umtool build` only prints its chain; a CLI render is `build-video.mjs` (or the project page's button).
-- Notes on a clip merged away stay on its old id.
-- The transcription pool's pause snapshot now holds the GPU worker as disabled (it served the two manual jobs, then was
- drained): re-enable it on `/workers` when resuming transcription.
diff --git a/plans/release-35/clip-analysis.md b/plans/release-35/clip-analysis.md
@@ -1,113 +0,0 @@
-# Release 35 lane C1 — `r35/clip-analysis`: finding the clips (as shipped)
-
-The plan of record is [clip-finder.md](clip-finder.md); this lane is its analysis half: from a long recording's
-speaker turns, words and sound to clip proposals in a report-video manifest, each marked as the assistant's, and
-`reactions.json` beside it. Lane C2 (`r35/clip-editor`) is the review UI over the same two shapes.
-
-## What
-
-- **`common/lib/clips/`** (plain ESM + `.d.mts`, exported as `yt-dlp-transcript-common/lib/clips/*.mjs`):
- - `clips.mjs` — pure: `assignRoles` (host = most turns < 8 s × widest spread over 20 bins; subject = most seconds
- of the rest; < 1 % of the speech never wins; a third cluster whose TitaNet centroid is ≥ 0.6 like the host's or
- subject's takes that role with `sameAs`; the operator's roles stand), `laughEvents` (runs ≥ `laughMin`, joined
- across 0.5 s, mean score), `textLaughs` / `energyLaughs` (the no-model fallback), `attributeLaughs` (a host turn
- overlapping makes it the host's), `findMoments`, `momentSpan` / `buildProposals` (setup → reaction → tail,
- snapped to word gaps, merged, capped), `stableIds`, `rankIntoTarget`, and `analyze` (all of it).
- - `assist.mjs` — `validateAssist`, `clipFromProposal`, `fixedClips`, `applyProposals` (the one proposal-to-clip
- writer: an untouched assistant clip is moved in place or removed; everything else stays).
- - `reactions.mjs` — `readReactions`, `writeReactions` (tmp + rename), `operatorRoles`, **`setSpeakerRole`** (C2's
- write: the operator's "This is the host").
- - `scan.mjs` — `resolveTagger`, `tagWavs`, `runAudioScan` (1 s windows / 0.5 s hop: level always, laugh score with
- the tagger; 300 s chunks, one tagger process per 4), `centroidPieces`, `speakerCentroids` (voiceMatch's
- `embedWavs` + `robustCentroid`).
-- **`scripts/audio-tag.py`** — sherpa-onnx `AudioTagging` (CED-mini), modelled on `speaker-embed.py`: wavs in,
- per-window probabilities of the requested classes out (JSON, 4 dp, one thread). Proved on the model's bundled
- `test_wavs/4.wav` (laughter): whole-file family sum 0.99; per-window 0.84 peak; the JS driver over the same file
- in 4 s chunks gives the same 19 values as the script alone.
-- **umtool** (`umtool/lib/report/reactions.mjs`): `loadRecording` (diarization required — the refusal names
- `archilyzer diarize backfill --scope video:<channel>/<id>`; words from `<project>/words.json` > corpus
- `transcript.json` > cues), `recordingAudio`, `scanRecording` (cached in `<project>/scans/`), `proposalPass`,
- `proposeProject` (manifest via `replaceManifest` with a token and an undo point, retried on a stale token;
- ruled and locked clips protected), `clipsCommand` (`umtool clips analyze|propose|show`), `clipsSteps` (the job).
- `scaffold.mjs` gains `--seed reactions` (and `seedsFor().reactions`); `umtool new --seed reactions` then runs
- `clips analyze` unless `--no-analyze`. `/api/report/clips` (GET summary / job, POST start, cancel). The
- new-project form's seed "highlights" (+ target) and Create's line **Highlights from a recording**, which starts
- the analyze job after creating the project.
-- **The validator:** `validateAssist` in report-to-video's build validators and `lint.mjs validatorErrors`, and in
- umtool's manifest writer's `structureErrors`. The renderer ignores the key.
-- **Test kit:** `testing/clips/reactionStream.mjs` (a synthetic reaction stream: turns, words, cues, laugh windows,
- its sound, and `writeReactionCorpus`), `testing/audio/fakeAudioTag.mjs` (the shim's stand-in: it hears the
- stream's 1.5 kHz laugh tone). The umtool e2e app runs the fake tagger (`AUDIO_TAG_*` in playwright.config.ts).
-
-### The live case's findings, folded in (the orchestrator's run on the first case)
-
-- **Scope**: `params.scope: [from, to|null] | null` — turns cut to it, words and laugh windows wholly inside it,
- duration = its end; CLI `--scope FROM:TO|all` or numeric `--from S --to S` (the plan's `--from <channel>/<id>`
- keeps its meaning: a number is the scope); the seed and the form (From s / To s) take it.
-- **Centroids computed in `clips analyze`**: the longest clean turns, 24 for the two clusters with the most seconds,
- 6 for each other (30 clusters at threshold 0.9 on the live case; host and subject at cosine 0.02).
-- **Laugh voice check**: each laugh's span (≥ 1.5 s, centred) embedded; host if host ≥ 0.2 and host − subject ≥ 0.1,
- subject on the mirror (`by: "voice"`), else the overlap rule; `voice: {host, subject}` on every checked laugh; a
- laugh the voice gives the subject weighs 0.3. Embeddings kept in the voices scan.
-- **laughMin** settable from the CLI (`--laugh-min`, already), the seed (`umtool new … --laugh-min`) and the form
- (**Laugh min**); default stays 0.25.
-- **The floor**: proposals under 5 s are widened to 5 s (snapped) before ranking; `rankIntoTarget` never uses one
- under 5 s or under score 0.2.
-
-## The shapes (owned here; C2 codes against them)
-
-Exactly the plan's, plus optional keys (FACTS.md, "Release 35 lane C1"): `source.wordsFrom`, `source.audio`,
-`source.audioKind`, `speakers[].sameAs`, `laughs[].src` ("text" | "energy"; absent = the model), `laughSource`,
-`scans`, `madeAt`, `proposedAt`, `rolesChangedAt`; `speaker: null` on a laugh or moment heard in no turn; an unused
-proposal has `clipId: null`; laughs may carry `voice: {host, subject}` and `by: "voice"`; `params.scope`. A proposal's `start`/`end` IS the clip's cut (`cutStart`/`cutEnd`); the clip's
-window is 1.5 s wider each side (`assist.original` carries all four).
-
-## Rulings followed
-
-- The UI works without AI: every step is signal processing plus two small local models (CED-mini, TitaNet), and the
- no-model fallback (transcript markers + energy) runs the whole loop. Nothing calls an LLM; no network.
-- Fetches and transcription are not done here: words come from `pnpm ops transcribe {words: true, out}`; the sound
- is whatever the corpus already holds.
-- Records state rulings, not reasons; no corpus content in fixtures (the stream is numbered filler words).
-
-## Commits
-
-| sha | what |
-|---|---|
-| `9da7c408` | common: lib/clips — roles, laughs, moments, proposals, reactions.json, the assist key; test kit stream |
-| `318eb9d2` | common: the laugh scan + voice centroids, scripts/audio-tag.py, the fake tagger |
-| `ada3e840` | umtool: `--seed reactions`, `umtool clips analyze\|propose\|show`, validateAssist wired |
-| `98a208e9` | umtool: seedsFor's reactions key; the frames test's words kept |
-| `71d70f47` | umtool: the form's "highlights" seed, Create's line, the clips job route; create.spec |
-| `9911841f` | docs: cli.md, report-video.md "Highlights", FACTS, ENVIRONMENT.md (AUDIO_TAG_*), CHANGELOG |
-| `455318e8` | plans: this record |
-| `a62cdc98` | clips: the live case's findings — scope, centroids, laugh voice check, laughMin in seed/form, the floor |
-| (this) | plans: the record's gates |
-
-## Gates (all through the shared lock, from the worktree root)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean at `ada3e840` (8.7 min, the lock shared)
- and at `71d70f47`'s tree (umtool tsc after the e2e edits: clean).
-- common `pnpm --filter yt-dlp-transcript-common test` — 4648 tests, 4646 pass, 2 skipped (the one failure in that
- run was `ENVIRONMENT.md is stale`, an artefact of editing envVars.ts mid-run; regenerated and re-run green). Before
- this lane: 4627 (21 new: clips.test.ts 16, scan.test.ts 5).
-- `pnpm run test:scripts` — 1182 tests, 1178 pass, 0 fail, 4 skipped (before: 1175; 7 new in
- `umtool/lib/report/reactions.test.mjs`; `scaffold-frames.test.mjs` updated for seedsFor's new key).
-- `pnpm archilyzer docs env --check` — clean (ENVIRONMENT.md regenerated: four `AUDIO_TAG_*` rows).
-- After `a62cdc98`: full tsc clean; `common/lib/clips/*.test.ts` 24/24, `umtool/lib/report/reactions.test.mjs` 8/8,
- scaffold-frames + scaffold-phrase green. The full common suite and test:scripts were queued behind the shared lock
- at hand-off (logs `$T/r35c1-commontest2.log`, `$T/r35c1-testscripts2.log`).
-- e2e `create.spec.ts` (umtool, `E2E_MODE=dev`, with the new "Highlights from a recording" test): NOT RUN — it sat
- 14 min behind the machine's heavy slot (the live case's diarization, a `next build`) while holding the session's
- shared lock, and was stopped so the other lanes' tsc could run. The orchestrator's full umtool suite covers it.
-- No build: the slice changes umtool, and its one e2e spec ran under `next dev`.
-
-## Found and left
-
-- The plan's example shows a proposal's span wider than its clip's cut; here the proposal IS the cut and the window
- is the pad. Same keys, recorded above.
-- CED's per-class outputs are independent sigmoids, so the family's sum can pass 1; it is clamped. On 1 s windows the
- scores run lower than on a whole laugh (0.84 peak vs 0.99 on the bundled laugh file): `laughMin` 0.25 is the plan's
- default, to be calibrated on the first case (`--laugh-min`).
-- Multi-host streams (more than one host role) are later (the plan's "Later"): `setSpeakerRole` keeps one host and
- one subject.
diff --git a/plans/release-35/clip-editor.md b/plans/release-35/clip-editor.md
@@ -1,91 +0,0 @@
-# Release 35 lane C2 — `r35/clip-editor`: a person hops in on an assistant's clips (as shipped)
-
-The operator: "Add the ability in the UI for an easy way for a human to hop in and either comment or manually adjust
-clips created by an assistant." This lane is that surface: the clip editor at `/projects/<id>/clips` for a report video
-whose cut is not a montage — the clip finder's highlights above all (lane C1 writes them, each with `assist`), and any
-other report video's clips. Rulings followed: the UI works with no model (nothing here calls one; every proposal the
-assistant makes a person can make, undo or adjust); every review step is a umtool surface; comments are notes
-(`notes.json`, anchored to the clip, the `umtool notes` agent loop); the montage deck stays as it is; plain words, no
-lead paragraphs; role tokens and the redesign's primitives; synthetic fixtures only.
-
-## What
-
-1. **The writers** — `umtool/lib/report/manifest.mjs`, the one manifest writer:
- - `updateClip(dir, id, patch, {token, edit = "trim", now})`: a clip that carries `assist` and whose cut moved gets
- `assist.by = "operator"` and an appended edit `{at, by: "operator", what, from: {cutStart, cutEnd}, to: {cutStart,
- cutEnd}}` (newest 200 kept). A trim that leaves the cut where it was records nothing; a clip with no `assist` is
- edited exactly as before (the clip bench's edits of an assistant's clip are recorded the same way).
- - `restoreClip(dir, id)`: `assist.original` back (read inside the lock), an edit `restore`, and `by` the
- assistant's again.
- - `splitClip(dir, id, at, {quotes})`, `mergeClips(dir, id, {quote})`, `addClip(dir, spec)`: structural — an
- `auto-before-<op>` snapshot first (the Cut tab's Undo takes it back) and the build's structure checks after (with
- C1's `validateAssist` once both lanes are merged). Split: at a second half a second inside the cut; the first half
- keeps the id and `original`, the second is `<id>-2` (the operator's, no `original`, no `claim`). Merge: with the
- next timeline entry, which must be a clip of the same recording (a card between them refuses). Add: in time order
- among the recording's clips, `assist {by: "operator", edits: [add]}`; a proposal brought in also keeps `proposal`,
- `score`, `why` and the proposal's edges as `original`.
-2. **The operations** — `umtool/lib/report/clipEditor.mjs` `runClipEditorOp`: trim (a clip with a cut moves the cut and
- widens its extent to hold it; one without moves its extent; an assistant's clip's `quote` becomes the words of the new
- span), restore, split (each half quoted from the words), merge, add, bring-in, ruling (`keep` | `cut` | clear, in
- `montage-rulings.json` through the release-34 writer, keyed `clipMomentKey`), role. **Rulings follow their clips**:
- after every manifest operation a ruling whose clip's moment key changed moves to the new key, and one whose clip is
- gone (merged away) is removed. `clipEditorView` (the clips, the token, the speakers, the proposals not in the cut) and
- `clipNeighbourhood` (turns, laughs, words — the project's `words.json` or `reactions.source.words` — else the clip's
- cues) feed the page. `GET/POST /api/report/clip-editor`.
-3. **The page** — `/projects/<id>/clips`: `ClipDeckPage` renders `ClipEditorPage` when the manifest has no montage clip
- (or `?mode=edit`); `?clip=<id>` selects. The Cut tab's **Clip editor — n clips · k by the assistant**.
- - The player loops the cut from what `/api/cited/play` finds (the neighbourhood, else the extent): a saved video, a
- clip window, or audio. It is looked up by the clip's extent, so a trim does not reload it.
- - The strip: ± 60 / 20 / 6 s; turns in two lanes coloured host (Signal) and subject (Meter), laughs (Doubt), word
- ticks, the other clips (a click opens one), the cut with two drag handles, the playhead; a drag selects a span
- (**Add a clip**); a click seeks. The words under it (the cut's lit, the one playing marked; a click seeks).
- - Edges: a number field each, nudges ±0.1 / ±0.5 / ±2 s, **at playhead**, **Snap to words** (word gaps, the edges of
- a silence between turns, else cue boundaries, within 1.5 s). Drafted locally, written once after 450 ms.
- - Keep / Cut (toggle), Split here, Merge with next, Restore the assistant's version, Bring in (the proposals no clip
- names), This is the host / Not the host (a click on a turn, or the Speakers list), Re-propose (offered after a role
- change: the clip finder's proposal pass as a job), Render (the picked or whole-cut take again, else the
- Takes page).
- - Provenance: "by the assistant · 0.83 · why" / "edited by you · …" / "added by you" / "brought in by you", and the
- edit history.
- - Comments: the clip's notes (`{kind: "entry", entry}`), their threads with an agent's replies, Resolve / Won't fix
- / Reopen / Reply, a box for another (no autofocus, so the keys keep working).
- - Keys: space, `j` / `l`, `i` / `o`, `s`, `m`, `k`, `x`, ← / →.
-4. **The seam onto C1** — `umtool/lib/report/clipEditorBridge.mjs` holds `readReactions` (lenient: `{doc, error}`) and
- re-exports C1's `setSpeakerRole` (until C1 merged it held a local stand-in; wired after the merge of main
- 151d7c55). Re-propose posts `/api/report/clips {project, mode: "propose"}` and follows the job, offered while
- `rolesChangedAt > proposedAt`; a bring-in uses C1's shape (the proposal is the cut, the window `WINDOW_PAD_S` wider).
-
-## Files
-
-umtool: `lib/report/manifest.mjs` (updateClip's assist edits; `restoreClip`, `splitClip`, `mergeClips`, `addClip`,
-`noteAssistEdit`, `cutOf`, `RESTORE_PATCH`, `ASSIST_EDITS_MAX`), `lib/report/clipEditor.mjs` (new),
-`lib/report/clipEditorBridge.mjs` (new), `lib/report/clipEditorModel.mjs` (new, pure), `lib/report/clipEditorTypes.ts`
-(new), `lib/report/clipEditor.test.mjs` (new, 13 tests), `lib/hrefs.ts` (`clipEditorHref`; + test 1),
-`app/api/report/clip-editor/route.ts` (new), `components/projects/ClipEditorPage.tsx` (new),
-`components/projects/review/ClipEditor.tsx` (new), `components/projects/ClipDeckPage.tsx` (the editor for a
-non-montage cut), `components/projects/ProjectView.tsx` (`mode`, `clip`), `components/projects/report/CutTab.tsx` (the
-link), `e2e/clip-editor.spec.ts` (new), `e2e/fixtures/clip-editor-fixture.mjs` (new), `e2e/fixtures/make-fixture.mjs`,
-`docs/report-video.md` ("Reviewing assistant clips: the clip editor"), `docs/notes.md`. `editor/CHANGELOG.md`,
-`plans/FACTS.md` ("Release 35 lane C2").
-
-## Gates
-
-All on the final tip (after merging main with C1 151d7c55 and O2 c921d0a5), through the session lock:
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean (also clean before each code commit:
- umtool's tsc per commit, the full workspace before the record).
-- `pnpm run test:scripts` — 1251 tests, 1247 pass, 4 skipped, 0 fail (main at the lane's start, before C1/O2: 1175 /
- 1171 / 4; this lane adds 14: `lib/report/clipEditor.test.mjs` 13, `lib/hrefs.test.mjs` +1; the rest is C1's and O2's).
-- `pnpm --filter umtool test` — 45 / 45 (unchanged).
-- e2e `pnpm --filter umtool run e2e clip-editor.spec.ts` (on 86351e2a, after the C1 wiring): **1 passed, 0 failed**,
- spec 5.8 s, wall 14.9 s (the start-mode build 1186 s; most of the hour was the machine's heavy queue).
-- Read-only check against the live `~/reports/nik-drop-clips` through `clipEditorView` / `clipNeighbourhood`: 20 clips,
- 7 speakers, 92 of 112 proposals not in the cut, a neighbourhood of 29 turns, 2 laughs, 287 words.
-- Not run: `clip-deck.spec.ts` (the deck's only change is the guarded early return for a non-montage cut) — the full
- suite covers it.
-
-## Found and left
-
-- A clip merged away leaves its notes anchored to an id no clip has; they still list under `umtool notes` (the anchor
- resolves to nothing). Not migrated.
-- The unused-proposal list is every proposal no clip names, best first — 92 on the live nik-drop-clips project. No
- paging yet; it scrolls in the side column.
diff --git a/plans/release-35/clip-finder.md b/plans/release-35/clip-finder.md
@@ -99,7 +99,7 @@ strip has `by:"operator"` and no `proposal`. Rulings (keep / cut) reuse `montage
JS (`decodeSpan` from voiceMatch), `umtool new <slug> --seed reactions --from <channel>/<id> [--target S]` and
`umtool clips analyze|propose <project> [--target S] [--host <speaker>]` (re-propose after a role flip or a param
change, never touching clips the operator edited), the `assist` key in the manifest validator, the New project
- form's "highlights from a recording", docs, FACTS, record `plans/release-35/clip-analysis.md`.
+ form's "highlights from a recording", docs, FACTS, record `plans/archive/report-video.md` (entry `release-35/clip-analysis.md`).
- **C2 `r35/clip-editor` (umtool UI):** the clip editor — `/projects/<id>/clips` grows an editor mode for report-video
projects (the montage deck stays as it is): a player looping the selected clip from the saved video; under it a strip
for the clip's neighbourhood (± 60 s) with the speaker turns in two colours, laugh marks, the words; in/out handles
@@ -110,7 +110,7 @@ strip has `by:"operator"` and no `proposal`. Rulings (keep / cut) reuse `montage
Re-propose); Render a take. All writes through one server writer (`updateClip` + an `assist.edits` append);
keyboard: J/K/L, I/O set in/out, S split, M merge, K keep, X cut. Works on any report-video project (no reactions.json
→ no strip colours, still trims/comments). e2e `clip-editor.spec.ts` on a fixture project; record
- `plans/release-35/clip-editor.md`.
+ `plans/archive/report-video.md` (entry `release-35/clip-editor.md`).
The orchestrator: runs the live pipeline on the first case, renders the first cut BEFORE the lanes land (by driving the
same steps from the CLI where they exist), then re-runs it through the shipped feature, merges, gates, ships umtool.
diff --git a/plans/release-35/hyperframes-fx.md b/plans/release-35/hyperframes-fx.md
@@ -1,68 +0,0 @@
-# Release 35 lane O2 — `r35/hyperframes-fx`: the effects region (as shipped)
-
-Ten opt-in overlay effects for report videos with the on-screen deck, under `render.chrome.fx`, drawn by ONE
-HyperFrames page for the whole cut over exactly the footage box (`chrome-fx.mjs`, region `fx`), scheduled by `fx.mjs`
-from the build's own clock. Overlays on the evidence, never cards. Mid-lane the orchestrator re-prioritised to
-reaction-highlight clipping; the reaction effects (two-voice captions, punch-in, whip) and a Reaction preset were added.
-
-## What
-
-| Effect (`render.chrome.fx.<key>`) | Draws | Reaction-ready |
-|---|---|---|
-| `kineticQuote` | the clip's line word by word as said, the punch phrase popped in the accent; two speakers on their own sides and colours (captions' `>>` / dash turns, or the entry's `fx.speakers`), labels only from `voices` | yes |
-| `punchIn` | the footage snaps in (crop of the box at the join, `punchInParts`) on marked seconds (`fx.punchIn`) and captioned laughs, with a flash and viewfinder corners | yes |
-| `whip` | the cut slides (`xfade=slideleft` on that join) with streaks; a hard cut streaks only | yes |
-| `odometer` | a rolling count per clip (`montage.n`, else place) at the punch phrase | yes |
-| `glitch` | a seeded VHS tear, the new year and a PLAY stamp at cuts between years (`on: "every"`: every cut) | yes (`on: "every"`) |
-| `redact` | the line under black bars that lift as each word is said | — |
-| `scrubber` | a date rail, the playhead sliding to each clip's day with its thumbnail | — |
-| `thenNow` | a pair's cut becomes a `wipeleft` crossfade, the divider riding its edge with both dates | — |
-| `receipts` | a clip's screenshots fan in, a marker swipes each `mark` | — |
-| `zoom` | a screenshot locks on to `focus` and pushes in | — |
-
-- **Files:** `umtool/report-to-video/fx.mjs` (new: validation, schedule, presets, cue compiler), `chrome-fx.mjs` (new:
- the page), `deck.mjs` (`fxGeometry`, `validateChrome` knows `fx`, `deckSchedule` writes `fx` only when on),
- `compose-chrome.mjs` (`--region fx`, `copyFxShots`, `fxThumbs`), `build-video.mjs` (`fxClipWords`, `fxRegion`, the
- fx render in `renderDeck`, `segmentJoins` wipe/whip/zoom, `punchInParts`, `xfadeGraph` wipeleft/slideleft,
- `xfadeBatchJoins`, `concatRecordText` zoom, `validateFxEntries` in the validators), `lint.mjs`, `verify-build.mjs`
- (fx frames), `package.json` (`./fx` export); umtool: `TakesPage.tsx` + `NewTakePanel.tsx` (the **Effect** list,
- `data-take-effect`), `lib/report/takeCli.mjs` (`umtool take --effect`, `umtool takes effects`); tests `fx.test.mjs`,
- `chrome-fx.test.mjs`, `takeMaker.test.mjs` (+1), `e2e/takes.spec.ts` (+1); docs README, `docs/report-video.md`,
- `docs/cli.md`, FACTS, CHANGELOG.
-- **Interfaces:** `fxSchedule`, `fxPresetsFor(manifest)`, `fxSuggestPairs`, `validateFx`, `validateFxEntries`,
- `fxWordsOf`, `fxWipeJoins` / `fxWhipJoins` / `fxZoomJoins`, `speakersOf`, `compileCues` (fx.mjs); `fxHtml`, `fxPlan`
- (chrome-fx.mjs); `fxGeometry` (deck.mjs); `fxClipWords`, `fxRegion`, `punchInParts` (build-video.mjs).
-
-## Rulings followed
-
-- Absent = byte-identical: a synthetic 4-clip deck fixture (clips carrying inert entry `fx`) built by main's code
- (6fda0f58) and the branch's: identical md5 for the final, all four segments and `schedule.json`.
-- Nothing calls a model; every effect is a manifest key a person sets, and the Takes page offers each as a preset patch
- a person edits (operator rule 2026-10-16). Speakers are told apart, never named: no label unless the manifest gives one.
-- The demo used only windows already on disk (`provenance.channelsDir`, `CHANNELS_DIR`, no `siteOrigin`, takes'
- `--skip-fetch`), the cached hyperframes 0.8.24 (`HYPERFRAMES_BIN`), telemetry off.
-- A montage still refuses `render.chrome`; the effects are for deck cuts (any report-video clip entry).
-
-## Gates
-
-- tsc (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`): clean before every commit.
-- `pnpm run test:scripts`: 1169 (1165 pass, 4 skipped) at the branch's start → **1218 (1214 pass, 0 fail, 4 skipped)**:
- `fx.test.mjs` 30, `chrome-fx.test.mjs` 19 (±1-frame cue times for every effect; Chromium-still pixel checks for the
- kinetic line, redaction, receipts' marker, zoom push, odometer, glitch, scrubber playhead, punch-in flash, whip
- streaks; ffmpeg checks that the divider rides `xfade wipeleft`'s edge and that the punch-in graph changes only the box
- between its seconds; compose-chrome's fx region through a stub renderer and its cache), `takeMaker.test.mjs` +1.
-- umtool unit (`pnpm --filter umtool test`): 45/45.
-- umtool e2e `takes.spec.ts` (its prebuild is the capped umtool build): **8 passed**, 0 failed, 19.4 s (+1: the Effect list).
-- Byte-identical without fx: main 6fda0f58 vs the branch on the synthetic fixture — final `857cfa3d…`, segments
- `8c2c83e6…`, `59b091c9…`, `1fab1f60…`, `ba32f163…`, schedule `ac9618b3…`, the same both sides.
-- The fx fixture (all eight first effects on) built end to end: 23.3 s, `fx-frames` 699 frames rendered in 42.5 s.
-
-## Demo
-
-`~/reports/hyperframes-fx-demo/` (not committed): six clips whose windows were already on disk — four slow-news clips
-(2019, 2021, 2024 with a dash-marked second voice, 2026; whole extents, a person-marked punch-in second each) and two
-polemic-deleted clips with the X screenshots they cite (receipts, zoom). Eleven quick takes in group `effects`, made by
-`umtool take … --effect <name> --quick` in one heavy-slot admission (≈ 1 min each): fx-reaction, fx-kinetic,
-fx-punch-in, fx-whip, fx-odometer, fx-glitch, fx-then-now, fx-redact, fx-scrubber (26.83 s, `--at 0 --dur 26`),
-fx-receipts, fx-zoom (28.07 s, `--at 27 --dur 20`). fx-receipts was made again after its marker was moved onto the
-cited line, so the other ten say "the project changed since this take was made" (only `fx.receipts[0].mark` changed).
diff --git a/plans/release-35/montage-ops.md b/plans/release-35/montage-ops.md
@@ -1,60 +0,0 @@
-# Release 35 lane O1 — montage operations in the app (`r35/montage-ops`), as shipped
-
-The steps the orchestrator did by hand for the slow-news montage — a scan, no cap, a fetch-windows body built in
-python, a second fetch for refused Rumble windows from the same stream's other upload — as app operations, each with a
-CLI and a UI button, deterministic, no model.
-
-## What
-
-1. **Alternates** (common/lib/montage/phraseScan.mjs): every instance records `alternates: [{slug, videoId, start, end,
- platform, availability}]` — the other-channel hits folded into it (a covered twin hit, attached to the twin hit that
- scores best; the `via` source; every `alsoIn` fold). Everything else is release 34's answer
- (`fixtures/phraseScan.r34.json`, equivalence-tested for both scanners).
-2. **The cap**: `capInstances` + the phrase seed's `max` (`umtool new … --seed phrase --max N`, the New project form's
- **Max**, the phrase finder's **Max clips**). `phrase-scan.json` gains `max` and `skippedByCap`; README and notes name
- it. No `max`: manifest + README byte-identical to release 34.
-3. **Fetch windows**: `umtool fetch <project> [--body | --dry-run | --wait | --status] [--reason R]`, the
- `/api/report/fetch-windows` route and `FetchWindowsPanel` (Cut tab, clip deck). Runs in `<project>/fetch-runs.json`.
-4. **Stand-ins**: `umtool fallback <project> [--dry-run | --clip <id> … | --restore <clipId>]`, `/api/report/stand-ins`,
- `MontageFetchTools` on the clip deck (Use stand-in / Use all / Restore). `fallbackFrom` on the clip; ruling and
- voice-match row moved with it (`moveMontageRuling`, the rulings' writer).
-
-Shapes: plans/FACTS.md, "Release 35 lane O1".
-
-## Commits
-
-| sha | |
-|---|---|
-| 07caf3eb | common: the phrase scan records each instance's alternates (slice 1) |
-| f5914aeb | umtool: the phrase seed's cap `--max N` (slice 2) |
-| 7992d406 | umtool: Fetch windows — `umtool fetch` and the button (slice 3) |
-| be45001b | common: a covered twin hit's alternate goes to the best-scoring twin hit (slice 1 follow-up) |
-| aa9b8ad9 | umtool: stand-ins — `umtool fallback`, Use stand-in / Restore (slice 4) |
-| (this) | plans + docs: record, FACTS, CHANGELOG, cli.md, report-video.md |
-
-Slices 1–3 (07caf3eb..7992d406) were merged to main by the orchestrator as 9d0ab192.
-
-## Gates (all through r31-locked.sh)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean at 7992d406 and at aa9b8ad9.
-- common: 4627 tests, 4625 pass, 0 fail, 2 skip (both points; the new tests are in phraseScan.test.ts +3 and
- phraseScanMany.test.ts +2 — net count equal because the count was first taken after they were written).
-- test:scripts: 1175 / 1171 pass / 4 skip at 7992d406 (+4 scaffold-phrase/fetchWindows tests); 1180 / 1176 pass /
- 4 skip at aa9b8ad9 (+5 standIns tests). 0 fail.
-- e2e `umtool/e2e/montage-ops.spec.ts`: **written, NOT run** — three attempts (10 min each, inside r31-locked6.sh) never
- got the machine-wide heavy slot (held by other agents' e2e and builds; MemAvailable under the floor). Owed: one run.
-- Checked on real data (read-only): `umtool fetch quartering-oopsie --body --reason "oopsie montage"` == the hand-built
- `~/reports/quartering-oopsie/windows.json` (68 items; python dict equality); with no `--reason` all but the reason
- ("Oopsie doopsie montage"). A release-34 scaffold (the primary checkout's module) vs this branch on a synthetic
- corpus: video.manifest.json and README.md byte-identical; phrase-scan.json differs only by `alternates`.
-- Stand-ins on a COPY of quartering-oopsie with a synthesized fetch-runs.json from its refusals (s23, s24, s27, s29,
- s30, all the-quartering-rumble, 403): the re-scan (the scan predates alternates) finds each instance and **no
- alternate for any** — no other channel's transcript says those moments, so `umtool fallback` reports "refused with
- none" for all five. Correct, but it means oopsie's refused clips need another source.
-
-## Rulings followed
-
-- No model anywhere; every step has a UI button and a CLI.
-- The editor fetches; umtool asks (WORKER_TOKEN, else editor/.env, never sent to the browser).
-- The manifest is written only through `replaceManifest` (lock, auto snapshot, atomic); rulings through their writer.
-- Fixtures synthetic; nothing under `~/reports` written (copies under the job's scratch).
diff --git a/plans/release-36.md b/plans/release-36.md
@@ -1,50 +0,0 @@
-# Release 36 — the clip finder, round two (record)
-
-Plan of record: [`release-36/clip-finder-2.md`](release-36/clip-finder-2.md). Lane records: `release-36/clip-analysis-2.md`
-(B), `find-clips.md` (A), `clip-look.md` (C), `clips-suggest.md` (D), `clip-edges.md` (E: room + the blur slide).
-
-## What shipped (main b864b338 + the ship)
-
-- **B — analysis** (merged 8938a5dd): auto-scope `segments` (narrated-video spans; on the Nik Drop s1 = 292.7–6318.1,
- s2 = 6501.9–9276.0, every edge within 18 s of the hand estimate), the chat signal (`chat` in reactions.json, `kind:
- "chat"` moments; absent chat = release 35's output exactly), site-less `citeUrl`s, the clips route's worker token +
- `mode:"new"`, `--keep-cut` (re-analyze without moving, adding or removing a clip).
-- **C — the look** (3f90457a): the Build tab's Look panel + `updateRender`, `render.loudness` (per-clip gain), speaker
- captions (`render.captions`, ASS), vertical shorts (`<project>/shorts/`), `umtool build --run`.
-- **A — Find clips** (8a1a1dae): the video page's Find clips panel + `pnpm ops find-clips` (persist → transcript → word
- timings → chat → diarization → umtool, each skipped when done), `fetch-chat`, run-while-paused for one manual job.
-- **D — the optional AI pass** (1633b930): the `clips-suggest` generation task (labels, why, rank →
- `clip-suggestions.json`), labels + sort + Suggest in the clip editor, Ask the assistant on a note with Apply.
-- **E — room at the clip edges** (117fde3b): `render.room` — a clip's sound runs to the first silence, the picture runs
- on muted for the join (and a muted head), so a join never eats a sentence.
-- **The blur slide** (a012e9ff, then 7e16cab9 + 24d155e0 on the operator's "way quicker, more tactile, subtle"): one
- xfade custom expression — an eased push (travel 8 % of the width, cubic ease-out), a motion-scaled nine-tap smear,
- grain on the seam's frames; `render.slide {travel, blur, grain}`; the site-less seed joins at 0.22 s with room on.
-- **e2e fixes** (b864b338): the generation line's "clip labels", the scaffold's kind, a project's own clip window first
- (the last was older than release 36: a wider window another spec leaves behind won).
-
-## Gates
-
-- Full unit gate on 1633b930: tsc clean; common 4693 pass / 0 fail; editor 353; mcp 379; test:scripts 1290; umtool 45;
- docs env/files/cli + settings example clean. On 117fde3b: tsc clean, test:scripts 1310, umtool 45, docs files clean.
-- e2e on 117fde3b: editor 724 passed, 12 skipped, 0 failed (22.5 min); umtool 572 passed, 4 failed → fixed
- (clip-bench + clip-deck 52/52, create + settings 20/20, projects 25/25; test:scripts 1311).
-
-## The Nik Drop cut (rulings and look)
-
-- The operator made no edits to the release 35 cut beyond fixing an invalid manifest (the release 35 record is
- corrected). Cut now: r017 (release 35), r027 (Harmful flying to Australia, ~7:40) and r014 (the clip with "no mods and
- people are behaving", ~9:10) — Cut rulings through the clip editor.
-- Look: no header/footer/QR, loudness −16, room at both edges, the blur slide; no captions ("those ones you have aren't
- good"). A preview render (0.4 s full-width slide, captions) measured −16.2 LUFS (v2: −18.6).
-- The join is the operator's pick: four variants and a runbook for each full build in
- `~/reports/nik-drop-clips/variants/` (RUNBOOK.html, `apply-variant.mjs a-nudge|b-push|c-snap|d-swipe`). No full
- build was run after the push.
-
-## Not done / owed
-
-- The Look panel has no travel/smear/grain fields (script only); captions are off for this cut pending better ones.
-- Live: Find clips on the Nik Drop (dry run first), the second-half project (s2), Suggest on both — not run.
-- The GPU worker is still disabled inside the transcription pause snapshot (release 35): a `whilePaused` job uses a
- CPU worker unless the operator re-enables it on /workers.
-- Word timings still cut their WAV into the OS temp dir (the RAM tmpfs here), as `pnpm ops transcribe` always has.
diff --git a/plans/release-36/clip-analysis-2.md b/plans/release-36/clip-analysis-2.md
@@ -1,114 +0,0 @@
-# Release 36 lane B — `r36/clip-analysis-2`: auto-scope, the chat, site-less links (as shipped)
-
-The plan of record is [clip-finder-2.md](clip-finder-2.md); this lane is its analysis half, extending release 35
-C1's clip finder ([../release-35/clip-analysis.md](../release-35/clip-analysis.md)): where in a reaction stream each
-narrated video is, the stream's chat as a second ear, links and a look for a channel on no site, and the umtool
-route the editor's Find clips (lane A) calls. Lane D (the optional AI pass) builds on this branch.
-
-## What
-
-- **Auto-scope** — `common/lib/clips/segments.mjs` (pure, `.d.mts`): `findSegments({turns, duration, host?,
- operator?})` → `[{id: "s1", from, to, subject, host, why}]`. The host (the operator's, else assignRoles' over the
- whole recording) is left out of the counting; 300 s windows every 30 s; a window's subject is the non-host cluster
- with the most seconds in turns ≥ 8 s, counted at ≥ 60 s and ≥ 60 % of that time; a run of one subject is a span
- from its first long turn to its last; same-subject neighbours join, spans < 180 s drop; the host's talk after a
- video's last line folds in (≤ 300 s, never past the next video's first line, ending on a turn's end); nothing
- before a video's first line is folded. `pickSegment` (named, else the longest), `scopeOverlapsSegment`.
- reactions.json gains `segments` and `segment` on every pass; roles stay per segment (the existing role code over
- the scope's turns; the operator's roles win). `--scope auto` / `--segment sN` on `umtool new --seed reactions` and
- `clips analyze|propose` (resolved to numbers, kept in `params.scope`), `umtool clips segments <project>`, the job's
- `scope: "auto"`, and the Create form's **Video** picker (`[data-new-video]`: the longest, or the 1st/2nd/3rd found).
-- **The chat signal** — `common/lib/clips/chat.mjs`: `readChatCues` (reads `live_chat.cues.json` itself — lib may not
- import controller, and the module is plain ESM), `isChatLaugh` (lol, lmao, lmfao, KEKW, LUL, OMEGALUL, rofl,
- haha…, 😂, 🤣, the `:face-with-tears-of-joy:` emote, a lone W), `chatBins` (2 s: messages, laughing messages),
- `chatLag` (Pearson r over shifts 0–20 s against the CED score binned to 2 s, parabola-refined; no scan, no variance
- or r < 0.2 → 6 s), `chatMoments` (≥ 3 laughs and ≥ 2.5 × the ±60 s median, at least 1; runs → a moment at start −
- lag, scored ≤ 0.6). `analyze` takes `chat` and adds `kind: "chat"` moments (a laugh's span rules; why "chat laughs
- (N messages) …"); reactions.json `chat: {source, lagS, lag {how, r, why}, messages, bursts, bins {hop, rate[],
- laugh[]}} | null`; `clips analyze` logs `chat: … lag X s — …`. No chat file: release 35's analysis byte for byte.
-- **Site-less links** — `watchUrlAt(url, s)` (`common/lib/clips/assist.mjs`: YouTube `t=<s>s`, Twitch
- `t=<h>h<m>m<s>s`, Rumble `start=<s>`, else `t=<s>`) and `applyProposals(…, {citeUrlAt})`: with no siteOrigin and the
- channel on no PUBLIC site (a site.json with a `siteUrl` listing it), every clip the seed or a pass adds or moves
- carries `citeUrl` at its cite; a derived link follows its clip, one somebody wrote stays (`siteLessLinks`,
- `channelOnPublicSite` in `umtool/lib/report/reactions.mjs`). The seed fills `provenance.channel` from the metadata.
-- **The site-less look** — the seed writes `SITELESS_LOOK` (`umtool/lib/projects/scaffold.mjs`): `headerHeight 0,
- footerHeight 0, qr false, transition 0.5, transitionStyle "fadeblack", loudness {target: -16}` (else hard cuts, as
- before). Lint and the build refuse no unknown render key (checked: `lintManifest(…, {validators: true})` on a
- seeded manifest), so `loudness` waits harmlessly for lane C's validator and renderer. An empty siteOrigin with every
- clip linked (no card, no post) is no longer a "dead QR origin" flag or blocking decision (`report.mjs`
- `originUnused`).
-- **The route** — `umtool/app/api/report/clips/route.ts`: every POST through `routeCaller` (`agentAuth.mjs`: no header
- = the page, `Bearer <WORKER_TOKEN>` = the editor, else 401), every POST answers `jobId`; `mode: "new"`
- (`umtool/lib/report/clipsNew.mjs` `planClipsNew`): a reactions project for the same recording whose scope covers the
- chosen segment is analyzed again as it is, with `--keep-cut` (`created: false`: nothing in the cut moves, goes or
- is added; the new proposals are listed unused), else `slug` is scaffolded with the reactions seed and
- `wordsPath` copied in as `words.json` (`created: true`); then one `clips analyze` job → `{jobId, job, project,
- created, segments, segment, scope, href, notes}`. GET `?project=` adds `segments`, `segment`, `chat`.
-- **Test kit** — `testing/clips/reactionStream.mjs`: `twoVideoStream()`, `reactionChat(o)`, and
- `writeReactionCorpus`'s `two`, `chat`, `meta` options (synthetic only).
-
-## Interfaces (exported)
-
-`findSegments`, `pickSegment`, `scopeOverlapsSegment`, `SEGMENT_*` (segments.mjs); `readChatCues`, `isChatLaugh`,
-`chatMessage`, `chatBins`, `chatLag`, `chatMoments`, `CHAT_*` (chat.mjs); `watchUrlAt`, `applyProposals`'s and
-`clipFromProposal`'s `citeUrlAt` (assist.mjs); `findMoments`'s `chat`, `analyze`'s `chat` in and out (clips.mjs);
-umtool `recordingSegments`, `segmentOfScope`, `autoScope`, `resolveParams`, `projectSegments`, `channelOnPublicSite`,
-`siteLessLinks`, `chatLine` (reactions.mjs), `planClipsNew`, `parseNewBody`, `projectsCovering`, `ClipsNewError`
-(clipsNew.mjs), `routeCaller` (agentAuth.mjs), `SITELESS_LOOK` (scaffold.mjs), `originUnused` (report.mjs).
-
-## The live case's numbers
-
-`harmful-opinions/fGSRhEWc9M4` (audioSeconds 9367.9, read-only): s1 **292.68–6318.09** (subject 4, host 1; expected
-≈ 290–6300) and s2 **6501.93–9276.01** (subject 16; expected ≈ 6500–9278) — every edge within 18 s. A dry
-`clips propose` on a copy of the first case's project gives the same moments, laughs, speakers and proposals as
-`main` (the brought-in comment now counts toward the target first, so both drop r021 and add r031 — release 35's
-rule, not this lane's); its 18 kept clips' hand-written citeUrls equal the derived ones, so none is re-pointed.
-With `--keep-cut` (what the editor's Find clips runs on an existing project) the same dry pass is `clips +0 ~0 -0`:
-21 clips in the cut, 657 s, the other 91 proposals listed unused.
-
-## Rulings followed
-
-- The UI works without AI: every step here is arithmetic over turns, words, the sound's scores and the chat; nothing
- calls a model. Auto-scope has a form control; the chat needs nothing.
-- Release 35's proposal rules stand: an operator's, ruled or locked clip is never moved. A re-analysis from the
- editor keeps the project's own scope and its whole cut (`--keep-cut`): the plan's "operator edits stand; chat
- proposals show as unused".
-- No corpus content in fixtures; records state rulings.
-
-## Commits
-
-| sha | what |
-|---|---|
-| `1b636348` | clips: auto-scope — segments, `--scope auto` / `--segment`, `clips segments`; the test kit's two-video stream + chat |
-| `3a9a5c3c` | clips: the chat signal — chat moments, the lag; release 35's output pinned |
-| `76a205b1` | umtool: `/api/report/clips` — the worker token and `mode: "new"` |
-| `643ecaaf` | clips: site-less links and the site-less look; no dead-origin decision when every clip links itself |
-| `5164c59e` | umtool: the Create form's Video picker; docs, FACTS, CHANGELOG |
-| `c233df3d` | clips: `--keep-cut` — the editor's re-analysis of a project already cut leaves the cut as it is |
-| (this) | plans: this record |
-
-## Gates (all through the shared lock, from the worktree root)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean before every commit (six runs; the last at
- `c233df3d`'s tree).
-- common `pnpm --filter yt-dlp-transcript-common test` — **4663 tests, 4661 pass, 2 skipped**, 0 fail. Before this
- lane: 4651 (the first baseline run counted 4655, having picked up `segments.test.ts`'s 4 already on disk). New: 12
- (`segments.test.ts` 4, `chat.test.ts` 6, `links.test.ts` 2).
-- `pnpm run test:scripts` — **1263 tests, 1259 pass, 4 skipped**, 0 fail. Before: 1255 (the baseline's 1256 held one
- test of the new file). New: 8 in `umtool/lib/report/reactions-r36.test.mjs`; `reactions.test.mjs` unchanged and
- green.
-- umtool `pnpm --filter umtool test` — 45 / 45 (unchanged).
-- `pnpm archilyzer docs env --check`, `docs cli --check`, `docs files --check` — clean (no env, CLI row or schema
- touched).
-- e2e (umtool, `E2E_MODE=dev`, one run): `create.spec.ts` + `clip-editor.spec.ts` — **14 passed, 0 failed, 1.7 min**
- (three new create tests: the route's `mode: "new"` + 401 + `created: false`; the Video picker; the existing
- Highlights test unchanged and green). Run with `--keep-cut` in the tree before its commit (the same code).
-- No build: the slice's e2e ran under `next dev`.
-
-## Found and left
-
-- A plain `clips propose` on the first case's project (main's code and this branch alike) drops r021 and adds r031:
- the operator's brought-in comment counts toward the 600 s target first. `--keep-cut` (the editor's path) does not.
-- `render.loudness` is written but drawn by nobody until lane C's renderer; its validator is lane C's.
-- The clip editor does not show `segments` or the chat's lag yet (GET `?project=` carries them; lanes C/D own that
- page).
diff --git a/plans/release-36/clip-edges.md b/plans/release-36/clip-edges.md
@@ -1,95 +0,0 @@
-# Release 36 lane E — `r36/blur-slide`: room at the clip edges, and the blur slide (as shipped)
-
-The operator, watching the first highlights cut: the edges are tight — a join fades over the end of one clip's last
-sentence and the start of the next one's first. Ruled: the sound runs on to the first silence, and muted picture
-carries the join. This lane makes that a render key, `render.room`, and records the blur slide (the orchestrator's
-commit `a012e9ff`) that the site-less seed now starts with. Rulings followed: the UI works with no model (nothing here
-calls one); every step a umtool surface (the Look panel, the clip editor's toggle and strip); absent keys render byte
-for byte as before; deterministic code; synthetic fixtures only; the live project read only.
-
-## What
-
-1. **`render.room {tail?, head?, minGap? (0.35), maxS? (2.5)}`** and clip **`room: false | {tail?, head?}`**
- (`umtool/report-to-video/room.mjs`, pure; `validateRoom` inside `validateLook`, so the build, the lint and
- `updateRender` check it; refused beside a montage). An edge is on when its key is `true`; the clip's key beats the
- cut's.
-2. **The rule** (file seconds, on the snapped cut). TAIL: the sound runs to the end of the run of words that crosses
- the cut's end or starts within `minGap` after it, stopping at the first gap ≥ `minGap`, never more than `maxS`
- past it, a 60 ms fade there; the picture runs on muted for D + 0.1 s. HEAD (not the cut's first entry): when speech
- starts within D of the cut's start the picture starts D earlier, muted, the sound fading in over the 60 ms before
- the cut. Words: the project's words.json (the recording reactions.json describes) → corpus transcript.json → cues
- (`lookWordsFor`, lane C's resolver); none, or a run of cues that reaches the cap → `silencedetect` −35 dB / 0.3 s on
- the clip's source (in a silence → the cut's end; else the next silence within maxS; none → the cut's end, noted).
-3. **In the build** (`segmentRoom`, `detectRoomSilences`, buildClipSegment): only with a join (D > 0, not a montage,
- not a short); the segment is cut over the picture's span, clamped to the source file (a fetched window clamps, a
- note says so; the lint's `roomWindowWarnings` warns when a clip's room can reach past `extent + fetchPad`); the
- fades follow any loudness gain; loudness measures `[cut start, silence point]`; captions read only the words heard
- and end at the silence point; the cut record's `start/end` are the picture's (muteFrom still maps) plus
- `room {sound, head, tail, via, capped?, clamped?}`. Joins, chapters and offsets come from probed segment lengths
- as before.
-4. **umtool**: `LOOK_KEYS` + `room` (the Look panel's Room at the clips' edges: Tail, Head); `updateClip` takes
- `room` (validated; null deletes); the clip editor's op `room {clip, room}` and view `clips[].room`,
- `clips[].roomEdges`, `room {tail, head, minGap, maxS, join}`; the strip shades the muted head/tail
- (`roomShade`, the rule on the unsnapped cut), a per-clip **Room at its edges** checkbox and a line saying where the
- sound stops. Additive to lane D's clip-editor work: one new op, two view fields, one prop on Strip, one row.
-5. **The seed**: `SITELESS_LOOK` = 0.4 s `blurslide` joins + `room {tail, head}` (was 0.5 s `fadeblack`).
-6. **The blur slide, recorded** (`transition.mjs`, commit `a012e9ff`): `transitionStyle: "blurslide"` → xfade
- `slideright`, and on each side of a plain join the segment's last/first D s get `gblur sigma 10 / sigmaV 0.6` over
- D, `gblur sigma 16 / sigmaV 0.6` more over the D/2 nearest the seam (≈ 19 at the seam), `noise alls 7, allf t+u`
- over D — `BLUR_SLIDE = {sigma: 10, seamSigma: 16, sigmaV: 0.6, noise: 7}`, in the clip's own time (batched joins
- too); dips, wipes and whips keep their own look.
-
-## Files
-
-report-to-video: `room.mjs` (new), `room.test.mjs` (new, 12), `room-render.test.mjs` (new, 4), `build-video.mjs`
-(imports, `segmentRoom`, `detectRoomSilences`, buildClipSegment's span/sound/captions, `segmentCaptions({audible})`,
-`dirs.room`), `look.mjs` (validateLook calls validateRoom), `lint.mjs` (roomWindowWarnings), `package.json`
-(`./room`). umtool: `lib/projects/scaffold.mjs` (SITELESS_LOOK), `lib/report/manifest.mjs` (LOOK_KEYS, updateClip
-`room`), `lib/report/clipEditor.mjs` (view + op), `lib/report/clipEditorTypes.ts`, `lib/report/room.test.mjs` (new, 4),
-`lib/report/look.test.mjs` + `lib/report/reactions-r36.test.mjs` (the new key and seed), `components/projects/review/
-ClipEditor.tsx`, `components/projects/report/LookPanel.tsx`, `e2e/clip-look.spec.ts` (room in the panel and the
-editor), `e2e/create.spec.ts` (the seed's look), `docs/report-video.md` ("Room at the clips' edges, and the blur
-slide"). `plans/FACTS.md` ("Release 36 lane E"), `editor/CHANGELOG.md`.
-
-## Commits
-
-| sha | what |
-|---|---|
-| `8d503692` | report-to-video: render.room — room.mjs, the build, the lint; 16 tests |
-| `21473c70` | umtool: the Look panel's room, a clip's override, the strip's shading, the seed; 4 tests; e2e specs |
-| `182dc04b` | docs, FACTS, CHANGELOG |
-| `7d801566` | umtool: the clip room toggle shows the choice at once |
-| (this) | plans: this record |
-
-## Gates (through the session lock, from the worktree root)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean except one umtool JSDoc typing (fixed;
- umtool's tsc then clean, and again after the last code commit).
-- `pnpm run test:scripts` — **1310 tests, 1306 pass, 0 fail, 4 skipped** (branch start a012e9ff: 1289 / 1285 / 4;
- +20 here — room 12, room-render 4, lib/report/room 4 — and +1 from main's lane A merge).
-- `pnpm --filter umtool test` — 45 / 45 (unchanged).
-- Render tests (real ffmpeg): the first clip's words run past its end to 4.75 → segment [1, 5.25] (4.25 s, ±1 frame),
- heard (RMS > 1500) to the silence point, silent (< 30) after it; the second clip's muted head 0.4 s (silent before,
- heard after its cut); the cut = sum − one join (±2 frames), the join silent, the second clip's sound on its picture;
- loudness of the audible part −16 ± 0.6; the last caption ends by 3.75 s; no words → silencedetect found the 4.6 s
- silence (±0.05) and the picture ran 0.5 s past it; a clip's `room: false` kept its cut.
-- **Byte-identical without the key**: in-suite (absent, `null`, `{tail: false, head: false}`: final, both segments,
- both cut records); and against main's build-video (`$T/r36e-bytecheck.mjs`, a two-clip blurslide 320×180 fixture with
- loudness): final `06b3d852…`, segments `8e09b095…` / `5a9556ce…`, cut records `3bd732e2…` / `7150b74f…` — the same
- both sides.
-- e2e (umtool, `E2E_MODE=dev`): `clip-look.spec.ts` + `clip-editor.spec.ts` — first run 1 passed, 1 failed (the
- controlled checkbox; fixed in `7d801566`), then **2 passed, 0 failed** (wall 51.8 s); `create.spec.ts` (the seed's
- look) **13 passed** (wall 85.2 s).
-- A trial on a copy of the first case's inputs (`--only r018`, room on, the saved full video, no network): words.json,
- the sound ran 496.0 → 498.08 (the next word 0.4 s later), head 0.4 s, tail 0.5 s, segment 50.0 s, −16.1 LUFS.
- The copy's output was deleted.
-
-## Found and left
-
-- The room extends the sound past the cut a person set (up to `maxS`): words they trimmed off can come back, ending
- at the next pause. A clip's `room: false` (or `{tail: false}`) keeps the cut as set.
-- The strip's shading is the rule on the cut as drawn; the build snaps the cut to a silence first, so the rendered
- edge can differ by up to `snapWindow`.
-- No room in a short (no join), a montage (refused) or with `transition: 0` (the lint says it does nothing).
-- Detection with no words uses an absolute −35 dB floor; on loud game audio it can find no silence, and the sound
- then stops at the cut (noted in the build log).
diff --git a/plans/release-36/clip-finder-2.md b/plans/release-36/clip-finder-2.md
@@ -1,110 +0,0 @@
-# Release 36 — the clip finder, round two: one button, a clean look, captions, shorts, chat, an optional AI pass (plan of record)
-
-## Context
-
-Release 35 (main `ff6d0fbb`) made Archilyzer an assisted clipping tool. The first case, "The Nik Drop" (a reaction
-livestream, 9278 s), was cut by the clip finder and adjusted in the clip editor (one clip cut, a
-comment brought in, no on-screen UI, fade-through-black joins). Running it live exposed the hand work that is still
-not a button:
-- the chain (persist video → word timings → transcript → speakers → `umtool new --seed reactions` → `clips analyze`)
- was run step by step from a shell; transcription had to be forced through a PAUSED worker pool by hand;
-- the scope (where one narrated video ends and the next begins) was found by reading speaker clusters by hand;
-- the render look (no header/QR, transitions) was a jq edit of the manifest; QR links for a site-less channel by hand;
-- no captions, uneven loudness (−19 LUFS), no shareable shorts, the stream's chat ignored.
-
-Operator, 2026-10-19: focus on the clip finder, round two, with **speaker captions, vertical shorts, an AI "why it's
-funny" pass, and live chat as a signal**; next real case: **the rest of the Nik Drop stream** (the second narrated
-video, ≈6500–9278 s) as the fresh test — the first example is a **re-cut of the first half** through the new features.
-Standing rules: the UI works without AI (every model step optional, every step a button); no yt-dlp/ASR by hand
-(editor + `pnpm ops`); umtool evolves with the video; comments are notes; Docker first-class.
-
-## Shared shapes (all lanes code against these; additive, optional keys)
-
-`reactions.json` (release 35 C1's file, `common/lib/clips/reactions.mjs`):
-- `segments: [{id:"s1", from, to, subject, host, why}]` — the narrated-video spans found in the recording (auto-scope).
-- `chat: {source:"live_chat.cues.json", lagS, bins:{hop, rate[], laugh[]}} | null`; moments gain `kind:"chat"`.
-
-Manifest `render` (report-video; validated in lint + build like `validateTransitionStyle`, report-to-video/transition.mjs):
-- `captions: {style:"speakers", labels?:{host,subject}, size?:"m"|"l"} | absent` — burned-in, speaker-coloured.
-- `loudness: {target:-16} | absent` — per-clip gain toward the target (montage's helpers).
-- existing: `headerHeight`, `footerHeight`, `qr`, `transition`, `transitionStyle`.
-
-Clip entry: `vertical: {crop:[x,y,w,h]}` (fractions of the source picture) — the 9:16 short's framing.
-
-`<project>/clip-suggestions.json`: `{model, at, items:{<proposalId>:{label, why, rank}}}` — the AI pass's output only.
-
-umtool route contract used by the editor: `POST /api/report/clips {mode:"new", slug, from:"<ch>/<id>", target?,
-scope?|"auto", wordsPath?}` and `{mode:"analyze"|"propose", project}` with `Authorization: Bearer WORKER_TOKEN` →
-`{jobId}`; `GET ?job=<id>` for progress (`umtool/app/api/report/clips/route.ts`, extended).
-
-## Lanes (parallel implementers in worktrees; D after B merges)
-
-### A — editor: "Find clips" on a video page (`r36/find-clips`)
-1. **Run while paused** for one manual job: `transcribe-file` / `transcribe-one` body `whilePaused: true` (and a
- "Transcribe now (workers paused)" button). In `common/jobs/workerPool.ts` the acquire carries the flag; `eligible()`
- may lease a worker that is disabled ONLY by the pause (its `pausedSnapshot` state is `enabled`), never one drained,
- degraded or turned off by hand; the snapshot is not touched.
-2. **Chat replay for one video**: ensure `transcript.live_chat.json` + `live_chat.cues.json` exist (the chat-only fetch
- path in `common/ytdlp/downloadOneManaged.ts`, `common/controller/normalizeLiveChat.ts`) — an ops action if one does
- not exist (`fetch-chat {slug,id}`), paced like any YouTube request; YouTube only.
-3. **`find-clips` job**: persist video (if none saved) → corpus transcript (if none) → word timings → chat (if YouTube)
- → diarization → umtool `POST /api/report/clips {mode:"new", …, scope:"auto"}`. Each step skipped when its output
- exists; the job log names each. `pnpm ops find-clips {slug,id,target?,whilePaused?}` + a **Find clips** button in
- the video page's operations, linking the umtool project when done.
-4. Tests: workerPool unit tests, the chain with stubs, editor e2e for the button; COMMANDS.md regenerated.
-
-### B — analysis: auto-scope, chat, site-less links (`r36/clip-analysis-2`)
-1. **Auto-scope**: narrated-video spans where one long-turn cluster dominates (sliding 5-min windows; host-only gaps
- folded into the neighbouring span) → `segments`; `--scope auto`; `clips segments <project>`; roles per segment.
-2. **Chat signal**: 2 s bins of message rate + laugh tokens; chat lag by cross-correlating chat-laugh with the CED
- laugh score (0–20 s; default 6 s); a burst ≥ 2.5× the local median → a `chat` moment at (t − lag), weighted below
- a host laugh. Absent chat = today's behaviour exactly.
-3. **Site-less links**: `citeUrl` = the platform watch URL `&t=<s>` when the channel is on no site; `provenance.channel`
- from metadata.
-4. **Default look for a site-less, one-video cut**: `headerHeight:0, footerHeight:0, qr:false, transition:0.5,
- transitionStyle:"fadeblack", loudness:{target:-16}`.
-5. umtool route `/api/report/clips` accepts the worker token and `mode:"new"`.
-6. Tests on synthetic two-video streams + synthetic chat; docs; FACTS.
-
-### C — render + UI: the Look panel, loudness, speaker captions, vertical shorts (`r36/clip-look`)
-1. **Look panel** (umtool): header, QR, transition length + style, loudness, captions + labels; writer
- `updateRender(dir, patch, {token})` (model `updateChrome`), route `/api/report/render`. Never touches `render.chrome`.
-2. **Loudness**: `render.loudness.target` → measure each cut window → `levelFilters(loudnessGain(...))` at the clip
- encode. Absent = byte-identical.
-3. **Speaker captions**: an ASS file per segment from `words.json` (else transcript words) + `reactions.json` turns
- (host one colour/side, subject another; labels from `speakers[].label`), 2–6 words per line, burned with `ass=`.
-4. **Vertical shorts**: **Make a short** → `<project>/shorts/<clipId>.mp4` 1080×1920 from `vertical.crop` (9:16 box
- dragged on the player; default centre), large captions, no header/QR, loudness; through the heavy slot. A
- **Shorts** list on the Deliver tab.
-5. `umtool build <project> --run` calls the build route over HTTP.
-6. Tests: ASS timing, caption colours by pixel, loudness ±0.5 LU, 1080×1920 short; byte-identical without new keys; e2e.
-
-### D — the optional AI pass (`r36/clips-suggest`, after B)
-1. **`clips-suggest` generation task** (pattern: `verdicts`): per proposal, its words labelled by speaker →
- `{label, why, rank}` → `clip-suggestions.json`. Never edits a clip. Routed by `settings.generation`.
-2. **Clip editor**: labels, "Sort by the assistant's rank", **Suggest**; everything works with no suggestions.
-3. **Ask the assistant** on a clip's note thread → an `author:"agent"` reply with an optional concrete proposal shown as
- an **Apply** button (the operator's click performs it; never applied silently).
-4. Tests with a fake model; docs.
-
-## The live cases (after A + B + C merge; D's pass when it lands)
-
-1. **Re-cut of the first half** (existing project, scope s1): Find clips → steps skip what exists, chat fetched,
- segments found; s1 re-analyzed in the EXISTING project (the current cut kept; chat proposals show as unused).
- Look: speaker captions on, loudness −16, no-UI + fadeblack kept. Render (old output kept as `.v2.mp4`) + a short.
-2. **Fresh test, the second half**: Find clips → a new project scoped to s2 by auto-scope, the site-less look; review;
- render + a short.
-
-## Order and gates
-
-Merge `--no-ff` B → A → C → D; full gate (tsc, common, test:scripts, umtool, docs checks) + umtool e2e whole suite +
-editor e2e → umtool ship + an editor restart. Record `plans/release-36.md`.
-
-## Verification
-
-- workerPool: paused pool + `whilePaused` leases only a pause-disabled worker; the snapshot unchanged; auto jobs held.
-- Auto-scope on the Nik Drop finds two segments within ±60 s of 6300 / 6500; chat lag estimated and logged.
-- Render: a manifest without the new keys renders byte-identically; captions follow the turns; integrated loudness
- within ±1 LU of −16; the short is 1080×1920, crop as set.
-- Live: the re-cut keeps every operator edit and gains captions + −16 LUFS; the second half rendered from the button
- path with no shell steps between Find clips and Render.
diff --git a/plans/release-36/clip-look.md b/plans/release-36/clip-look.md
@@ -1,100 +0,0 @@
-# Release 36 lane C — `r36/clip-look`: the Look panel, loudness, speaker captions, vertical shorts (as shipped)
-
-The plan of record is [clip-finder-2.md](clip-finder-2.md), lane C. The first case's render look (no header or QR,
-fadeblack joins) was a jq edit of the manifest; it had no captions, uneven loudness (−19 LUFS) and no shareable
-shorts, and `umtool build` only printed its chain. This lane makes each of those a render key a person sets in the UI,
-renders them, and adds the short and `build --run`. Rulings followed: the UI works with no model (nothing here calls
-one); every review step a umtool surface; absent keys render byte for byte as before; redesign primitives and role
-tokens; synthetic fixtures only; the live projects read only.
-
-## What
-
-1. **The keys and their validators** (`umtool/report-to-video/look.mjs`, pure; `validateLook` in build-video's
- validators and lint's `validatorErrors`, as `validateTransitionStyle` is):
- - `render.captions {style: "speakers", labels?: {host?, subject?}, size?: "m" | "l"}` — refused beside
- `render.chrome` (the deck's own words) or `render.montage`.
- - `render.loudness {target}` −30…−8 LUFS — refused beside `render.montage` (which has its own). Lane B's seed shape
- `{target: -16}` validates.
- - clip `vertical {crop: [x, y, w, h], aspect?}` — fractions of the source, inside it, 9:16 on the source within 3 %.
-2. **Loudness** at the clip encode, deck or not, montage excepted: the cut measured (`measureLoudness`, now exported),
- `levelFilters(loudnessGain(measured, target))` on `[0:a]` (an `asplit` first when a poster's waveform reads it);
- the cut record carries `loudness {measured, gain, target}`.
-3. **Speaker captions** (no deck): per segment an ASS file (`segments/<id>.captions.ass`) from the project's
- `words.json` (the recording reactions.json names), else whisper's words, else the cues; reactions.json's turns
- colour and place each line; 2–6 words a line, broken on 0.45 s pauses, never across a speaker change; burned with
- `ass=` (libass; ffmpeg n9.0.2 here has it). The colours (fixed, not the palette's): **host `#FFC840` amber bottom
- left, subject `#6FD3FF` sky bottom right, other `#F6F1E6` paper bottom centre**, black outline, IBM Plex Sans from
- `report-to-video/fonts/`. Names only when somebody gives one (`labels[role]`, else a non-default speaker label).
- `setSpeakerLabel(dir, index, label)` added to common/lib/clips/reactions.mjs directly after setSpeakerRole (lane B's
- file, the one export the prelude allowed); the clip editor's Speakers list edits it.
-4. **The Look panel** — the Build tab: Header, Timeline footer, QR code, Between clips (s) + Join (crossfade, dip to
- black, dip to white, dissolve), Loudness (as recorded / −16 / custom), Speaker captions + each role's name + size;
- Save the look writes the diff through `updateRender(dir, patch, {token})` (lib/report/manifest.mjs, modelled on
- updateChrome: token-guarded, the build's checks, atomic; never `render.chrome`) behind `GET/PUT /api/report/render`.
-5. **Vertical shorts** — the clip editor's side column: Frame the short (a 9:16 box over the player: drag, size slider,
- written to the clip's `vertical` through updateClip when let go; Centre it), Make a short → a job on umtool's runner
- (`/api/report/shorts`, `lib/report/shorts.mjs`): `build-video.mjs --short <id>` — the clip alone at 1080×1920 from
- its crop, captions size "l", no header/footer/QR, the cut's loudness else −16 — in the heavy slot, its work in
- `out/shorts-work/`, the file `<project>/shorts/<id>.mp4` + `<id>.json`; a short that is there is set aside
- (`<id>.<stamp>.mp4`), never overwritten. The Deliver tab's **Shorts** list: play, download, make again, frame it;
- "the clip moved since" when the cut or crop changed.
-6. **`umtool build <project> --run`** (`lib/report/buildRun.mjs`): the build route's job over HTTP (`--url` >
- `UMTOOL_URL` > `http://localhost:3050`), its log followed, Ctrl-C cancels; `--replace`. Without `--run` unchanged.
-
-## Files
-
-report-to-video: `look.mjs` (new), `look.test.mjs` (new, 15), `build-video.mjs` (imports, validator, loudness and
-captions in `buildClipSegment`, the short's framing, `probeDims` / `readLookSources` / `lookWordsFor` /
-`segmentCaptions` / `placeShort`, `--short`, `takesHeavySlot`), `lint.mjs`, `package.json` (`./look`,
-`./transition`), `README.md`. umtool: `lib/report/manifest.mjs` (`updateRender`, `lookOf`, `LOOK_KEYS`,
-`RenderRefused`, updateClip's `vertical`), `lib/report/clipEditor.mjs` (ops `label`, `vertical`; view `vertical`,
-`shorts`), `lib/report/clipEditorBridge.mjs`, `lib/report/clipEditorTypes.ts`, `lib/report/shorts.mjs` (new),
-`lib/report/buildRun.mjs` (new), `lib/report/look.test.mjs` (new, 5), `lib/report/buildRun.test.mjs` (new, 3),
-`app/api/report/render/route.ts` (new), `app/api/report/shorts/route.ts` (new),
-`components/projects/report/LookPanel.tsx` (new), `components/projects/report/ShortsList.tsx` (new), `BuildTab.tsx`,
-`DeliverTab.tsx`, `components/projects/review/ClipEditor.tsx` (CropBox, SpeakerLabel, ShortMaker), `bin/umtool.mjs`,
-`e2e/clip-look.spec.ts` (new), `e2e/fixtures/clip-editor-fixture.mjs` (a `name`), `e2e/fixtures/make-fixture.mjs`,
-`docs/report-video.md` ("The look: captions, loudness, shorts"), `docs/cli.md`. common: `lib/clips/reactions.mjs` +
-`.d.mts` (`setSpeakerLabel`). `editor/CHANGELOG.md`, `plans/FACTS.md` ("Release 36 lane C").
-
-## Commits
-
-| sha | what |
-|---|---|
-| `c8355cf2` | report-to-video: look.mjs, loudness + captions at the clip encode, `--short`; 15 tests |
-| `83304773` | umtool: updateRender + /api/report/render, a clip's vertical, setSpeakerLabel, shorts job + route; 5 tests |
-| `fe6b9968` | umtool: the Look panel, Frame the short + Make a short, the Shorts list |
-| `ebdf6ab7` | umtool: `umtool build --run`; 3 tests |
-| `5004235c` | umtool e2e: clip-look.spec.ts; the clip editor's fixture takes a name |
-| `6d796dfd` | docs, FACTS, CHANGELOG |
-| (this) | plans: this record |
-
-## Gates (all through the session lock, from the worktree root)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean on the full tree before the commits.
-- `pnpm run test:scripts` — **1278 tests, 1274 pass, 0 fail, 4 skipped** (branch start, main 0d471989: 1255 / 1251 / 4;
- +23: `report-to-video/look.test.mjs` 15, `lib/report/look.test.mjs` 5, `lib/report/buildRun.test.mjs` 3).
-- `pnpm --filter umtool test` — 45 / 45 (unchanged). common `lib/clips/*.test.ts` — 24 / 24 (setSpeakerLabel is
- tested through the clip editor's `label` op in `lib/report/look.test.mjs`; lane B's test file untouched).
-- The render tests (real ffmpeg, in look.test.mjs): a caption line up on its frame (0.25 s → frame 8 of a 30 fps
- segment, nothing on frame 6), the subject's pixels sky (mean B > R + 60) on the right only, the host's amber
- (R > B + 80) on the left only; loudness: a −27 LUFS tone to −16 within ±0.5 LU (segment and cut); the short
- 1080×1920, its crop's bar at x 428–642 as computed, no header, −16 within ±0.5 LU, captions at 81 px.
-- **Byte-identical without the new keys**: in-suite (absent vs `null`: final, segment, cut record); and against
- main's build-video (`$T/r36c-scripts/bytecheck.mjs`, a two-clip fadeblack 640×360 fixture, the primary checkout's
- build-video vs the branch's): final `49033bc6…`, segments `875fe480…` / `73cd16d7…`, cut records `ef0ece96…` /
- `6cd4f047…` — the same both sides.
-- e2e (umtool, `E2E_MODE=dev`, no build): `clip-look.spec.ts` **1 passed** (35.8 s; wall 45 s after 3.8 min in the
- machine's heavy queue); on the tip `6d796dfd` with `clip-editor.spec.ts`: **2 passed, 0 failed** (clip-editor 24.5 s,
- clip-look 9.4 s; wall 43.7 s after 13 min in the heavy queue).
-- No `next build` (dev-mode e2e); no generated doc changed (umtool's CLI and env are out of COMMANDS.md /
- ENVIRONMENT.md's scope).
-
-## Found and left
-
-- A cut quieter than −40 LUFS is not raised (montage.mjs's `SILENT_LUFS` rule, kept): a near-silent clip is a cut in
- the wrong place, not a quiet one.
-- setSpeakerRole resets a speaker's label to the default, so a name set before a role change is lost (the analysis'
- writer, lane B's; not changed here).
-- Words heard in no turn (or by one of the stream's small clusters) are captioned as "other", paper centre.
-- Captions are not offered under the deck (its `fx.kineticQuote` is the deck's own) or on a montage.
diff --git a/plans/release-36/clips-suggest.md b/plans/release-36/clips-suggest.md
@@ -1,99 +0,0 @@
-# Release 36 lane D — `r36/clips-suggest`: the assistant's labels, Ask the assistant (as shipped)
-
-The plan of record is [clip-finder-2.md](clip-finder-2.md), lane D: the clip finder's OPTIONAL AI pass. Lane B's
-analysis ([clip-analysis-2.md](clip-analysis-2.md)) and lanes A and C were merged into this branch before its gates.
-Rulings followed: the UI works with no model (with no labels file, generation off or no model the clip editor is as it
-was; every edit a proposal names is a button the operator already had); the only model calls are through
-`settings.generation`'s routing (a `report-draft` job in the editor); nothing a model returns edits a clip — the
-operator's **Apply** does; comments are notes; synthetic fixtures only; the live projects read only.
-
-## What
-
-1. **The `clips-suggest` generation task** — `GENERATION_TASKS` + every preset (code code, balanced local, api api,
- local local; an older settings file keeps its preset), dispatched in `common/controller/reportDraft.ts` beside
- verdicts into its own controller `common/controller/clipsSuggest.ts`. A body names `project` (the reactions
- project's absolute directory; never inside the corpus) instead of `article`. Per proposal the prompt carries its
- words, each line HOST / SUBJECT / OTHER by the turns, and what the finder heard (laugh / chat / comment); the model
- answers `{items: [{id, label, why, score 1–10}]}` and CODE ranks (so batches rank globally): 30 proposals a call on
- the API, at most 20 and within the 8k prompt cap locally. A malformed answer is refused whole; a label over six
- words, a score outside 1–10 or an id never asked is refused per item, never trimmed to fit. Output
- `<project>/clip-suggestions.json` `{model, at, proposedAt, promptVersion, items: {<id>: {label, why, rank, score,
- start, end}}}` through its one writer (`common/lib/clips/suggest.mjs`), merged over the old file's still-current
- labels. Cap: the narration cap (`capOf`) and the daily cap; usage rows `task "clips-suggest"`. Lanes: `draft:local`
- through the GPU arbiter (ollama unloaded) or `draft:api`. The `code` route: the ops route's `dryRun: true` answers
- the plan (proposals, calls, the estimate, the request); the MCP's `generate` hands that request to the session
- and takes its `answers` back, read and written exactly as a model's (`model: "claude-code"`). SETTINGS.md and
- settings.json.example regenerated; `/gen` names the task.
-2. **The clip editor** — `umtool/components/projects/review/ClipSuggest.tsx` (+ small additive hooks in
- `ClipEditor.tsx`): a label on each clip and unused proposal (the why on hover, and under the selected clip with its
- rank), **Sort by the assistant's rank** for both lists, **Suggest** (one editor job via
- `/api/report/clip-suggest`, which asks the editor with the WORKER_TOKEN through `askEditor` — the TS client
- `lib/articles/generation.ts`, not chain-run's private `editorCall`) with its progress (remembered in
- `<project>/.clip-suggest-job.json` across a reload), Stop; a stale file (a later proposal pass) or item (its
- proposal moved or went) is marked stale, never hidden. Routed to Claude Code, Suggest is disabled with the `/gen`
- line.
-3. **Ask the assistant** on a comment: the editor job reads the note (and its thread), the clip's words with times and
- speakers ±20 s, and the clips either side; replies through umtool's `POST /api/notes` as the agent
- (`UMTOOL_URL` — lane A's `umtoolUrl` — and WORKER_TOKEN; refused at the ask without them), with at most one
- proposal in the reply's new `proposal` field (`{kind: "trim", clip, from, to} | {kind: "merge", clip, with} |
- {kind: "cut", clip}`, `basis` the cut it read). notes.json takes a proposal only from an agent
- (`validateReplyProposal`). The thread shows it with **Apply**, which runs the clip editor's own trim / merge /
- Cut ruling and answers "Applied: …" (so it is not offered twice). The job never applies anything.
-4. **Tests + docs** — below; `umtool/docs/report-video.md` ("The assistant's labels, and asking it about a clip"),
- `umtool/docs/notes.md` (a reply's proposal), FACTS ("Release 36 lane D"), CHANGELOG.
-
-## Interfaces (exported)
-
-common `lib/clips/suggest.mjs` (+ `.d.mts`, package export): `SUGGESTIONS_FILE`, `readSuggestions`,
-`writeSuggestions`, `parseSuggestionsDoc`, `suggestionsState`, `suggestItems`, `roleLines`, `suggestPrompt`,
-`SUGGEST_ANSWER_SCHEMA`, `parseSuggestAnswer`, `suggestionsDocOf`, `askNoteOf`, `askClipsOf`, `askPrompt`,
-`ASK_ANSWER_SCHEMA`, `parseAskAnswer`, `wordsOfFile`, `wordsFor`, constants. `lib/report/draft/tasks/clipsSuggest.ts`:
-`CLIPS_SUGGEST_TASK`, `CODE_MODEL`, `LOCAL_BATCH_MAX`, `loadClipsProject`, `batchesOf`, `planClipsSuggest`,
-`runClipsSuggest`, `loadAsk`, `runClipsAsk`, `ClipsSuggestRefusal`. `controller/clipsSuggest.ts`:
-`enqueueClipsSuggest`, `planClipsSuggestJob`, `projectDirOf`, `postReplyToUmtool`, `umtoolOrigin`. reportDraft body
-keys `project`, `proposals`, `note`, `answers` (and `dryRun` for this task). Test kit
-`common/testing/clips/reactionProject.mjs` (`reactionProject`, `writeReactionProject`, `labelAnswer`). umtool
-`lib/report/clipSuggest.mjs` (`suggestionsView`, `parseSuggestRequest`, `draftBodyOf`, `readSuggestJob`,
-`writeSuggestJob`, `clearSuggestJob`, `suggestJobView`, `suggestRouteOf`), `lib/annotations/shape.mjs`
-`validateReplyProposal` / `REPLY_PROPOSAL_KINDS`, types `ReplyProposal`, `NoteReply.proposal`; NoteThread props
-`actions`, `afterReply`. MCP `generate` takes `project`, `proposals`, `answers`.
-
-## Commits
-
-| sha | what |
-|---|---|
-| `b1aa9162` | clips: the clips-suggest generation task (common, editor ops route, MCP, settings, test kit, unit tests) |
-| `912d9e6a` | umtool: the assistant in the clip editor — labels, sort, Suggest, Ask, Apply; the reply's proposal |
-| `c41c9f8b` | umtool e2e: clips-suggest.spec.ts (fixture, the editor stub's clips-suggest job) |
-| `17429bf7` | merge main (lanes A and C) |
-| `2cc98b85` | clips: local batches at most 20; the Ask uses lane A's umtoolUrl |
-| `39c70272` | docs: report-video.md, notes.md, SETTINGS.md + settings.json.example regenerated, FACTS, CHANGELOG |
-| (this) | plans: this record |
-
-## Gates (through the shared lock, from the worktree root, after the merge of main)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean (at 2cc98b85's tree and before each commit).
-- common `pnpm --filter yt-dlp-transcript-common test` — 4694 tests, 4690 pass, 2 skipped; the 2 that failed were
- `settings.json.example` / `SETTINGS.md is what the schema generates`, fixed by `archilyzer settings example` and
- green on the re-run (`lib/settingsSchema*.test.ts` + the new batching test: 25 / 25). New in common: 7
- (`lib/clips/suggest.test.ts` 5, `generationSettings.test.ts` +1, `tasks/clipsSuggest.test.ts` 1).
-- editor `pnpm --filter editor test` — 353 / 353 (new: `app/api/ops/_clipsSuggest.test.ts` 7 — the body, API
- labels + plan + ledger, a malformed answer refused, the cap and the daily cap, local through the arbiter with a
- six-word refusal and the unload, the code route's answers, Ask posting a trim and applying nothing).
-- mcp `pnpm --filter yt-dlp-transcript-mcp test` — 379 / 379 (+1 clips-suggest; one preset expectation gained the
- route).
-- `pnpm run test:scripts` — 1294 tests, 1290 pass, 4 skipped (new: `umtool/lib/report/clipSuggest.test.mjs` 4).
-- umtool `pnpm --filter umtool test` — 45 / 45.
-- `archilyzer docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check` — clean.
-- e2e (umtool, `E2E_MODE=dev`, one run): `clips-suggest.spec.ts` + `clip-editor.spec.ts` — **2 passed, 0 failed,
- 1.0 min** (14.7 s + 33.7 s).
-- Read-only plan on the live `~/reports/nik-drop-clips` (no model, nothing written): 112 proposals, words from
- words.json; ~13.7k input / ~6.7k output tokens — Sonnet 5.5 4 calls ≈ $0.09, Haiku 4.5 ≈ $0.05; the local model
- (before the 20-a-call cap) 2 calls, now 6.
-
-## Found and left
-
-- The editor stub in umtool's e2e cannot reach umtool, so the spec posts the agent's reply itself (as clip-editor.spec
- does); the reply's POST from the job is covered by the editor unit test's `postReply` and `postReplyToUmtool`'s shape.
-- An Ask needs `UMTOOL_URL` on the editor (lane A's Find clips needs it too); the live unit does not set it yet.
-- `~/reports/nik-drop-highlights` holds no reactions.json: the second-half project Find clips makes is the one to label.
diff --git a/plans/release-36/find-clips.md b/plans/release-36/find-clips.md
@@ -1,114 +0,0 @@
-# Release 36 lane A — `r36/find-clips`: one button on the video page (as shipped)
-
-Release 35 ran the clip finder's chain from a shell, step by step, and forced two transcriptions through a PAUSED
-worker pool by hand. This lane makes the chain one job and one button: **Find clips** on the video page (`pnpm ops
-find-clips`), a run-while-paused path for one manual transcription, and a chat-replay fetch for one video. Rulings
-followed: the UI works with no model (nothing here calls one); every CLI operation added has a button; no yt-dlp or
-ASR by hand (every step is an editor job or a worker lease); paced YouTube requests; plain words, no lead paragraphs;
-synthetic fixtures only; commits end with the one Co-Authored-By trailer.
-
-## What
-
-1. **Run while paused** — `common/jobs/workerPool.ts`: `acquire(signal, {whilePaused: true})` may lease a worker the
- pause-all ALONE switched off: the pool is paused, the worker is `disabled`, and its `pausedSnapshot` entry is
- `enabled` (`pauseHeld`). Never one drained, degraded or disabled by hand (a hand control during a pause writes
- `disabled` into the snapshot; a degrade mark fails eligibility on its own). The snapshot is only read: the lease
- leaves the worker `disabled`, so when it releases the worker is still paused and `resumeAll` restores it exactly as
- before. `pauseHeldIds()` lists them. The flag rides `transcribeWithWorker({whilePaused})`, the `transcribe-file`
- body (`pnpm ops transcribe`; a NAMED worker the pause holds is not refused when the request is whilePaused) and the
- `transcribe-one` body (both of its forms). Lane and batch acquires never pass it. The video page's Transcribe row
- shows **Transcribe now (workers paused)** while the pool is paused.
-2. **Chat replay for one video** — `common/controller/fetchLiveChat.ts`, `pnpm ops fetch-chat {slug, id}`, Media
- tools → **Fetch live chat**. `liveChatPlan` decides from the disk and the metadata: fresh cues → skip; the raw
- replay here with stale cues → normalize only (no network); a platform other than YouTube → "no chat fetcher for
- <platform>: only YouTube's chat replay is fetched"; `live_status: "not_live"` → never live. A fetch runs the
- managed download's chat-only argv (`liveChatOnlyArgs`, now exported from `ytdlp/downloadOneManaged.ts`: the
- channel's cookies and the platform's live pace) on the platform's DOWNLOAD queue, with the held-platform and
- cooldown refusals, the cookie retry, the backoff record and the clean-pass settle the metadata refresh uses, then
- `normalizeLiveChat`. The skips are `{ok: false, info: true}` before any job; a pass that writes nothing ends `done`.
-3. **Find clips** — `common/controller/findClips.ts`, job kind `find-clips` on its own `find-clips` queue. In order,
- each step skipped when its output exists and named in the log (`skipped: <step> — why` / `running: <step> — why`):
- persist the source (`persist-videos`), the corpus transcript (`transcribe-one`, whilePaused passed), word timings
- (the file transcription with words IN the job, into `data/<id>/words.json`), the chat replay (`fetch-chat`; a
- refusal or failure is logged and the chain goes on), diarization (the backfill lane's one-video run; past a held
- lane only with whilePaused, in the job), then umtool: `POST ${UMTOOL_URL}/api/report/clips` with the worker token,
- `{mode: "new", slug: <project>, from: "<slug>/<id>", target?, scope: "auto" | segment, wordsPath}`, and `GET
- ?job=<id>` followed to the end with its log relayed. The editor steps go through the editor's own ops actions in
- process (`findClipsEditor`, the research run's door) and are waited on; the job never sits on a queue a step needs.
- What would park a step forever fails it at once with where to fix it: a paused pool without whilePaused (or with
- no worker the pause alone holds), diarization switched off or unconfigured, a held backfill lane without
- whilePaused. umtool down, refusing or failing fails the umtool step naming the URL or umtool's error. The log ends
- `@@find-clips {json}`; `data/<id>/find-clips.json` keeps the project, its clip editor URL (umtool's `href`), the
- segment (the one asked, else auto-scope's), the segments and the steps for the page. A `dryRun` answers each
- step's plan. Lane B's final route: a 409 naming umtool's running job is asked again every 30 s (up to an hour);
- any other 409 (the slug exists) refuses; its `notes` are logged. `pnpm ops get workers` marks the workers a
- whilePaused job may take (`pauseHeld: true`).
-4. **The video page** — `FindClipsPanel`: a target length (minutes), **Run while paused (this video only)** when
- something holds a step (the pool paused, the backfill lane held — named in a status line), **Find clips**
- (disabled with "UMTOOL_URL is not set on the editor…" without one), and after a run the project linked and the
- segments found, each with **Find clips in this part** (posts again with `segment`).
-
-## Interfaces
-
-- `WorkerPool.acquire(…, {whilePaused?})`, `WorkerPool.pauseHeldIds()`; `TranscribeWithWorkerOptions.whilePaused`;
- `TranscribeFileRequest.whilePaused`, `TRANSCRIBE_FILE_BODY_KEYS` + `"whilePaused"`; `transcribeOneAction(…,
- salvage, whilePaused)`, `whisperVideoAction(…, storedUrl, whilePaused)`.
-- `liveChatOnlyArgs(config, cookies, url, pace?)`; `liveChatPlan`, `fetchLiveChat`, `runFetchChatJob`,
- `FETCH_CHAT_JOB_KIND`, `CHAT_PLATFORMS`, `noChatFetcherSentence`.
-- `parseFindClipsBody`, `inspectFindClips`, `planFindClipsSteps`, `runFindClips`, `enqueueFindClips`,
- `projectSlugFor`, `umtoolProjectUrl`, `FIND_CLIPS_JOB_KIND`, `FIND_CLIPS_QUEUE`, `FIND_CLIPS_RESULT_MARKER`,
- `FIND_CLIPS_BODY_KEYS`; `umtoolUrl()` (`common/lib/umtoolUrl.ts`); sidecars `words.json`
- (`lib/wordTimings-server.ts`) and `find-clips.json` (`lib/findClipsRecord-server.ts`).
-- Routes: `POST /api/ops/fetch-chat`, `POST /api/ops/find-clips`; `transcribe` / `transcribe-one` take
- `whilePaused`. umtool's clips route is lane B's; this lane calls it exactly as the plan's contract says.
-
-## Files
-
-common: `jobs/workerPool.ts`, `jobs/workerPool.whilePaused.test.ts`, `jobs/jobKinds.ts` (fetch-chat, find-clips),
-`controller/transcribeOne.ts`, `controller/transcribeFile.ts` (+ test), `controller/fetchLiveChat.ts` (+ test),
-`controller/findClips.ts` (+ test), `ytdlp/downloadOneManaged.ts` (the argv builder exported), `lib/umtoolUrl.ts`,
-`lib/wordTimings-server.ts`, `lib/findClipsRecord-server.ts`, `lib/sidecar-server.test.ts`, `lib/envVars.ts`.
-editor: `app/api/ops/{fetch-chat,find-clips}/route.ts`, `app/api/ops/_findClips.ts`, `app/api/ops/_researchEditor.ts`
-(findClipsEditor), `app/api/ops/{transcribe,transcribe-one}/route.ts`, `app/api/ops/_door.test.ts`, the video page
-(`page.tsx`, `videoActions.ts`, `mediaToolsActions.ts`, `findClipsActions.ts`, `components/FindClipsPanel.tsx`,
-`components/VideoMediaTools.tsx`, `components/VideoPanel.tsx`, `components/cards/PerFileTranscribeRow.tsx`),
-`e2e/find-clips.spec.ts`, `e2e/servers.ts` (E2E_UMTOOL_ORIGIN_FILE), `playwright.config.ts`.
-scripts: `archilyzer-ops.mjs` (+ test). Docs: COMMANDS.md, ENVIRONMENT.md (regenerated), OPERATING.md ("Find clips in
-a recording"), editor/CHANGELOG.md, plans/FACTS.md.
-
-## Gates
-
-All from the worktree root, through the session lock. Counts at the branch's start (main `0d471989`) → before the
-merge of main (lane B, `8938a5dd`) → after it:
-
-| Gate | Start | Before merge | After merge |
-|---|---|---|---|
-| tsc (`pnpm -r … exec tsc --noEmit`) | — | clean | clean |
-| common (`pnpm --filter yt-dlp-transcript-common test`) | 4657 (4655 pass, 2 skipped) | 4674 (4672 pass, 2 skipped) | 4688 (4686 pass, 2 skipped) |
-| editor unit (`pnpm --filter editor test`) | 346 | 346 | 346 |
-| test:scripts | 1255 (1251 pass, 4 skipped) | 1256 (1252 pass, 4 skipped) | 1264 (1260 pass, 4 skipped) |
-| docs cli / env / files, settings example `--check` | — | clean (COMMANDS.md, ENVIRONMENT.md regenerated) | clean |
-
-New unit tests: `jobs/workerPool.whilePaused.test.ts` (6), `controller/fetchLiveChat.test.ts` (6),
-`controller/findClips.test.ts` (9: every step run, every step skipped, umtool down / refusing / failing / slug taken,
-umtool busy then free, twitch chat skip + refused chat fetch, paused pool, diarization off / lane held / whilePaused
-inline / inline failure, dry run + refusals + the job's record and marker), `lib/umtoolUrl.test.ts` (1), three in
-`transcribeFile.test.ts` (whilePaused parse, the named pause-held worker, a paused pool running a whilePaused job),
-the sidecar enumeration (17), the door's traversing slug for fetch-chat and find-clips, the ops client's usage and
-marker.
-
-Editor e2e (start mode; the e2e build 894 s including the wait for the machine's heavy slot):
-`find-clips.spec.ts` 1 passed (17.5 s); `video-page.spec.ts` + `workers.spec.ts` 30 passed (57.6 s);
-after the merge of main (lane B) and the contract alignment, `find-clips.spec.ts` again: 1 passed (11.4 s; the
-rebuild took 2210 s, nearly all of it waiting for the machine's heavy slot).
-
-A common-suite run once hung over 11 minutes in `controller/seeder.test.ts` (webtorrent); it was stopped and the
-next run was clean. Not this lane's file.
-
-## Found and left
-
-- The word-timings transcription cuts its 16 kHz WAV under the OS temp dir (`runTranscribeFile`, as `pnpm ops
- transcribe` always has): about 300 MB for a 2.5-hour recording, in RAM where `/tmp` is a tmpfs, for the length of the
- transcription. Not changed here; the live editor's `TMPDIR` decides.
-- The backfill lane's one-video run (the diarization panel's Run) is held by the lane's gate like the sweep is; Find
- clips says so and offers whilePaused rather than waiting. The panel's own Run is unchanged.
diff --git a/plans/release-37/cite.md b/plans/release-37/cite.md
@@ -1,136 +0,0 @@
-# Release 37 lane D — `r37/cite`: renders, citations, the moment page, the MCP (as shipped)
-
-The plan of record is [`wayback-pages.md`](wayback-pages.md) ("S4"). Lane A put page records in the posts store
-([`core.md`](core.md)), lane C read the sites ([`extractors.md`](extractors.md)), lane B chose captures. This lane makes
-a page record something a person can SEE and CITE: its capture shot from the archive's replay, the same lines about
-the capture on every surface that shows it, a report's bare `page` citation turned into a citation of the record
-with one button, and the MCP and `/corpus.json` naming it. Rulings followed: no model anywhere (shots, views, the
-import and the rewrite are deterministic code, each a button); every archive.org request through the Wayback
-client's chain and gap on the `platform:archive.org` queue; a render reaches nothing but the archive; synthetic
-fixtures only; commits end with the one Co-Authored-By trailer.
-
-## What
-
-1. **Shots** (`common/social/waybackPageCapture.ts`). `capture-posts` on a Wayback pages channel branches before any
- fetcher (`capturePosts` → `captureChannelPageRecords`; `capturePostsAction` skips the fetcher check and queues on
- `WAYBACK_PAGES_QUEUE`). Each record's replay with the `if_` modifier (`waybackFrameUrl`, no toolbar) loads in a
- fresh headless Chromium context — JavaScript off, every request to anything but the archive's origin aborted
- (media/websocket too) — INSIDE the Wayback client's chain and gap (`WaybackClient.paced` → new
- `ArchiveOrgClient.paced`). A whole-page record is shot full page to 8000 CSS px (`trimmed` past it); a split record
- (tweet, Tumblr post, forum post, X profile header) is clipped to its own element, located from its kind and id
- (`pageItemTarget`: the extractor's own markup ids, else the largest element around its permalink holding no other
- item's) — not found, the page (`shotScope: "page"`, logged). Its `media` images (≤ 20) are saved through their own
- `im_` URLs (`waybackFileUrl`, new `WaybackClient.getArchivedFile`: 10 MB cap, in-archive redirects only). A 429/503
- page stops the run; three failures in a row stop it. No outcome carries an availability (S5 owns the original's
- state). `PostCaptureRecord` gained `shotScope?`, `trimmed?`.
-2. **How a capture is shown** (`common/lib/waybackPages/view.ts`, client-safe; `common/components/PageCaptureFacts.tsx`).
- `pageCaptureView(post, siblings)`: kind label, capture date, `links` (`pageCopyLinks` — the ONE place "Original (may
- be gone)" / "Wayback Machine copy, <date>" are made, so lane F's other archives are one line), the version list
- (whole-page records of the same original; "N captures of this page; text changed on …"), "This capture holds no
- content.", the extractor-fallback sentence, an item's first-seen date. On: the report site's moment page
- (`MomentPostView.page`; compose's post `RecordView` for a page record carries the page title, `originalLabel` and
- `downloads: [copy]`) and citation card (`PostLinks` prints `originalLabel`/`downloads`), the corpus viewer's post
- modal, the editor's Wayback pages panel, umtool's evidence rail, `get_post`.
-3. **The editor's records** (`WaybackPageRecords.tsx` in `WaybackPagesPanel`): each row opens to its capture and its
- shot (new `GET /api/channels/<slug>/posts-media/<id>/<name>`, images only); **Capture** shoots the picked records,
- or every record without a shot (`capturePostsAction`), with "capture again" for force.
-4. **Import this capture** (umtool). A `page` citation whose `archiveUrl` is a Wayback capture gets the button in the
- evidence rail (`ImportCapture.tsx`): pick a Wayback pages channel or name a new one (scoped
- `web.archive.org/web/*/<host>/*` through the editor's `create-channel`), Import (`import-page`, the job followed),
- **Cite this** on a record it made. A store article: `replacePageCitationWithRecord` (common
- `controller/handEdits.ts`) — the citation becomes `{kind: "post", channel, id, …common, fallback: {kind: "page", url,
- title?, archiveUrl?}}`, its quote checked against the record first (refused when it does not check), written as a
- hand iteration (amend-or-new, as `addClaimByHand`). A site report is built from its draft, which umtool never
- writes: the replacement citation is shown for the draft. Route `/api/articles/import-capture` (GET channels, GET
- `?job&slug`, POST `start`, POST `use`), lib `umtool/lib/articles/importCapture.ts`. `reports-prepare` copies the
- record's shot like any post capture (`copyCitedPostCaptures`, unchanged — `posts-media/<id>/shot.png`).
-5. **The citation schema:** `postCitationSchema.fallback` (`pageFallbackSchema`, additive, optional);
- `PAGE_FALLBACK_FIELD_DOCS`; CITATIONS.md regenerated.
-6. **MCP:** `get_post` prints a page record's capture (kind, capture date and timestamp, title, original, wayback,
- first seen, no content, fallback note); `search_transcripts` takes `platforms` (post platforms; video hits not
- narrowed), and a page record's hit is titled by its page; `PAGE_RECORD_CITE_RULE` in `instructions.ts` (cite the
- original AND the Wayback copy). **`/corpus.json`:** a Wayback pages channel carries `kind: "wayback-pages"`
- (`buildSiteCorpus` `channelKinds`, from compose-site); `POST_SCHEME.pageRecords` documents `page`.
-7. **The fake** (`fakeWayback.mjs`, a separate block): a Tumblr-themed index capture of two fixed-width posts
- (`PAGE_SPLIT_*`, served by default) and `/web/<ts>im_/<image>` answering a PNG (`IMAGE_PNG`).
-
-## Interfaces
-
-- `social/waybackPageCapture.ts`: `captureWaybackPageRecords(input, deps)`, `shootPageRecord`, `pageItemTarget`,
- `pageRecordImages`, `openWaybackRenderPage(allowOrigin)`, `liveWaybackPageCaptureDeps()`, `PAGE_SHOT_MAX_HEIGHT`,
- `PAGE_MEDIA_MAX`; `CapturePostsOptions.pageDeps?` (tests).
-- `lib/wayback.ts`: `waybackFrameUrl`, `waybackFileUrl`. `WaybackClient.paced`, `WaybackClient.getArchivedFile`,
- `WAYBACK_FILE_MAX_BYTES`; `ArchiveOrgClient.paced`.
-- `lib/waybackPages/view.ts`: `pageCaptureView`, `pageCopyLinks`, `pageVersions`, `pageVersionsLine`,
- `pageCaptureLine`, `pageKindLabel`, `pageFallbackNote`, `isWholePageId`, `PAGE_NO_CONTENT_LINE`; component
- `PageCaptureFacts`.
-- `citations/schema.ts`: `pageFallbackSchema`, `PageFallback`, `PAGE_FALLBACK_FIELD_DOCS`.
-- `controller/handEdits.ts`: `replacePageCitationWithRecord(id, {cite, channel, id, base?})`.
-- `lib/corpus.ts`: `CorpusChannel.kind?`, `buildSiteCorpus(…, {channelKinds})`. MCP `searchTranscripts({postPlatforms})`.
-
-## Commits
-
-| sha | what |
-|---|---|
-| `9acf73ec` | page records' shots and images (capture-posts on a pages channel), lib/waybackPages/view.ts + PageCaptureFacts on the moment page, card and post modal |
-| `3955bfd6` | the editor's records + Capture + posts-media route; the citation `fallback`, replacePageCitationWithRecord; umtool Import this capture (route, lib, rail, stub); MCP get_post/platforms/instructions; corpus.json kind; e2e specs; OPERATING/FACTS/CHANGELOG |
-| `aace18a1` | merge main (lane B) |
-| `2ec5cecc` | tests: compose of a cited page record, the moment page, the card, PageCaptureFacts, MCP; CITATIONS.md regenerated; a page hit's title in search output |
-| `41575aff` | merge main (lane E) |
-| `55a3ed30` | one page→post builder shared with find-copy (`lib/citations/pageAsPost.ts`); a gone original named with lane E's label; the archiveOrgClient merge repaired |
-| `1f069fe3` | the e2e spec's wait, this record |
-| `41cc0658`, `de2fd52b` | merge main (lane G; r38/video-assist) |
-
-## Gates
-
-All through the session's locks, from the worktree root.
-
-- tsc (`pnpm -r … exec tsc --noEmit`): clean at `3955bfd6` and on the final code (after `55a3ed30`'s edits). The
- merge commit `41575aff` itself did not compile (archiveOrgClient keep-both cut `send()`'s closing lines); fixed
- in `55a3ed30`.
-- common: lane A's record at main d261ab33: 4765 tests. This branch, full run after the lane B merge: **4799 tests,
- 4795 pass, 2 fail, 2 skipped** — both mine (an architecture back-edge from a lib test into components; a card
- assertion on an icon-wrapped link), fixed; each touched file re-run green after the lane E merge:
- composeReportsPages 1/1, findCopyPages 4/4 (lane E's `as` expectation now carries the fallback), handEdits 8/8,
- capturePosts 6/6, waybackPageCapture 5/5 (the real-Chromium crop test ran, not skipped), view 3/3,
- architecture 4/4, liveness 7/7, PageCaptureFacts 1/1, citations 12/12, MomentArticle.page 1/1.
-- editor unit: **357 / 357**. mcp: **381 / 381** (379 at main + 2). umtool unit: **45 / 45**. test:scripts:
- **1316: 1312 pass, 0 fail, 4 skipped**. export unit: **117 / 117**.
-- After merging main (lane G, r38/video-assist; `de2fd52b`): tsc clean; common **4856 / 4854 / 0 fail / 2
- skipped**; editor **362/362**; mcp **382/382**; umtool **45/45**; test:scripts **1327: 1323 / 0 / 4 skipped**;
- the four docs checks 0.
-- Docs: `docs env --check`, `docs files --check` (CITATIONS.md regenerated), `docs cli --check`, `settings example
- --check`: all 0.
-- e2e (editor, start mode): `wayback-pages-capture.spec.ts` + `wayback-pages.spec.ts`: 1 passed (lane A's), 1
- failed — the capture itself ran clean ("Done: 4 captured, 0 failed", item and page shots, the image), the spec
- waited for the wrong line; fixed. Re-run (stamp at 55a3ed30): `wayback-pages-capture.spec.ts` +
- `capture-posts.spec.ts` **2 / 2 passed** (53 s) — the four records shot (two whole pages, two Tumblr posts clipped
- to their boxes), the post's image saved through `im_`, the shot shown on the page.
-- e2e (umtool, start mode, stamp e5ddfa0e607c): `import-capture.spec.ts` + `article-evidence.spec.ts` **4 / 4
- passed** (22.6 s).
-
-## Decisions
-
-- The shot path is NOT a registered `SocialFetcher`: a "webpage" fetcher would be listed by the channel form and
- resolved by every fetcher-shaped path (availability, fetch); `capturePosts` branches on the channel kind instead.
-- JavaScript off in the render: the archive rewrites a capture's links and styles server-side, and the capture's
- own scripts would only ask the archive for more. Pages that draw themselves with script shoot as their HTML.
-- Every request off the archive's origin is aborted: a render never touches the live web (or a tracker in a
- capture). Audio/video sub-resources are refused.
-- The page load holds the Wayback client's chain for its whole duration (sub-resources included); the gap follows
- it — one stream at a time from this process.
-- No locator hint was added to the draft (no shared-shape change): the extractors' ids carry enough.
-- An item the render cannot find is shot as the whole page (marked `shotScope: "page"`), not refused: the capture
- is still the evidence.
-- Image cap 20 per record, 10 MB each.
-- Import this capture refuses a quote the record does not hold (the hand-edit rule), never writes a site report
- (built from its draft — the replacement is shown), and keeps the page as `fallback`.
-- `search_transcripts` filter is `platforms` (post platforms), not a new content type: `content_types` stays
- video|post, and a page record is a post.
-- `corpus.json` gains an optional channel `kind` with no spec bump (additive; absent = an account's channel).
-
-## Found and left
-
-- The editor has no single-post page; the records table on the channel page is the editor's post view for page
- records.
-- A site report's draft is not rewritten by umtool (it never writes a draft); its replacement citation is shown.
diff --git a/plans/release-37/core.md b/plans/release-37/core.md
@@ -1,150 +0,0 @@
-# Release 37 lane A — `r37/core`: the client, the record, one-page import (as shipped)
-
-The plan of record is [`wayback-pages.md`](wayback-pages.md) ("What a record is", "What a channel is", S1). This lane
-makes a Wayback Machine capture of a page that is not a video a first-class record: a `Post` on platform `"webpage"`
-in a **Wayback pages** channel, imported one capture at a time (`import-page`), its raw body kept so its records can be
-re-derived offline (`reextract-pages`). Rulings followed: the UI works with no model (nothing here calls one); every
-CLI operation has a button (Import a capture, Re-extract); every request to archive.org goes through the polite client
-on the `platform:archive.org` queue, one capture per job, no crawling; synthetic fixtures only (the fake Wayback);
-commits end with the one Co-Authored-By trailer.
-
-## What
-
-1. **Platform `"webpage"`** — in `Platform`, `PLATFORM_VALUES`, `SOCIAL_PLATFORM_VALUES`, `isSocialPlatform`,
- `defaultWebpageUrl` (`common/lib/platform.ts`) and `PostPlatform`, `POST_PLATFORM_VALUES`, `isPostPlatform`,
- `postPlatformLabel` ("Web page"), `postPermalink` (`common/lib/posts.ts`). `detectPlatform` does not answer it (a
- web.archive.org URL is a capture of something else). A Wayback pages channel is `sourceKind: "social"` +
- `platform: "webpage"`, so the posts index pass, the per-site posts manifests, compose, search and `get_post` carry
- its records with no reader of their own (proved through the real `buildIndex` and `compose-site`). The MCP's post
- markdown prints a page's author plain (no "@"); a video manifest leaves a page citation out with a warning, as it
- does a forum post. A post fetch refuses a Wayback pages channel (`WAYBACK_PAGES_NOT_FETCHED`, info for the
- scheduler's skip): nothing is fetched unattended.
-2. **`Post.page`** (`PagePostInfo`), validated by `parsePagePostInfo` (`lib/waybackPages/parse.ts`, client-safe): a
- page without its provenance or extractor is dropped, never the post.
-3. **`WaybackClient.getCapture(ts, url, {raw, maxBytes?})`** — the `id_` body through `ArchiveOrgClient.getBounded`
- (new: a manual-redirect GET whose body is read to the cap and no further, the gap counted from its end). 2 MB cap
- (`WAYBACK_PAGE_MAX_BYTES`, a constant — no settings key fits); text/html, text/plain, application/json only;
- redirects followed by hand inside web.archive.org only (≤ 5, re-formed as `id_`), the FINAL capture's timestamp
- and URL answered; `WaybackCaptureRefusal` (`mimetype`, `too-large`, `offsite-redirect`, `redirect-loop`,
- `not-archived`). `closestCapture(url, at)`: one CDX request with `closest`/`sort=closest`, 200s only, re-sorted by
- distance (`waybackCdxUrl` gained `closest`). The process client honours `E2E_WAYBACK_ORIGIN_FILE`.
-4. **Storage** — `channels/<slug>/pages/<captureTs>-<urlHash>/raw.html.gz` + `capture.json`
- (`lib/waybackPages/store-server.ts`): body first, then capture.json, each tmp + rename. At the channel root,
- never under `data/<id>/`, so the media tier never moves it.
-5. **The generic extractor** (`extractors/generic.ts`, v1) and **`extractPage`** (`extract.ts`): toolbar insert,
- `wm-ipp*`, `/_static/`, wombat and `__wm.` stripped; furniture pruned; `<main>`/`[role=main]`, else top-level
- `<article>`s, else the densest block; headings, paragraphs, `- ` list items, `> ` blockquotes, `<pre>`, link text,
- image alts; title og:title → `<title>` → h1; author/date from JSON-LD, meta and `<time>`, a date after the capture
- not believed; links un-rewritten and absolute against the original; images as `/web/<ts>im_/<src>`. Plain text and
- JSON as they are. The dispatcher offers HTML to `SITE_EXTRACTORS` in order; a throw or no record falls back to
- generic and the record says so (`page.extractorFallback`). `decodeCaptureBody` decodes by the header's, else the
- document's, charset.
-6. **Draft → Post** (`toPost.ts`) and **the split-record merge** inside `upsertPosts`: the later capture's facts
- win, `firstSeenTs` keeps the earliest, the stored createdAt (and shard) is kept; records compared by sorted-key
- JSON of what a reader reads back. `assignPageVersions`: later whole-page captures of a page name the first as
- `versionOf`. `replaceChannelPosts` (posts-server) rewrites a channel's posts whole for a re-extract.
-7. **`import-page`** (`controller/importPage.ts`): job kind on `platform:archive.org` (`needsText`, an ingest kind),
- the ops action `{slug, url, at?, dryRun?}`, the CLI `archilyzer wayback pages import`, the channel page's **Import
- a capture** (URL + date picker, the job linked). Refused before any job: no channel, not a pages channel, a
- listing or a bare URL with no date, a video ("use import-video"), an X capture outside an X-scoped channel while
- X is private. A stored capture is not fetched again. `startImportPageJob` is lane B's door.
- **`reextract-pages`** (`controller/reextractPages.ts`): every stored capture re-read (no request), stale counted
- (extractor/version not what it would go to now, or a fallback), records replaced when anything differs (a record
- whose capture is not stored is kept); a job on the same queue (ops + the channel page's **Re-extract**), and the
- CLI `archilyzer wayback pages reextract` in-process (editor stopped).
-8. **The channel kind** — `config.wayback = {targets: [{url, match, from?, to?, mime?, include?, exclude?}],
- collapse?}` (`lib/waybackPages/config.ts`, in `channelConfigSchema.ts`, CHANNEL.md). The New channel form detects
- a Wayback URL of a non-video page (`isWaybackPagesUrl`) or takes "Wayback pages" as the platform; targets are rows
- (`WaybackTargetsField.tsx`) posted as one JSON field; `waybackTargetFromUrl` derives the first; the handle is its
- host; "Fetch posts now" is not offered. `create-channel` over ops takes the same fields (`waybackTargets`).
-9. **X** — `isXPostsChannel` answers true for a Wayback pages channel scoped on x.com / twitter.com /
- mobile.twitter.com, so a public site leaves it out while `social.x.visibility` is private.
-10. **The fake** — `fakeWayback.mjs` serves page captures raw (an article in furniture, two captures; a toolbar
- body; 3 MB; text/plain; image/jpeg; an off-archive redirect), 302s a missing timestamp to the nearest, and its
- CDX honours `closest`.
-
-## Interfaces
-
-- `PostPlatform` + `"webpage"`; `Post.page?: PagePostInfo`; `PagePostInfo.extractorFallback?` (additive, the one
- change to the shared contract).
-- `WaybackClient.getCapture`, `closestCapture`, `WaybackRawCapture`, `WaybackCaptureRefusal`,
- `WAYBACK_PAGE_MAX_BYTES`, `WAYBACK_MAX_REDIRECTS`, `waybackTestOrigin`; `ArchiveOrgClient.getBounded`,
- `BoundedResponse`; `waybackCdxUrl(url, {closest})`.
-- `lib/waybackPages/`: `config.ts` (`WaybackTarget`, `WaybackPagesConfig`, `coerceWaybackPagesConfig`,
- `coerceWaybackTarget`, `isWaybackPagesChannel`, `waybackTargetFromUrl`, `waybackTargetHost`), `urls.ts`
- (`PAGE_MIMETYPES`, `parsePageCaptureAsk`, `videoPageOf`, `captureTsIso`, `isXHostUrl`, `isXTargetUrl`,
- `isWaybackPagesUrl`), `parse.ts`, `extract.ts` (`extractPage`, `chooseExtractor`, `decodeCaptureBody`),
- `extractors/generic.ts` (`genericExtractor`, `stripWaybackChrome`, `unrewriteWaybackUrl`, `absoluteOriginalUrl`,
- `waybackImageUrl`), `toPost.ts` (`draftToPost`, `mergePageRecord`, `assignPageVersions`, `isWholePageRecord`,
- `stableRecordJson`, `asStored`), `store-server.ts` (`StoredCapture`, `writeStoredCapture`, `listStoredCaptures`,
- `readStoredCaptureBody`, `hasStoredCapture`, `countStoredCaptures`, …).
-- `controller/importPage.ts`: `planImportPage`, `importPage`, `queueImportPage`, **`startImportPageJob({slug, url,
- at?, requestedBy?, paths?}) → {jobId}`** (throws `ImportPageRefusal`), `recordsOfCapture`, `xCaptureRefusal`,
- `WAYBACK_PAGES_QUEUE`, `IMPORT_PAGE_JOB_KIND`, `IMPORT_PAGE_RESULT_MARKER`. `controller/reextractPages.ts`:
- `reextractPages`, `queueReextractPages`, `REEXTRACT_PAGES_*`.
-- `posts-server.ts`: `replaceChannelPosts`. `fetchPosts.ts`: `WAYBACK_PAGES_NOT_FETCHED`.
-- Routes: `POST /api/ops/import-page`, `POST /api/ops/reextract-pages`. Actions:
- `editor/app/channels/[slug]/waybackPagesActions.ts`.
-
-## Files
-
-common: `lib/platform.ts`, `lib/posts.ts`, `lib/posts-server.ts`, `lib/postsVisibility.ts`, `lib/channelConfig.ts`,
-`lib/channelConfigSchema.ts` (+ test's key count), `lib/archiveOrgClient.ts`, `lib/waybackClient.ts`
-(+ `waybackClient.pages.test.ts`), `lib/waybackPages/{config,urls,parse,extract,toPost,store-server}.ts`,
-`lib/waybackPages/types.ts` (one additive field), `lib/waybackPages/extractors/generic.ts`, tests
-`lib/waybackPages/{config,toPost}.test.ts`, `extractors/generic.test.ts`, `controller/importPage.ts` (+ test),
-`controller/reextractPages.ts`, `controller/fetchPosts.ts`, `jobs/jobKinds.ts`, `bin/wayback-pages.ts`,
-`bin/archilyzer.ts`, `bin/compose-site.waybackPages.test.ts`, `lib/envVars.ts`, `lib/citations/schema.ts` (two doc
-strings), `lib/report/{convert-server,convertManifest}.ts`, `testing/web/fakeWayback.{mjs,d.mts}`,
-`testing/README.md`. mcp: `src/server.ts` (one condition). editor: `app/channels/[slug]/{page.tsx,
-waybackPagesActions.ts, socialActions.ts, components/WaybackPagesPanel.tsx}`,
-`app/channels/components/{ChannelForm.tsx, WaybackTargetsField.tsx, parseChannelForm.ts (+ test),
-channelConfigToForm.ts}`, `app/api/ops/{import-page,reextract-pages}/route.ts`, `e2e/wayback-pages.spec.ts`,
-`e2e/servers.ts`, `playwright.config.ts`, `CHANGELOG.md`. scripts: `archilyzer-ops.mjs` (+ test). Docs: OPERATING.md
-("Pages from the Wayback Machine"), COMMANDS.md, CHANNEL.md, CITATIONS.md, ENVIRONMENT.md (regenerated),
-plans/FACTS.md ("Release 37 lane A: page records").
-
-## Commits
-
-| sha | what |
-|---|---|
-| `1d2fdf32` | the common half: platform, Post.page, getCapture, pages/ storage, generic extractor, import-page, reextract-pages, ops actions, CLI rows, the fake |
-| `76455fa9` | the editor half: New channel form kind + targets, the channel page (Import a capture, Re-extract), ops routes, e2e spec |
-| `0861c490` | this record, FACTS, OPERATING |
-| `a926ba17` | a nearest import fetches by CDX's own original URL |
-| `68f278c4` | merge main (lane C's site extractors) + the dispatcher test over their fixtures, tumblr's PostPlatform cast dropped |
-| `e9c97614` | lane C's fixture reader opts out of Turbopack tracing (next-build-trace.test) |
-
-## Gates
-
-All through the session's locks, from the worktree root.
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean before each code commit and on the merged
- tree.
-- common: start 4695 (4693 pass, 2 skipped); after the lane, before the merge, **4728 / 4726 pass / 0 fail / 2
- skipped** (+33). Merged with lane C: **4765 / 4762 / 1 / 2** — the one is `controller/seeder.test.ts` (torrent
- seeding over WebRTC), which hung 19 minutes in that run and was killed; alone it passes (49/49 with the wayback
- extractor tests). It passed in the pre-merge full run.
-- editor unit: 353 → **356 / 356** (+3, parseChannelForm).
-- mcp: **379 / 379** (unchanged).
-- test:scripts: 1315 → **1316: 1311 pass, 1 fail, 4 skipped** on the merged tree — the fail was
- `next-build-trace.test.mjs`'s cwd-path check on lane C's `__fixtures__/capture.ts`; fixed in `e9c97614`, the file
- re-run **9 pass / 0 fail / 1 skipped**. Pre-merge: 1312 pass / 0 fail / 4 skipped.
-- Docs: `docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check`: all 0.
-- e2e (editor, start mode, stamp `25cf06a2dbf6` at `68f278c4`): `wayback-pages.spec.ts` + `ops-api.spec.ts` **18 / 18
- passed** (1.1 min); `social-channel.spec.ts` **6 / 6 passed** (1.7 min).
-
-## Rulings followed / decisions
-
-- No settings key for the 2 MB cap (none fits): a constant plus the `maxBytes` option.
-- The record uses the FINAL capture after redirects (timestamp and original URL); `capture.json` keeps what was
- asked (`requestedTs`, `requestedUrl`).
-- No reindex at import: the index picks the records up on its next build, exactly as after a post fetch (which
- reindexes nothing either).
-- X visibility is per CHANNEL (the index and compose rule is channel-level): an X-scoped pages channel is an X
- channel; while X is private an X capture into any other pages channel is refused, so no X capture can reach a
- public site through a non-X channel.
-- A page kind is validated as a word, not against `PAGE_KINDS`, so an older reader keeps a newer extractor's
- records.
-- `reextract-pages` rewrites the channel's posts whole (it may move a record's month); every other writer stays
- append-only.
diff --git a/plans/release-37/extractors.md b/plans/release-37/extractors.md
@@ -1,114 +0,0 @@
-# Release 37 lane C — `r37/extractors`: the site extractors (S3, as shipped)
-
-The plan of record (`plans/release-37/wayback-pages.md`, "What a record is" and "S3") makes a non-video Wayback
-capture a `Post` on platform `"webpage"`. This lane is S3: the site extractors, pure modules against the contract on
-main (`common/lib/waybackPages/types.ts`), registered in `SITE_EXTRACTORS`. Lane A's generic extractor, dispatcher and
-importer are not needed here; every module is tested directly. Rulings followed: no model anywhere (deterministic
-code); no network, disk, clock or randomness in an extractor; synthetic fixtures only (no real capture, no corpus
-content); the forum parser reused, not forked; no new dependency.
-
-**S3 status: done** — Tumblr, X/Twitter, XenForo, Google Docs and YouTube About, each `version: 1`.
-
-## What
-
-1. **`SITE_EXTRACTORS`** = `[gdoc, yt-about, x, xenforo, tumblr]`: the three host-matched first, XenForo by its
- markup on any host, Tumblr last (its own host, or a custom domain whose markup is a Tumblr theme).
-2. **Tumblr** (`tumblr`): `*.tumblr.com` blogs (not www/assets/static/media hosts), and custom domains carrying
- Tumblr's own markers (the controls iframe, its asset hosts, `tumblr-theme` meta, `com.tumblr` app links,
- `tumblr-feed:`) with `/post/<id>` permalinks. Posts are found by permalink on the capture's own host, or the
- theme's `article.post` / `id="post-<id>"` / `data-post-id`; a post's container is the largest element around its
- permalink holding no other post's. A post page → its own post only; an index / archive / tagged / page-N page →
- one `tumblr-post` draft per post, `itemId: "tumblr-<id>"` (the index's draft of a post equals its permalink's).
- Date: `<time datetime>`, the permalink's title or text, a date-classed element, then (post page) meta. Tags from
- `/tagged/` links; the reblog source (a foreign post link marked reblog/via/source) → `repostOf` on `"webpage"`,
- `isRepost`; images as `media` with their original src; author = the blog name. No post → one `tumblr-index`
- whole-page draft (`noContent` when empty).
-3. **X / Twitter** (`x`): twitter.com, mobile.twitter.com, x.com. The 2012–2022 desktop layouts (`div.tweet`) and the
- legacy mobile one (`table.tweet`) → one `tweet` draft per tweet (`itemId: "tweet-<statusId>"`, url
- `https://twitter.com/<handle>/status/<id>`), author/authorName, the content's time (data-time, the printed
- line, else the id's snowflake), text with emoji alts, expanded links, mentions and hashtags as text, the
- pic.twitter.com tail dropped; `media` from the photo containers; reply (`replyTo` — the chain on a status page,
- the conversation root on a timeline), retweet (the retweet's own status by the retweeter, `repostOf` the
- original), quote (`quoted`). A pinned repeat is one draft. The profile header (2014+ ProfileHeaderCard, 2012
- profile-card, mobile profile-details) → one `x-profile` draft, `x-profile-<handle>-<captureTs>`. The JS app's
- shell → one whole-page draft, `noContent`, kind by URL (profile/status); a notice page ("Account suspended") →
- the same, quoting the notice.
-4. **XenForo** (`xenforo`): `data-template="thread_view"`, `<html id="XF">`, `.message--post`. The page goes through
- `parseXenforoThreadPage` with the capture's original URL; each post → a `forum-post` draft with the parser's id
- (the BARE post id — what `xenforoFetcher` stores), url, text, links, media, refs and `forum`, so a capture's posts
- are byte-equal to a live channel's posts of the same page. A wall (login, check, captcha, not found) → one
- `generic` noContent draft saying which.
-5. **Google Docs** (`gdoc`): `docs.google.com/document/…`. `mobilebasic` / `pub` (`?embedded=true`) / `preview` → one
- `gdoc` whole-page draft: the title, the body (`#contents` / `.doc-content`) with headings and list items as lines,
- Google's banner/header/footer dropped, links unwrapped from `/url?q=`. The `/edit` shell → `noContent`, the text
- and links naming `https://docs.google.com/document/d/<id>/mobilebasic` (none for a `/d/e/` published id).
-6. **YouTube About** (`yt-about`): `/user/<x>`, `/c/<x>`, `/channel/<UC…>`, `/@handle` (bare, `/about`, `/featured`)
- and `/<custom>/about`. The 2012–2016 layout (`.about-description`, `.about-stat`, `.about-channel-link`,
- `country-inline`) and the 2017+ app (`ytInitialData` located, brace-matched, parsed — or unescaped first when
- assigned as a JS string; renderers found by key: the About tab's full metadata, the 2023+ view model, the header,
- the channel metadata) → one `yt-about` draft per capture, `yt-about-<UC id | URL name>-<captureTs>`: title,
- description, links (unwrapped from /redirect), joined, subscribers, views, country, as text lines.
-7. **Shared** (`util.ts`): the tree helpers, `unwrapWaybackHtml` (toolbar + replay URLs), `unwrapRedirect`,
- `absoluteUrl`, `statedUrl`, `renderBlock` (`forumBodyToText` over a pruned, absolutized copy), `parseEnglishDate`
- (UTC), `isoFromIso`, `isoFromEpochSeconds`.
-
-## Interfaces exported
-
-`SITE_EXTRACTORS` (index.ts); per module the extractor (`tumblrExtractor`, `xExtractor`, `xenforoExtractor`,
-`gdocExtractor`, `ytAboutExtractor`) and its `extract*` function; helpers tests use: `isTumblrBlogHost`,
-`tumblrBlogName`, `parseXUrl`, `statusUrl`, `snowflakeIso`, `isXHost`, `googleDocId`, `mobilebasicUrl`,
-`isGoogleDocsUrl`, `youtubeChannelOf`, `jsonAfter`. No change to `types.ts`.
-
-## Files
-
-`common/lib/waybackPages/extractors/`: `index.ts` (imports + entries only), `util.ts`, `tumblr.ts`, `x.ts`,
-`xenforo.ts`, `gdoc.ts`, `ytAbout.ts` (new); tests `index.test.ts`, `tumblr.test.ts`, `x.test.ts`,
-`xenforo.test.ts`, `gdoc.test.ts`, `ytAbout.test.ts` (new, 34); `__fixtures__/` (new, synthetic): `capture.ts`,
-`xenforoCaptures.ts` (the forum parser's synthetic thread page, live and as Wayback's replay serves it), and 19 HTML
-pages — Tumblr ×5 (2012 classic post + index, 2014 article.post on a custom domain through the replay, a minimal
-theme's tagged page, an about page), X ×6 (2012 and 2015 profiles, 2016 status page, mobile profile, 2022 shell,
-suspended notice), Google Docs ×3 (mobilebasic, pub, edit shell), YouTube ×4 (2013 About, 2019 Polymer About, 2021
-channel page, 2024 @handle About with an escaped-string ytInitialData). `plans/FACTS.md` ("Release 37 lane C"),
-`editor/CHANGELOG.md`.
-
-## Commits
-
-| sha | what |
-|---|---|
-| `1a3a1026` | wayback pages: the five site extractors, util.ts, the registry, 19 synthetic fixtures; 34 tests |
-| `79e8a16c` | yt-about: the ytInitialData assignment, never a comparison of it (test) |
-| `356de67c` | FACTS ("Release 37 lane C"), CHANGELOG |
-| (this) | plans: this record |
-
-## Gates (through the session lock, from the worktree root)
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean (before `1a3a1026`, and again on the final
- code before `79e8a16c`).
-- `pnpm --filter yt-dlp-transcript-common test` — **4729 tests, 4727 pass, 0 fail, 2 skipped** (branch start
- 7778d441: 4695 / 4693 / 0 / 2; +34 here — tumblr 6, x 9, xenforo 3, gdoc 5, yt-about 8, registry 3).
- `testing/fakes.test.ts` green inside it.
-- No CLI row, env key, file schema or setting changed: no docs check applies. No app, build or e2e spec touched.
-
-## Decisions
-
-- **No `itemId` on a shell or a version.** A noContent shell (X app, Docs editor) and a Google Doc are whole-page
- records (`<captureTs>-<hash>`): an upsert is latest-wins, so a shell with a tweet's id would overwrite the record
- a good capture made, and a doc is a new version at each capture. A YouTube About page keeps the brief's
- `yt-about-<channel>-<captureTs>` (one per capture by construction).
-- **Tweet urls are twitter.com** (the brief's), while X channels write x.com; the refs carry `platform: "twitter"`
- and the status id, which is what joins them.
-- **The forum item id is the bare post id**, as the live fetcher stores it (not "kf-<id>").
-- **A Tumblr reblog's ref is `"webpage"` / `tumblr-<id>`**, cast in tumblr.ts until lane A registers `"webpage"`.
-- **A mobile-layout retweet** carries no retweet id, so the tweet shown is recorded as the original's own.
-- **Every extractor returns ≥ 1 draft**, so the dispatcher never has to treat an empty list.
-- **A printed date is UTC** (pages name no zone); the snowflake is exact.
-
-## Found and left
-
-- Tumblr's 2022+ blog view (the React app on `www.tumblr.com/<blog>`) is not matched (its captures hold a shell);
- such a page falls to the generic extractor.
-- XenForo 1 (`#messageList li.message`) is not read: the shared parser is XenForo 2.
-- A Tumblr theme that prints dates in a format `parseEnglishDate` does not know leaves `publishedAt` absent (the
- record's time is then the capture's).
-- A Google Docs `/edit` capture whose `DOCS_modelChunk` script holds the text is still recorded as noContent; reading
- the editor's model is a later version.
diff --git a/plans/release-37/forum-resume.md b/plans/release-37/forum-resume.md
@@ -1,131 +0,0 @@
-# Release 37 lane G — `r37/forum-resume`: a forum walk that resumes, never re-crawls (as shipped)
-
-The operator, 2026-10-20: "change the walk to track the last page and be able to resume rather than always
-re-crawling, even if things could change. We can have two buttons like a channel's sync and full fetch." The bug seen
-live: a run capped with `pages: 3` caught up the 3 newest pages and stored its catch-up position as THE cursor,
-replacing the history cursor (2340 → 2593), and the next run re-read ~250 held pages in history mode. One cursor
-served two walks. Rulings followed: no model anywhere; every operation has a button (Fetch posts, Full re-walk, Retry
-after a block); polite (the walk's pace is unchanged, a retry waits minutes, never sooner); synthetic fixtures only
-(no real forum, no network — a saved-pages directory and a fake thread); commits end with the one Co-Authored-By
-trailer.
-
-## What
-
-1. **Two positions** — `posts-state.json` `forum` (`ForumWalkState`, `common/lib/forumWalk.ts`, pure):
- `{newestPage, newestPostId, catchUpPage?, historyPage?, oldestPageReached, complete?}`. `newestPostId` is the
- MARK: a catch-up ends at the first page holding an archived post with id ≤ it. A capped or interrupted catch-up
- writes only `catchUpPage` (its next page); the history walk writes only `historyPage`. A forum fetch writes no
- `cursor`; an old one is read once as the history position and dropped.
-2. **Derive, don't trust** — `deriveForumWalk(stored, legacyCursor, heldPages)`, run at the start of every fetch and
- by the channel page: the held band is the contiguous run of archived `forum.page`s down from the highest;
- `historyPage = min(stored, band.low + 1)`; page 1 held ⇒ complete; complete with the band above page 1 ⇒ reopened.
- Each change is a log line. (`+1`, not the brief's `− 2`: see "Decisions".)
-3. **The walk** (`walkXenforoThread`, `common/social/xenforoFetcher.ts`) — three modes from the last page:
- catch-up (to the mark, then a jump to `historyPage`, never re-reading the band between; meeting the pages an
- earlier capped catch-up read, a jump to its `catchUpPage`), history (to page 1; archived posts mean nothing), full
- (every page; archived posts handed back for their edits). A page whose posts are all archived never counts
- against `pages`/`limit` (except in a full re-walk) and logs "Page N: all held, skipping on." Every checkpoint
- carries the positions it leaves. A first run (nothing archived) is one history walk from the last page. The
- start line says both positions ("caught up to page 2600; history resumes at page 2338"). The watermark (`since`)
- is gone from the forum walk: after a capped catch-up it would stop the next one above the band still owed.
-4. **Two buttons** — the forum channel page's **Fetch posts** (catch up + continue history; "Latest N pages" caps
- it) and **Full re-walk** (`full: true`; it replaces "Re-fetch full history" on a forum channel; an inline confirm
- names the page count and the time at the channel's pace, `meanPagePauseSeconds` = 1.25 × the base pause). A full
- re-walk upserts with `ignorePosition` (a renumbered `#N` is not an edit) and logs the archived posts no page
- showed (`notSeen`), never marking them. A status line: "pages read 2338–2600 of 2600 · history to page 1
- remaining: 2337 pages (~9.7 h)", plus "catch-up unfinished at page N" while one is owed.
-5. **Retry on a block** — `fetch-posts {retryOnBlock: {minutes, max}}`: a challenge or refusal (403/429) stops the
- walk with `PostFetchResult.block`; the controller waits `minutes` (log: "Waiting 30 min after a challenge page,
- try 2/12."), re-reads the state and runs again, `max` tries in all; never a captcha or a login; minutes 5–1440,
- max 1–48; a cancel ends the wait, a drain ends it as a drained success. The default for the forum Fetch posts
- button is `settings.social.xenforo.retryOnBlock` (off unless set), set on the channel page (Forum session →
- **Retry after a block**: minutes, tries, Save, Turn off). Ops: `"retryOnBlock": {…}` or `true` (the setting);
- CLI: `--retry-minutes N --retry-tries M` or `--retry-on-block`. The scheduler's unattended fetch never retries.
-6. **An empty page is read again, once** (the orchestrator's live finding, 2026-10-20: "The browser check cleared
- in 12 s. → Page 2193/2606: 0 post(s) parsed … → [error] Page 2193 of the thread parsed to no posts"): right after
- a browser check clears, the page standing is often not the thread page yet. A page that parses to no posts is
- loaded once more (paced like any load; logged "Page N: no posts on the first read after the browser check
- cleared; loading it again."); only a second empty read stops the walk, as before.
-7. **Test seam** — `E2E_FORUM_FIXTURE_DIR` (test audience, ENVIRONMENT.md): the forum fetcher reads
- `<dir>/<threadId>/page-<N>.html` (and `page-<N>.<status>.html` in its place while it exists) with no pause
- (`common/social/forumFixtureLoader.ts`); the e2e server sets it per slot (`e2e/servers.ts`) to `test-transcripts/.forum-fixture`.
- `common/social/__fixtures__/fakeForumThread.ts`: a synthetic thread that grows, loses posts and writes its pages.
-
-## Files
-
-`common/lib/forumWalk.ts` (+ test), `common/social/xenforoFetcher.ts` (+ test), `common/social/forumFixtureLoader.ts`,
-`common/social/__fixtures__/fakeForumThread.ts`, `common/controller/fetchPosts.ts` (`fetchTimeline`, the retry loop,
-`sleepOrStop`), `common/controller/fetchForumPosts.test.ts`, `common/social/fetchers.ts` (additive:
-`PostFetchInput.forumWalk`, the checkpoint's `forumWalk`, `PostFetchResult.{forumWalk, block, notSeen}`),
-`common/lib/posts-server.ts` (`PostFetchState.forum`; `upsertPosts`/`supersedesPost` `ignorePosition`),
-`common/social/xCookieSource.ts` + `common/lib/settingsSchema.ts` + `settingsDocs.ts` (`social.xenforo`),
-`common/lib/envVars.ts`, `common/bin/fetch-posts.ts`, `common/bin/archilyzer.ts`, `scripts/archilyzer-ops.mjs`,
-`editor/app/channels/[slug]/{socialActions.ts, page.tsx, components/SocialChannelPanel.tsx}`,
-`editor/app/api/ops/fetch-posts/route.ts`, `editor/app/jobs/jobReplayRegistry.ts`,
-`editor/e2e/servers.ts` + `editor/playwright.config.ts`,
-`editor/e2e/forum-resume.spec.ts`; docs OPERATING.md, COMMANDS.md, SETTINGS.md, settings.json.example,
-ENVIRONMENT.md, FACTS ("Release 37 lane G"), CHANGELOG.
-
-## Interfaces
-
-- `ForumWalkState`, `deriveForumWalk`, `heldBand`, `forumWalkStartLine`, `describeForumWalk`,
- `meanPagePauseSeconds`, `roughDuration`, `FORUM_HISTORY_OVERLAP`, `FORUM_DEFAULT_PAGE_PAUSE_SECONDS`,
- `FORUM_MIN_PAGE_PAUSE_SECONDS`, `RetryOnBlock`, `retryOnBlockProblem`, `parseRetryOnBlock`,
- `describeRetryOnBlock`, `RETRY_MIN_MINUTES`/`RETRY_MAX_MINUTES`/`RETRY_MAX_TRIES` (lib/forumWalk.ts).
-- `fetchPosts({…, retryOnBlock?, sleep?})` → `FetchPostsResult.{updated?, block?}`; `sleepOrStop`,
- `RETRY_AND_OLDER_REFUSAL` (controller/fetchPosts.ts).
-- `fetchPostsAction(…, from?, retryOnBlock?: RetryOnBlock | "settings")`, `setForumRetryOnBlockAction(retry | null)`.
-- `fixtureForumLoader`, `forumFixtureDir`; `FakeForumThread`, `FAKE_THREAD_ID`.
-
-## Gates
-
-All through the session lock (`r31-locked.sh` / `r31-locked6.sh`), from the worktree root.
-
-| Gate | Base (main b8458892) | Branch (after merging main 1f440480) |
-|---|---|---|
-| `pnpm -r exec tsc --noEmit` | clean | clean (at 75482416, 8f63b988, 6cec4dd0) |
-| common `pnpm --filter yt-dlp-transcript-common test` | 4764 tests | 4821 tests, 4819 pass, 0 fail, 2 skipped (at 8f63b988; main's lanes B+E add their own) |
-| lane G unit files (xenforoFetcher, forumWalk, fetchForumPosts, envVars, settingsSchema, settingsDocs) | — | 80/80 |
-| editor `pnpm --filter editor test` | 356 | 357/357 |
-| mcp `pnpm --filter yt-dlp-transcript-mcp test` | — | 379/379 |
-| `pnpm run test:scripts` | 1316 (1312 pass, 4 skipped) | 1317 (1313 pass, 0 fail, 4 skipped) |
-| `docs env / cli / files --check`, `settings example --check` | — | all 0 (ENVIRONMENT.md, COMMANDS.md, SETTINGS.md regenerated; settings.json.example unchanged) |
-| e2e `forum-resume.spec.ts` + `social-channel.spec.ts` (start mode, build 43 s) | — | 7 passed, 0 failed, 1.8 min (run 3; run 1 failed on a getByLabel substring match, run 2 on Turn off not removing the key — both fixed) |
-
-New tests: `lib/forumWalk.test.ts` (5), `controller/fetchForumPosts.test.ts` (6, through the real fetcher over saved
-pages), `social/xenforoFetcher.test.ts` +7 (capped catch-up keeps history, drift reaches page 1 with no gap, all-held
-pages uncounted, a lost position heals, the mark stops the catch-up, empty page reloaded once / after a check, full
-re-walk hands archived posts back and counts `notSeen`), `e2e/forum-resume.spec.ts` (the two buttons, the confirm,
-the status line, Retry after a block).
-
-## Decisions
-
-- **The derived history start is `band.low + 1`, not `lowest − 2`.** Drift only moves posts to LOWER page numbers
- (a deletion shifts every later post back), so the unread posts below a page read earlier are still on pages ≤ the
- page below it. Starting at `lowest − 2` skips page `lowest − 1` outright when nothing was deleted — a gap. Starting
- `OVERLAP − 1` pages above the band's foot re-reads one or two held pages (all held, uncounted) and can never step
- over an unread page. `min(stored, …)` keeps an honest stored position.
-- **The band is contiguous from the top** (no holes tolerated): an article thread's starter (stored with page 1)
- or a range imported from saved pages far below would otherwise pull the history start down past pages never
- read. A drift hole only makes the derived start higher — more uncounted re-reading, never a gap.
-- **A mark and a catch-up position**, beyond the brief's list: without `catchUpPage`, a capped catch-up leaves the
- band between its foot and the old top owed, and the next catch-up (stopping at any archived post) would skip it;
- with the mark alone, every capped run re-reads the partial top band. Both are additive keys.
-- **All-held pages are uncounted in the catch-up too** (one rule): a 1-page run whose last page holds nothing new
- reads its one counted page from the history.
-- **Full re-walk is not resumable as such**: interrupted, its positions say what it covered (mark at its top,
- `historyPage = min(stored, next)`), and Fetch posts continues from there.
-- **Deletions are counted, not marked**: a page the parser misread would otherwise mark live posts deleted.
-- **`max` is tries in all** (so "try 2/12" is the first retry); minutes ≥ 5.
-- **Retry only from the button and explicit callers**: the scheduler's fetch never waits hours on a lane.
-- **The e2e reads a saved-pages directory through an env seam** rather than a browser at an `.example` host.
-
-## Live migration (kf-oney-thread)
-
-State at 2026-10-20 (orchestrator's notes): `{"cursor":"2280","lastError":null}`, then — after the live run stopped
-on the empty page after a browser check (item 6) — `{"cursor":"2193"}`, later `{"cursor":"2143"}` and moving down; posts holding `forum.page` contiguously
-down to ~2194, the thread's last page ~2606. The first fetch after the restart: `deriveForumWalk` reads `cursor
-2193` as the history position ("Read the old single resume point (page 2193) as the history position."), checks it
-against the band (foot ~2194 → at most 2195): it stays 2193 (or heals down to `foot + 1` were the cursor above). No mark yet, so the catch-up runs from ~2602 down to the first page holding any archived post (as before),
-sets the mark to the newest post read, then jumps to page 2280 and continues the history. The state written has
-`forum` and no `cursor`. Nothing on disk needs changing by hand.
diff --git a/plans/release-37/live.md b/plans/release-37/live.md
@@ -1,128 +0,0 @@
-# Release 37 lane E — `r37/live`: liveness and saving what is still up (as shipped)
-
-The plan of record is [`wayback-pages.md`](wayback-pages.md) ("S5"). A page record (lane A) is a capture of a page;
-this lane answers whether the page's ORIGINAL is still up — when it is not, the Wayback copy is the only copy — asks
-the Wayback Machine to capture a page that is still up (Save Page Now), and teaches find-copy to find a copy of a
-gone page a report cites. Rulings followed: no model anywhere; every operation has a button (Check originals, Ask the
-Wayback Machine to capture this now, Capture now per live record) and an ops action; every archive.org request goes
-through the polite Wayback client on the `platform:archive.org` queue, every original-site request through the
-editor's web pacer — never a burst, never the Wayback Machine for liveness; synthetic fixtures only (the fake
-Wayback's new SPN block, stub original sites); the S3 keys are never a setting value, never logged; commits end with
-the one Co-Authored-By trailer.
-
-## What
-
-1. **Availability of a page record = its original URL's** (`controller/checkPageAvailability.ts`, reached from
- `checkPostAvailability` for a Wayback pages channel). One request per distinct original URL (a split capture's
- records and a page's versions share it), every record of it gets the verdict; `limit` counts URLs; `stale` orders
- by the oldest check among a URL's records. The request (`lib/waybackPages/liveness-server.ts`
- `checkOriginalUrl`): through `webPacer`, the web fetch's fence on every hop, HEAD with redirects followed by hand
- (≤ 5), a GET when the HEAD is refused (403/405/501) or the platform has a "gone" page (body to 256 KB). The verdict
- (`lib/waybackPages/liveness.ts`): `deleted` (404/410, or a `PAGE_GONE_MARKERS` row — X's "This account doesn't
- exist" / "this page doesn't exist", Tumblr's "There's nothing here", Google Docs' "Sorry, the file you have
- requested does not exist", YouTube's "This channel does not exist"), `account_unavailable` (X suspended, a Doc
- not shared, a terminated YouTube account), `available` (2xx after redirects on the same site), `error` otherwise
- with the status. Stored in `posts-availability.json` with the answer's `status` and `reason` (additive fields);
- the index's `isDeleted` follows as for any post. The channel page's **Originals** (Check originals, "N of M
- original URLs checked · K gone", the gone table with "the only copy" → the Wayback copy); ops
- `check-post-availability` (new door, any posts channel); the CLI `archilyzer posts check` reaches the same branch.
-2. **Save Page Now** (`controller/savePageNow.ts`, `lib/waybackPages/savePageNow{,-server}.ts`): job kind
- `save-page-now` on `platform:archive.org`: SPN2 `POST /save` (`url`, `capture_outlinks=0`, `Authorization: LOW
- <access>:<secret>`), status polled every 10 s (≤ 30), then with a slug an `import-page` job of the capture
- (`startImportPageJob`). Keys: `ARCHIVE_ORG_S3_ACCESS` + `ARCHIVE_ORG_S3_SECRET` in the environment, else the
- mode-600 file the new setting `archiveOrg.s3KeyFile` names (default `~/.config/archilyzer/archive-org.env`);
- refused when others can read it; a settings value that is not a path is refused (also by `/api/ops/settings`,
- without echoing it); `redactSpnKeys` over every log line and error. Refused before any request: no keys (the
- button is off with that sentence), not http(s), a Wayback URL, not a pages channel, a video, X while private.
- Requests through `WaybackClient.send` → `ArchiveOrgClient.send` (new: any method, same chain, gap and retry; a
- non-retryable status handed back with its body). UI: the channel page's **Save Page Now** field ("Ask the Wayback
- Machine to capture this now", also the plain field for a scan target's URL) and **Capture now** on each record
- whose original answered. Ops `save-page-now {url, slug?, dryRun?}`. Lane B's door: `startSavePageNowJob({url,
- slug?})`.
-3. **find-copy, page mode** (`publish/findCopyPages.ts`; ops `find-copy` with `"pages": true`, `channel?`, `max?`,
- `dryRun?`; one `find-copy` job on `platform:archive.org`): every `page` citation (grouped by URL) whose original is
- gone → the channel named or the one whose targets cover it (`targetCoversUrl`) → held (a record of the URL is
- already there) or the capture nearest the citation's date (`captureAtOf`: its date, else its archiveUrl's
- timestamp, else today) via ONE `closestCapture`, imported inline (`importPage`); a cited page record whose
- original is gone: held when its capture is stored, else imported again. Live pages are left ("save it now"), an
- uncovered page is `no-channel`, a never-captured one `none-found`, a check that failed `error`. Each item names
- `pointTo` (the record whose text holds the quote, else the first) and `as` (the page citation as a post
- citation). Dry run: the same paced questions, nothing imported.
-4. **The fake** (`testing/web/fakeWayback.mjs`, its own block): SPN `POST /save` and `GET /save/status/<id>`
- (pending → success, 401 on wrong keys, 429s, refused and failed URLs), the saved page served raw afterwards,
- `wb.spnForms` / `wb.spnCaptures`, `requests[].method`.
-
-## Interfaces
-
-- `lib/waybackPages/liveness.ts`: `PAGE_GONE_MARKERS`, `pageGoneMarker`, `hasGoneMarkers`, `foldPageText`,
- `classifyOriginalAnswer`, `sameSite`, `siteOf`, `bareHost`, `groupByOriginalUrl`, `OriginalCheck`,
- `PAGE_ORIGINAL_GONE_LABEL`. `liveness-server.ts`: `checkOriginalUrl(url, {pacer?, resolve?, allowPrivate?,
- signal?})`, `LIVENESS_MAX_BODY_BYTES`.
-- `controller/checkPageAvailability.ts`: `checkPageAvailability`, `selectUrlsToCheck`.
- `CheckPostAvailabilityOptions.pageCheck?` (tests).
-- `posts.ts` `PostAvailabilityRecord.status?` / `reason?`; `posts-server.ts` `mergePostAvailability(…, details?)`.
-- `lib/waybackPages/savePageNow.ts`: `SPN_SAVE_URL`, `spnStatusUrl`, `spnSaveBody`, `spnAuthorization`,
- `parseSpnSubmit`, `parseSpnStatus`, `spnOffSentence`, `SpnKeys`. `savePageNow-server.ts`: `readSpnKeys`,
- `redactSpnKeys`.
-- `controller/savePageNow.ts`: `planSavePageNow`, `savePageNow`, `queueSavePageNow`, **`startSavePageNowJob({url,
- slug?, requestedBy?, paths?}) → {jobId}`** (throws `SavePageNowRefusal`), `savePageNowAvailability()`,
- `SAVE_PAGE_NOW_JOB_KIND`, `SAVE_PAGE_NOW_RESULT_MARKER`, `SPN_POLL_MS`, `SPN_MAX_POLLS`.
-- `ArchiveOrgClient.send`, `WaybackClient.send`. `archiveOrgTorrent.ts`: `ArchiveOrgFetchSettings.s3KeyFile`,
- `DEFAULT_ARCHIVE_ORG_S3_KEY_FILE`, `looksLikeS3Key`.
-- `publish/findCopyPages.ts`: `findPageCopies`, `citedPages`, `captureAtOf`, `targetCoversUrl`, `channelsCovering`,
- `recordForQuote`, `pageCitationAsPost`, `defaultFindPageCopiesDeps`, `FIND_PAGE_COPY_DEFAULT_MAX`,
- `FIND_PAGE_COPY_MAX_LIMIT`.
-- Routes `POST /api/ops/check-post-availability {slug, mode?, limit?}`, `POST /api/ops/save-page-now {url, slug?,
- dryRun?}`, `POST /api/ops/find-copy {…, pages: true, channel?, max?, dryRun?}`. Actions
- `editor/app/channels/[slug]/waybackLiveActions.ts`. Component `components/WaybackLivePanel.tsx` (state from
- `waybackLiveState.ts`).
-
-## Files
-
-common: `lib/waybackPages/{liveness,liveness-server,savePageNow,savePageNow-server}.ts` (+ `liveness.test.ts`),
-`controller/{checkPageAvailability,savePageNow}.ts` (+ tests), `controller/checkPostAvailability.ts` (one branch),
-`publish/findCopyPages.ts` (+ test), `lib/posts.ts`, `lib/posts-server.ts`, `lib/archiveOrgClient.ts`,
-`lib/waybackClient.ts`, `lib/archiveOrgTorrent.ts`, `lib/settingsSchema.ts`, `lib/envVars.ts`, `jobs/jobKinds.ts`,
-`bin/archilyzer.ts` (one description), `testing/web/fakeWayback.{mjs,d.mts}`, `testing/README.md`. editor:
-`app/channels/[slug]/{page.tsx, waybackLiveActions.ts, waybackLiveState.ts, components/WaybackLivePanel.tsx}`,
-`app/api/ops/{check-post-availability,save-page-now}/route.ts`, `app/api/ops/find-copy/route.ts`,
-`app/api/ops/settings/route.ts`, `e2e/wayback-live.spec.ts`, `CHANGELOG.md`. scripts: `archilyzer-ops.mjs` (+
-test). Docs: OPERATING.md, COMMANDS.md, SETTINGS.md, ENVIRONMENT.md (regenerated), plans/FACTS.md.
-
-## Commits
-
-| sha | what |
-|---|---|
-| `442129c2` | the common half: liveness (markers, verdicts, the request), the pages branch of check-post-availability, Save Page Now (keys, client send, job), find-copy's page mode, the fake's SPN block, ops actions, generated docs |
-| `fbd569ae` | the editor half: the channel page's Originals and Save Page Now, the ops routes (check-post-availability, save-page-now, find-copy pages, the settings refusal), e2e spec |
-| (this) | the record, FACTS, OPERATING |
-
-Branched from main at d261ab33; main (14947e67, lane B) merged in before the first commit (three keep-both
-conflicts: OPERATING.md, fakeWayback.mjs/.d.mts).
-
-## Gates
-
-All through the session's locks, from the worktree root.
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean on the merged tree before the commits.
-- common: start (d261ab33) **4764 / 4762 pass / 0 fail / 2 skipped**; after (on 14947e67 + this lane) **4805 /
- 4803 / 0 / 2** (+18 of this lane: liveness 7, checkPageAvailability 3, savePageNow 5, findCopyPages 3; the rest
- lane B's).
-- editor unit: 356 → **357 / 357** (lane B's +1; none of this lane's).
-- test:scripts: 1316 (1312 + 4 skipped) → **1317: 1313 pass / 0 fail / 4 skipped** (+1: the ops actions' usage).
-- Docs: `docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check`: all 0
- (COMMANDS.md, ENVIRONMENT.md, SETTINGS.md, settings.json.example regenerated).
-- e2e (editor, start mode, stamp `131742a50d76` at `fbd569ae`; the build 1116 s in the heavy slot):
- `wayback-live.spec.ts` + `wayback-pages.spec.ts` **2 / 2 passed** (58.5 s; 25.6 s + 14.2 s).
-
-## Rulings followed / decisions
-
-- Liveness never asks the Wayback Machine, and an `error` is never a deletion (a 403 wall, a 5xx, a redirect to
- another site, a DNS failure, the fence).
-- A suspended account / an unshared document is `account_unavailable` (the enum's "may reverse"), not `deleted`.
-- The S3 keys follow the Claude API key's pattern: environment first, else a mode-600 file whose PATH is the setting.
-- SPN captures the page alone (`capture_outlinks=0`); the import is its own `import-page` job queued behind.
-- find-copy's page mode imports inline (its job is on the archive.org queue) and does NOT rewrite the report: it
- answers `pointTo` / `as`; rewriting a citation (with its fallback) is the report editor's (lane D).
-- The availability check of a pages channel runs on the channel's own queue (`platform:webpage`), not archive.org's
- (it never asks archive.org).
diff --git a/plans/release-37/scan.md b/plans/release-37/scan.md
@@ -1,83 +0,0 @@
-# Release 37 lane B `r37/scan` (S2: scan and choose) — as shipped
-
-Plan of record: `plans/release-37/wayback-pages.md`, "What a channel is" and "S2". The brief's decisions held: a
-scan never fetches a body; `collapse=digest` by default; no model anywhere.
-
-## What
-
-- **`wayback-scan {slug, dryRun?, maxRows?, full?}`** (`common/controller/waybackScan.ts`): every target of
- `config.wayback.targets` listed through the CDX API — matchType per target, status 200, the target's mimes
- (text/html by default), collapse=digest, the date bounds, `fl` of five columns, pages of 5,000 with
- `showResumeKey`, at most `maxRows` (50,000; ceiling 200,000) rows and 100 requests a run — through the Wayback
- client's paced chain (new `WaybackClient.cdxPage`). A run cut short (row cap, refusal, drain, cancel) keeps each
- target's resume key; once all are complete the next run is a new pass asking from 30 days before the last pass
- began; `full` is a new pass from each target's start. A refusal stops the job (failed, with the reason) and keeps
- what it wrote. A dry run asks nothing and logs each target's next request. A job kind on `platform:archive.org`
- (`WAYBACK_QUEUE`), drainable, `needsText`, not ingest. Ops action, `archilyzer wayback scan <slug>` CLI.
-- **`channels/<slug>/wayback-scan.json`** (`common/lib/waybackPages/scanFile.ts` + `scanFile-server.ts`): per target
- state, one row per distinct (URL, digest) with first/last seen, count, the pass that first listed it; summaries by
- year and by one-/two-segment path prefix. Written compact and atomic after every page. Imported state derived
- (`imported.ts`) from the channel's webpage records.
-- **Targets reader** (`common/lib/waybackPages/targets.ts`): the brief's narrow, tolerant parser of `config.wayback`
- (raw config.json until A's schema lands), the target key, the CDX `url`/mime filter, the asset/include/exclude
- rules.
-- **Captures tab** (`editor/app/channels/[slug]/captures/`): Overview | Captures on a Wayback pages channel
- (`ChannelTabs captures`, the layout reads the raw config). Status line, targets, Scan now / Continue scan
- (`StreamActionLog`), the last scan's job linked, the table (path, first/last seen, version i of n, imported mark
- linking the record's capture, new), server-side filters (year, path prefix, text, show) and pagination (100 a page),
- per-page selection, Import selected, Import all in range (inline confirm above 50), the result line.
-- **Imports from the scan** (`common/controller/waybackImport.ts`): one `import-page` job per row through S1's
- `startImportPageJob` (the capture the content was first listed at), imported rows skipped, ≤ 500 a call;
- `wayback-import` ops action. (Before A merged, a seam stood in; removed at the merge.)
-- **`wayback.auto`** (`common/controller/laneWaybackAuto.ts` + one pre-pick block and one run branch in
- `autoRunner.ts`): the download lane's channel-scoped unit after the metadata scan — an opted-in channel's rows
- listed after its first pass and not imported, one import-page job per unit on the `archive.org` platform slot,
- waited on via `onJobEnd`. `auto` is a key of A's `wayback` schema entry (CHANNEL.md); the channel form carries it
- (`waybackAuto`) and keeps each target's mime/include/exclude through a save; the Captures tab has the toggle.
-- **Fake + e2e**: `fakeWayback.mjs` scan listing in its own block (matchType, from/to, filters, collapse, fl, limit,
- resume keys, `scanRefuseFrom`, `SCAN_CAPTURES`; its plain CDX answer carries a capture's own digest); the scan's
- URLs on `WAYBACK_ORIGIN`, sent to the fake by S1's process client (`E2E_WAYBACK_ORIGIN_FILE`);
- `editor/e2e/wayback-captures.spec.ts` (real import-page jobs since the merge).
-- **Where the tab lives**: Wayback pages channels are the one kind of posts channel with ChannelTabs (Overview |
- Captures); S1's Wayback pages panel links "Captures: scan and choose".
-- **Docs**: OPERATING.md "Wayback pages: scan, then choose", COMMANDS.md, ENVIRONMENT.md (two test env vars), FACTS
- "Release 37 S2", CHANGELOG.
-
-## Commits
-
-| sha | what |
-|---|---|
-| `1f31f765` | the scan: CDX over the targets, paged and resumable, wayback-scan.json, the fake's scan listing, the job kind |
-| `39877e0d` | the Captures tab, import selected / all in range (seam), wayback.auto in the download lane, ops + CLI |
-| `47b54f68` | the e2e spec, its fake origin and seam, docs |
-| `9082180c` | the two e2e variables in the editor's playwright config; this record (draft) |
-| `b775e7c9` | merge main (lane C's extractors) |
-| `c38da131` | scanView client-safe |
-| `68f24a77` | record: commits and gates before A |
-| `e88b5689` | merge main (lane A) + the post-A wiring: real import-page, schema `auto`, form field, toggle, panel link, tests |
-| (next) | the toggle shows its state at once; this record |
-
-## Gates
-
-- tsc, the whole workspace: clean (after the merge of main).
-- common: 4695 at the branch start (1 failure in a run that raced the lane's first edits, not reproduced) → 4717
- (+22, my one failure the playwright-config declaration, fixed) → 4751/4749 pass, 0 fail, 2 skipped after merging
- main (lane C's tests included).
-- editor unit: 353/353 → 353/353.
-- test:scripts: 1315 (1311 pass, 4 skipped) → 1315 (1311, 4).
-- docs: `docs env` regenerated (ENVIRONMENT.md), `docs cli` regenerated (COMMANDS.md); `docs env|files|cli --check`
- and `settings example --check` clean.
-- e2e before A: `wayback-captures.spec.ts` 1/1 (20.1 s wall, after an 87 s stamped build); `navigation.spec.ts` 5/5
- (17.0 s) as a neighbour check of the tab change.
-- After merging lane A (main d261ab33): tsc clean; common 4787 / 4785 pass / 0 fail / 2 skipped; editor unit 357/357
- (+4: A's and the form test keeping `auto`); test:scripts 1316 (1312 + 4 skipped); docs env/files/cli and settings
- `--check` clean (CHANNEL.md, ENVIRONMENT.md, COMMANDS.md regenerated); e2e `wayback-captures.spec.ts` +
- `wayback-pages.spec.ts` 2/2 (35.0 s; the first run failed on the toggle — a controlled checkbox waiting for the
- refresh — fixed with local state). A second neighbour run (navigation + channel-rename) never got the heavy slot in
- two 10-minute tries and was not run; the full suite is the orchestrator's.
-
-## Rulings followed
-
-- Corpus read-only; synthetic fixtures only; no real network in any test.
-- Every heavy step through the session lock.
-- No Claude-Session trailer.
diff --git a/plans/release-38/video-assist.md b/plans/release-38/video-assist.md
@@ -1,168 +0,0 @@
-# Release 38 lane E — `r38/video-assist`: the local video assistant (as shipped)
-
-The operator, 2026-10-20: "A feature to iterate on the video with hyperframes using qwen, such that I can request
-little things like changing transition time on local AI even when Claude Code is not available." This lane makes a
-request in words ("make the joins 0.15 s with less smear") a set of checked, proposed edits of a video project that
-the operator applies with a click — on the local model by default. Rulings followed: every model step optional and
-routed by `settings.generation` (local / api / code); every op the assistant can propose is also a field (the Look
-panel's slide and room numbers are new); nothing is applied without the operator's Apply, and Apply writes through
-the manifest's own writers, token-guarded; never free HTML, never a raw manifest write; synthetic fixtures only; no
-real network or model call in any test.
-
-## What
-
-1. **The look's rules moved to common** (`common/lib/report/look.mjs`, + `.d.mts`): `LOOK_KEYS`, `applyLookPatch`
- (the body of umtool's `updateRender`, now pure), `lookErrors`, `lookOf`, and the validators and bounds that lived in
- report-to-video (`validateTransitionStyle`/`validateSlide`, `validateRoom`/`clipRoom`/`roomOn`,
- `validateCaptions`/`validateLoudness`/`verticalErrors`/`validateVertical`/`validateLook`; `SLIDE_BOUNDS` and
- `ROOM_BOUNDS` exported). `report-to-video/{look,room,transition}.mjs` re-export every moved name; `updateRender`
- calls `applyLookPatch`. Moved, not copied — the editor's task checks a look op with the writer's own function.
-2. **Declared composition params** (`common/lib/report/fxParams.mjs`): `COMPOSITION_PARAMS` for `deck`, `stats` and
- each `fx.<effect>` — timings, sizes, positions, toggles, the odometer's label — each with the bounds its validator
- holds it to; `DECK_PARAMS` / `STATS_PARAMS` / `FX_PARAMS` re-exported by `deck.mjs` / `stats.mjs` / `fx.mjs`;
- `fx-params.test.mjs` holds every declaration to `validateChrome` at both bounds and just past them.
-3. **The ops** (`common/lib/report/videoAssistOps.mjs`, extending nothing: its own module, `.mjs` so umtool's plain-node
- libs and the editor's TS both import it): `look`, `slide`, `room`, `clip_edges`, `clip_room`, `fx`, each checked
- against the manifest as the ops before it left it, each with a diff line and the writer that performs it
- (`checkAssistOps`); the model's one shape `{op, id, key, value}` (`ASSIST_OPS_SCHEMA`, four required keys — a strict
- API tool requires every key) normalised to the checker's; `assistView` — the compact view trimmed to a budget, the
- clips the request names first; `secondsNamedIn` (the 3 s slack widens to what the request names).
-4. **The proposals file** (`common/lib/report/videoAssistProposals.mjs`): `<project>/assist-proposals.json`
- `{version, promptVersion, at, model, request, scope, note?, reply?, ops[{id, op, diff, warning?, status}],
- refused[{op, why}], diff[]}` — written whole by the task, its statuses marked by umtool.
-5. **Task `video-assist`** (`GENERATION_TASKS`; local in every preset but `api`, the `code` preset included; field
- docs; MCP `GENERATE_TASKS` derived): `common/lib/report/draft/tasks/videoAssist.ts` (one schema-bound ask, local
- fitted to the prompt cap by `fitLocalAsk`, the API the same ask; the code route's `answers` read as a model's;
- the ops checked against the manifest as it is after the answer; proposals written; never applied) and
- `common/controller/videoAssist.ts` (its own `report-draft` job: `draft:local` through the GPU arbiter — the log and
- the box say it waits for a transcription — ollama unloaded after; `draft:api` with the narration and daily caps and
- a ledger row; `note`: a whole-project note's text is the request, the proposals posted back to it as the agent's
- reply with `proposal {kind: "assist", at, ops}`). `reportDraft.ts` parses `request` / `scope` (and shares
- `project` / `note` / `answers` with clips-suggest); the ops route's `dryRun` answers `planVideoAssistJob`.
-6. **MCP** (`mcp/src/generation.ts`): `generate` takes `task: "video-assist"` with `project` and `request` | `note`,
- `scope`; routed to code it returns the editor's plan as this session's request and takes `answers` back;
- `/gen` (`.claude/commands/gen.md`) says so.
-7. **umtool**: `lib/report/videoAssist.mjs` (the request, the followed job, `proposalsView` — each waiting op
- re-checked, "now: …" when the manifest no longer allows it — `applyAssistOps` and `dismissAssistOps`);
- `/api/report/video-assist` (GET view / job; POST ask, `action: "apply"` (token, ids, `at`) under `withEditNotes`,
- `action: "dismiss"`, cancel); `components/projects/report/AssistBox.tsx` — the Ask box (status line: the route, the
- GPU wait, or why not), the diff list with **Apply** / **Apply all** / **Dismiss**, applied and refused marked,
- **Preview join**, and **Notes on the project** with **Ask the assistant** and the reply's **Apply all**; in the
- Look panel (scope all, with the preview and the notes) and the clip editor's side column (a request naming no clip
- is sent as about the selected one). `ReplyProposal` gains `kind: "assist"` (`lib/annotations/shape.mjs`,
- `types.ts`); the clip editor never applies one.
-8. **The Look panel's owed fields**: the blur slide's **Travel**, **Smear**, **Grain** (shown for a blur slide), and
- with the tail on **Tail up to, s** (`room.maxS`) and **Silence gap, s** (`room.minGap`) — written only off their
- defaults.
-9. **Preview join**: `build-video.mjs --join-preview [--join-from <clip>]` (`report-to-video/join-preview.mjs`
- `joinPreviewTimeline`: four consecutive clips, the last 3 s of each cut — the last clip its first 3 s — cards out,
- windows untouched) → `out/join-preview.mp4` + `out/join-preview.json`, its own work dir, no chapters / YouTube text
- / thumbnail, in the heavy slot; umtool `lib/report/joinPreview.mjs` + `/api/report/join-preview` (a job on the
- app's runner), played under the box, marked stale when the look changed.
-10. **revise-video** gains `look` / `slide` / `room` (`videoOps.ts` through `checkAssistOps`, scope look;
- `VIDEO_OPS_SCHEMA`; `localOpsBatch` takes the schema) — the article path keeps its iteration model.
-
-## Files
-
-common: `lib/report/look.mjs` + `.d.mts` (new), `lib/report/fxParams.mjs` + `.d.mts` (new),
-`lib/report/videoAssistOps.mjs` + `.d.mts` (new), `lib/report/videoAssistProposals.mjs` + `.d.mts` (new),
-`lib/report/videoAssistOps.test.ts` (new), `lib/report/draft/tasks/videoAssist.ts` + `.test.ts` (new),
-`lib/report/draft/videoOps.ts`, `lib/report/draft/tasks/revise-video.ts`, `lib/report/draft/tasks/revise-report.ts`
-(`localOpsBatch` schema), `controller/videoAssist.ts` (new), `controller/reportDraft.ts`, `lib/generationSettings.ts`
-+ `.test.ts`, `testing/clips/assistProject.mjs` + `.d.mts` (new), `testing/README.md`, `package.json` (exports).
-editor: `app/api/ops/report-draft/route.ts`, `app/api/ops/_videoAssist.test.ts` (new), `CHANGELOG.md`. mcp:
-`src/generation.ts`, `src/generation.test.ts`. report-to-video: `look.mjs`, `room.mjs`, `transition.mjs` (re-exports),
-`deck.mjs`, `stats.mjs`, `fx.mjs` (params slices), `join-preview.mjs` + `.test.mjs` (new), `fx-params.test.mjs` (new),
-`build-video.mjs` (`--join-preview`), `package.json` (`./join-preview`). umtool: `lib/report/manifest.mjs`
-(`updateRender` over `applyLookPatch`), `lib/report/videoAssist.mjs` + `.test.mjs` (new), `lib/report/joinPreview.mjs`
-(new), `app/api/report/video-assist/route.ts` (new), `app/api/report/join-preview/route.ts` (new),
-`components/projects/report/AssistBox.tsx` (new), `components/projects/report/LookPanel.tsx`,
-`components/projects/review/ClipEditor.tsx`, `components/projects/review/ClipSuggest.tsx`,
-`lib/annotations/shape.mjs`, `lib/annotations/types.ts`, `lib/create/policy.mjs`, `e2e/video-assist.spec.ts` (new),
-`e2e/fixtures/video-assist-fixture.mjs` (new), `e2e/fixtures/make-fixture.mjs`, `e2e/fixtures/editor-stub.mjs`,
-`docs/report-video.md`. Root: `.claude/commands/gen.md`, `OPERATING.md`, `SETTINGS.md`, `settings.json.example` (regenerated),
-`plans/FACTS.md` ("Release 38 lane E").
-
-## Commits
-
-| sha | what |
-|---|---|
-| `e4542507` | common: the look's rules move to common/lib/report/look.mjs; compositions declare their tunable params (+ fx-params.test.mjs) |
-| `f9662056` | common: task video-assist — the ops, the proposals file, the task and its job, reportDraft, generation settings, the editor's dry run; the test kit's project and 29-request table; tests |
-| `5e9936d3` | common: revise-video takes the look ops (look, slide, room) |
-| `53fab519` | mcp: generate video-assist (project + request / note; the code route's request and answers); /gen |
-| `30bdc4bb` | umtool: the Ask box, Apply / Apply all / Dismiss, Preview join (build-video --join-preview), the Look panel's slide and room fields, notes' assist proposal; e2e video-assist.spec.ts; docs |
-| `276f002a` | plans: FACTS ("Release 38 lane E"); CHANGELOG |
-| `d3e009c1` | common: videoOps' refusal names the look ops (an existing test's expectation) |
-| `dd5f4237` | docs: the video-assist dry run in OPERATING's recipes; the ops syntax in umtool's docs |
-| (this commit) | plans: this record |
-
-## Gates
-
-All through the session's lock (`r31-locked.sh`; the e2e through `r31-locked6.sh`), from the worktree root. The
-machine sat under the lock's memory floor for most of the afternoon (available memory 0.7–3 GB while other lanes and a
-transcription ran), so the runs were queued detached and waited on in short loops.
-
-- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean before the commits (one umtool error —
- `dismissAssistOps`' untyped options — fixed first; umtool re-checked clean).
-- common: 4764 (4762 pass, 2 skipped; measured at the branch's start) → **4784 / 4782 pass / 0 fail / 2 skipped**
- (+20: videoAssistOps 12, the task 6, generation settings 1, videoOps 1).
-- editor unit: 356 → **361: 360 pass, 1 fail** — the one is `remote-listing/route.test.ts` ("a listing is a job whose
- last line is the diff…": the log read before its `@@remote-listing` line landed, under the machine's load; not this
- lane's code); that file alone afterwards **2 / 2 pass**. +5: `_videoAssist.test.ts`.
-- mcp: 379 (release 37's record) → **380 / 380** (+1: generate video-assist).
-- test:scripts: 1316 (1312 pass, 4 skipped; release 37's record) → **1326 / 1322 pass / 0 fail / 4 skipped** (+10:
- fx-params 3, join-preview 2, umtool videoAssist 5).
-- umtool unit (`pnpm --filter umtool test`): **45 / 45** (none of this lane's tests are there: umtool's `.mjs` tests run
- in test:scripts).
-- Docs: `docs env --check` 0, `docs files --check` 0, `docs cli --check` 0, `settings example --check` 0 (after
- `docs files` and `settings example` regenerated SETTINGS.md and settings.json.example for the new route).
-- e2e (umtool, `pnpm --filter umtool run e2e video-assist.spec.ts clip-look.spec.ts`, prebuild stamped
- `93df78d7b655` at `d3e009c1`): **2 / 2 passed** (35 s; video-assist 13.6 s, clip-look — the Look panel's existing
- spec, a short rendered — 6.9 s), first run.
-
-## Decisions
-
-- **One module of its own** for the ops (`common/lib/report/videoAssistOps.mjs`, not an extension of `videoOps.ts`):
- plain ESM so umtool's node libs (Apply) and the editor's TS task import the same checker; `videoOps.ts` calls it for
- revise-video's look ops.
-- **The look's validators MOVED to common** (re-exported by report-to-video), not copied: the editor cannot import
- umtool, and the brief's "the SAME validators updateRender uses" leaves no other honest way.
-- **The composition params are declared in common** (`fxParams.mjs`) and re-exported by `deck.mjs` / `stats.mjs` /
- `fx.mjs` as their slices — the editor needs them too; a drift test holds each declaration to `validateChrome`. The
- layout-coupled settings (deck height, footage scale, QR size, pip sizes) are not declared; `validateChrome` still
- has the last word at Apply. An `fx` op only tunes a composition the cut already draws (it never turns one on).
-- **The model's op shape is `{op, id, key, value}`** (four required keys): the default API model is a strict tool
- user, where every schema key is required — a flat schema of every op's fields would force junk into each op.
-- **"≤ 3 s from current unless the request says more"**: the step widens to the largest number of seconds the
- request names ("6 seconds", "2.5 s"); a bare number ("start at 516") does not widen it.
-- **A clip's source window**: its extent (start–end) when it has a cut; else its edges ± `render.fetchPad` (0 when the
- cut sets none).
-- **"room tail 2"** is `{tail: true, maxS: 2}`: a room edge is a boolean, `maxS` is its seconds; a number for the
- tail turns it on up to that, and a number alone (maxS / minGap) on a cut with no room turns the tail on with it.
-- **The `code` preset routes `video-assist` local** (the brief: local in every preset but `api`); its field doc and
- the preset's doc say so.
-- **Scope**: both Ask boxes ask with `all`; the clip editor's box sends a request that names no clip as about the
- selected one ("… (on clip r002)"). `scope` stays a body field for the CLI and the MCP.
-- **Preview join** is `build-video --join-preview` (four clips, the last 3 s of each cut and the first 3 s of the
- last), not `--only` (one segment has no join); its own work dir and file, so the cut's `out/` is never touched.
- Refused for a deck cut (its joins are under the deck), a montage and hard cuts.
-- **A project-level note** is a `whole`-anchored note; the video project had no surface for one, so the Look panel's
- box lists them (Notes on the project, with Add note). The reply's proposal is a new `ReplyProposal` kind `assist`
- `{at, ops}`; its Apply all applies the waiting ops of THOSE proposals only while they are the latest (`at`).
-- **Apply** re-checks every op against the manifest as it is; an op the manifest no longer allows fails with the reason
- and the rest go on; a stale token stops the batch (409) with what was applied kept and marked.
-- **The task re-reads the manifest after the answer** and checks the ops against that, so an edit made while the model
- thought is what the ops meet.
-
-## Not done / owed
-
-- **Live, after merge** (the orchestrator's): the editor and umtool restarts; a dry run then a real ask on the Nik Drop
- project ("make the joins 0.15 s with less smear") on local Qwen, applied, and a Preview join — commands in the
- report.
-- The Build tab's other specs (`piece.spec.ts`, `visual-audit.spec.ts`) now render the Ask box under the Look panel;
- not run here (two specs a run) — the orchestrator's full umtool suite covers them.
-- `fx` ops reach only the declared params (no layout-coupled deck settings, no `render.palette`, no kinetic-quote
- voices) and never turn an effect on; widening that is a declaration per param plus its drift test.
-- The join preview is not offered for a deck cut (its joins are drawn under the deck; `--chrome-preview` is that
- path).
diff --git a/plans/release-5.md b/plans/release-5.md
@@ -1,486 +0,0 @@
-# Release 5 — Rumble un-broken, visitor exports off per site, then ONE rollout
-
-Cut 2026-09-24 (late evening) off `main` `8b7f8924` (code `e172749b`, one-core Phase 3 complete).
-Two parallel slices with no file overlap, merged **R → X**, then one editor restart at the END
-(release 3 and 4 rolled the previous release out as a prelude; release 5 rolls out last because R
-is what un-breaks Rumble syncing and the operator should not wait a release for it). The owed
-one-sync md5 sweep rides along with that rollout. Site rebuilds (X) are separate from the restart.
-
-Where this file corrects `plans/rumble-sweep-pacing.md` or `plans/site-exports-off.md`, this file
-wins and the slice's record commit updates that file. Implementer rules:
-[`tools/implementer-rules.md`](tools/implementer-rules.md).
-
-## Context
-
-- The live editor on :3001 still serves the `9ab10d77` build (`BUILD_ID` `XsKaA_drqdAbTguxUGVsn`).
- Release 4 is merged, not rolled out. `git diff --stat 9ab10d77..8b7f8924 -- umtool` is empty.
-- Rumble is broken two ways. (1) Every Rumble download 403s at `https://rumble.com/embedJS/u3/`
- (Cloudflare fingerprinting; upstream yt-dlp #17496, open since 2026-08-20); the editor never
- passes `--impersonate`, and the pipx venv (editable install of `~/Projects/yt-dlp-patched`, the
- binary the editor runs) has curl_cffi targets. The operator ran the probe 2026-09-24 —
- `yt-dlp --impersonate chrome --skip-download --print title <rumble url>` printed a title.
- (2) A full sweep of `the-quartering-rumble` (7,866 listed) 429s at listing page 155, yt-dlp exits
- 1, the sync discards the partial listing (correctly) and never stamps `lastFullSweepAt`, so every
- sync was a sweep → 44 days without sync. The operator set `fullSweepIntervalMinutes: 0` on that
- channel as a stopgap.
-- Exports-off: the operator's five published sites drop their visitor export surfaces; the
- capability stays a per-site option, default ON, for the OSS release.
-- Owed, unchanged: the one-sync md5 sweep; 188 orphan `*.tmp-*` under `transcripts/`; Anilyzer
- production deploy; five sites to corpus spec 4; LM chat-only tier; `transcribeOne.ts:173`.
-
-## Slice R — Rumble: impersonation everywhere, paced sweeps, incomplete ≠ failed
-
-Branch `one-core/r5-rumble`. There is no single `configArgs`: four arg-builders drift today and
-`probeChannelMeta` has none.
-
-| Builder | Where | Spawns |
-|---|---|---|
-| `configArgs` | `common/ytdlp/runYtdlp.ts:222-227` | `enumeratePlaylistUrls` :336 (sweep + paged walk + `fetchFlatPlaylistUrls`), `downloadSubsForUrl` :1097, `downloadOneAudio` :1269 |
-| `channelExtraArgs` | `common/ytdlp/channelArgs.ts:13` | `downloadOneManaged.ts` :460,654,991,1035,1103,1240 (the per-video managed download), `fetchWindowManaged.ts:201` |
-| inline | `common/ytdlp/metadataScan.ts:411-412` | metadata scan |
-| inline | `common/controller/checkAvailability.ts:210-218` (`extraArgs` :120) | quick availability check |
-| none | `common/ytdlp/runYtdlp.ts:401-448` `probeChannelMeta` | new-channel URL probe |
-
-1. **One table, one builder.** `common/ytdlp/channelArgs.ts`: `PLATFORM_ARGS: Partial<Record<
- Platform, readonly string[]>>` = `{ rumble: ["--impersonate", "chrome", "--sleep-requests", "1"] }`
- with a comment naming #17496 and the 2026-09-24 probe; `platformArgs(platform: Platform | null)`;
- `channelExtraArgs(config)` prepends `platformArgs(config.platform ?? detectPlatform(config.url))`
- (`common/lib/platform.ts:36-54`, `Platform` :5-22) before `ytdlpExtraArgs` so a channel override
- still wins. `configArgs` delegates to it (cookies first, as now); the two inline copies call it;
- `probeChannelMeta` gets `platformArgs(detectPlatform(url))` (a Rumble channel cannot even be
- created today — the probe 403s). Precedent: `resolveDownloadFormatSelector`
- (`common/ytdlp/downloadFormat.ts:41-58`). No new setting: the table is code; per-channel
- `ytdlpExtraArgs` remains the tweak surface.
-2. **A 429 mid-enumeration is "incomplete", not "failed" and not a listing.** `enumeratePlaylistUrls`
- (`runYtdlp.ts:319-368`): on exit ≠ 0/101 classify the captured stderr with
- `classifyDownloadFailure` (`common/lib/availability.ts:231-263`; `rate_limit` matches `http error
- 429`); if `rate_limit` → throw a typed `EnumerationIncompleteError {platform, pagesReached, count}`
- (page from the last `Downloading page N` line). `syncFullSweep` (`:1544-1727`; `:1557` is the
- enumeration call) catches it BEFORE `acceptEnumeration`: records the backoff for the platform
- via `recordDownloadBackoff` (`common/jobs/downloadBackoff.ts:31-42`; `platformBackoff` is
- platform-keyed, `common/jobs/platformBackoff.ts`, set by the runner `autoRunner.ts:1936-1953`,
- read by the Sync gate `pipelineActions.ts:126-142`), logs one line ("sweep incomplete: 429 at
- page N of the listing, M entries — not a listing; next syncs are paged walks until the rumble
- cooldown ends"), then RUNS `syncPaged` for this sync instead of failing, and never stamps
- `lastFullSweepAt` (`touchLastFullSweep` is already inside `if (decision.accept)`). Exit-1-with-
- other-stderr keeps throwing as today. Tolerating exit 1 generally stays out.
-3. **No re-sweep while the platform cools down:** `fullSweepDue` (`runYtdlp.ts:1339-1350`) also
- returns false when `platformCooldownRemainingMs` (`downloadBackoff.ts:19-27`) > 0 for the
- channel's platform.
-4. **403 classification, small:** `classifyDownloadFailure` has no 403 pattern (the 2026-09-24 job
- read "aborted (network)" only because the traceback matched `/ssl/`). 403 from Cloudflare is a
- fingerprint block, not a rate: add a `"blocked"` pattern group only if the type is cheap to
- thread; otherwise record it and leave.
-5. **Tests.** Unit: `channelArgs.test.ts` (rumble gets the four args before channel args; youtube
- gets none; override order), `enumeratePlaylistUrls` incomplete classification, `fullSweepDue`
- under cooldown. Fake yt-dlp (`editor/e2e/fixtures/bin/fake-ytdlp.mjs`; scenarios are URL
- sentinels, `ratelimit` → 429 + exit 1; no "exit 1 after N pages" mode): add a `sweep429`
- sentinel that prints N pages of urls then the 429 and exits 1, and have the fixture record
- argv so a spec can assert `--impersonate chrome` for a `rumble.com` URL. e2e: a Rumble-URL
- channel whose sweep hits `sweep429` → job succeeds as a paged walk, log has the "incomplete"
- line, `.auto-queue/state.json` has `platformBackoff.rumble`, `lastFullSweepAt` absent, the Sync
- button then reads "rumble is in a rate-limit cooldown" (`queues.spec.ts:38-73` pattern);
- `fetch-window.spec.ts:273-296` (429 → cooldown) stays green.
-6. **Rollout notes:** after R is live, remove `fullSweepIntervalMinutes: 0` from
- `the-quartering-rumble` and watch one paced sweep complete; the first accepted listing after 44
- days may legitimately shrink — the two-observation guard handles it.
-
-Numbers: none (no file format changes).
-
-## Slice X — visitor exports off, per site
-
-Branch `one-core/r5-exports`. The editor does NOT mount `TranscriptModal`/`PlayerProvider` — the
-gate is export-only. There is no `pnpm ops site-config`: `site.json` is written only by the
-Settings form (`SiteForm.tsx` → `saveSiteAction` → `writeSite`). Four places mount the modal (SiteWorkspace, duplicates, HubHome, AskHub — all
-in `export/`).
-
-1. **Schema key `transcriptDownloads`** (boolean, absent = on), the `archives` four-site pattern in
- `common/lib/siteSchema.ts` (type, docs, zod opt-out, write-if-non-default). Regenerate `SITE.md`
- with `pnpm --filter yt-dlp-transcript-common exec tsx bin/file-schemas-docs.ts` (`--check` is
- pinned by `fileSchemaDocs.test.ts`).
-2. **Form:** `SiteForm.tsx` checkbox beside `archives` — label "Per-video transcript downloads
- (Download menu, Copy Markdown, Copy download command)"; `actions.ts` reads it like `archives`.
-3. **The gate:** `PlayerProvider({children, features?})` takes `features: { transcriptDownloads:
- boolean }` (default all on) into its context; `TranscriptModal` hides the three controls when
- off (Copy download command, the Download dropdown, Copy MD). Mount sites pass
- `features={{ transcriptDownloads: currentSite().transcriptDownloads !== false }}`:
- `export/app/(workspace)/SiteWorkspace.tsx`, `export/app/duplicates/page.tsx`; hub pages
- `HubHome.tsx` and `AskHub.tsx` read the hub's own key the same way — the hub has no site.json, so
- it is `transcriptDownloads` in `sites/_homepage/homepage.json`, passed through `hubSite()` and
- set by the editor's hub form on `/sites` (the hub is a published surface and follows the same
- key; default on).
-4. **Tests.** Export e2e: a fixture site with `transcriptDownloads: false` → the three buttons
- absent (by accessible name), default → present; an `archives: false` fixture → no `/downloads`
- link, no zip manifest (new coverage); `phase3-files-numbers.ts` still reports zero unknown keys
- on both sides. Editor e2e: the site form round-trips the new checkbox.
-5. **Rollout (after merge and the editor restart):** for each of jeralyzer, rekietalyzer,
- hasanalyzer, anilyzer, bonnellyzer: Settings form → untick archives and transcript downloads →
- save → build-site + deploy-site; then the hub form on `/sites` → untick transcript downloads →
- save → rebuild + deploy the hub. Verify per site: no Downloads link in the header or footer, and
- `/downloads` shows its empty state (the route still builds and answers 200); transcript modal has
- no Download/Copy MD/Copy download command, `/corpus.json` and one `page-0001.json` still 200.
- On the hub: a federated transcript's modal has none of the three either.
- `use-with-ai` and `llms.txt` already gate their archives prose.
-6. Out of scope: gating the machine contract; "Copy share link"; umtool clip fetching; pruning the
- archives R2 volume.
-
-Numbers: `plans/tools/phase3-files-numbers.ts` before/after — the new key must not appear as unknown.
-
-## Rollout at the end of release 5 (ONE restart)
-
-Template: `plans/one-core-phase-3.md` "Rollout 2026-09-24 — `9ab10d77` live on :3001". Steps:
-(1) offline round-trips `phase3-settings-numbers.ts live=settings.json` and `phase3-files-numbers.ts`
-over live sites/configs; (2) md5 baseline of `settings.json`, 6 `site.json`, 71 `config.json`;
-(3) detached `pnpm --filter editor build` into the live `.next`; (4) ONE restart: TERM the `pnpm run
-start` + `next-server` whose cwd is `<repo>/editor`, wait :3001 free, `setsid nohup pnpm run start
--H 0.0.0.0`, poll `/` and `/tags`; (5) smoke = the 8 old/new view pairs stripped of live fields,
-`/api/view/<bogus>` + `invalidate-cache` 404, `/api/widget/presets` 200, `?rev=` `changed:false`,
-pages 200 incl. `/channels` (rack + group Transcribe enabled with a count), `/jobs`,
-`/operations/diarization`, one channel, one video, `BUILD_ID` changed, no `ZodError`; (6) md5 sweeps
-after boot, after ONE sync of ONE channel (a Rumble channel proves R live), after one form save;
-(7) `the-quartering-rumble`: remove the sweep override and watch one paced sweep; (8) record +
-STATE. umtool: rebuild only if `git diff --stat <live>..<new> -- umtool` is non-empty.
-
-## Then — Phase 4
-
-`plans/one-core.md:460-495` is the spec; deferred follow-ups are listed in
-`one-core-phase-3.md` "Next — Phase 4".
-
-## Record
-
-### Slice R, as shipped — Rumble: impersonation everywhere, paced sweeps, incomplete ≠ failed (2026-09-24)
-
-Branch `one-core/r5-rumble` off `main` `f4da04a9`, seven commits (four, then three after review), unmerged. Every Rumble request
-403s at Cloudflare without a browser TLS fingerprint (yt-dlp #17496), and the
-`the-quartering-rumble` full sweep 429'd at page 155 and failed the whole sync every time for 44
-days. There is now one arg builder with a platform table, and a 429 part-way through a full
-enumeration is *incomplete*: cooldown recorded, one log line, the paged walk runs, the job succeeds.
-
-| sha | what |
-|---|---|
-| `bca929a1` | `common/ytdlp/channelArgs.ts`: `PLATFORM_ARGS` (`rumble: --impersonate chrome --sleep-requests 1`, comment names #17496 and the 2026-09-24 probe), `platformArgs(platform)`, `channelPlatform(config)` = `config.platform ?? detectPlatform(config.url)`; `channelExtraArgs` = cookies → platform args → `ytdlpExtraArgs` (override last, wins). `configArgs` (runYtdlp) delegates to it; the metadata scan's and `checkAvailability`'s inline copies call it (`checkAvailability` falls back to `cookieArgs` only when the channel has no config); `probeChannelMeta` gets `platformArgs(detectPlatform(url))` — `detectPlatform("https://rumble.com/c/…")` is `"rumble"` (host suffix). `channelArgs.test.ts` (5) |
-| `0a4b9999` | `EnumerationIncompleteError {platform, pagesReached, count}` + `lastListingPage(stderr)` (last `Downloading page N` — the real wording is `[RumbleChannel] TheQuartering: Downloading page 155`, job `01M3AVGZC5EZ9GCD04R9QW6NWX`). `enumeratePlaylistUrls` classifies a non-0/101 exit's buffered stderr with `classifyDownloadFailure`; `rate_limit` → the typed error (message still starts `yt-dlp exited with code N`), anything else → the plain error as before. `syncFullSweep` catches it before `acceptEnumeration`, calls `opts.onPlatformBackoff?.("rate_limit")` (= `recordDownloadBackoff(platform, paths)`, wired by `pipelineActions.ts:215`, the same helper and `nextBackoff` schedule a download's 429 uses), logs `Full sweep incomplete: 429 at page N of the listing, M entries — not a listing; next syncs are paged walks until the rumble cooldown ends.`, then `return syncPaged(opts)`. No playlist write, no missing set, no `lastFullSweepAt`. `fullSweepDue` is now exported, async, and false while `platformCooldownRemainingMs(detectPlatform(url) ?? "unknown")` > 0 — the Sync gate's key. `sweepIncomplete.test.ts` (4) |
-| `84788fff` | Fake yt-dlp: every `--flat-playlist --print url` records `flat-playlist:full\|paged argv=<whole argv>` in `fake-ytdlp.invocations` (no argv log existed for enumeration; the per-cwd invocations file is the fixture's existing record, so no new env var); `sweep429` sentinel — a full enumeration prints 3 pages × 5 urls with RumbleChannel page lines on stderr, then the real 429 `ERROR:` line, exit 1; a paged walk (`-I`) lists normally. New `rumble-sweep.spec.ts` |
-| `7b50cb45` | record, `[Unreleased]` bullet, superseded note on `plans/rumble-sweep-pacing.md` |
-| `c145f7df` | Review fixes: the cooldown write in the incomplete branch is best-effort (try/catch as on the download path; a failure logs `Warning: could not record the <platform> cooldown …` and the paged walk still runs); the log line now reads `… M entries — not a listing. Ran the paged walk instead; syncs wait for the rumble cooldown, then the sweep is retried.` (syncs are REFUSED during the cooldown, `pipelineActions.ts:133-145`); enumeration comment back above `enumeratePlaylistUrls`, the error class has its own one-liner; `checkAvailability` adds `platformArgs(detectPlatform(url))` when the channel has no config (no unit test file exists for it) |
-| `a70df836` | `classifyDownloadFailure`: `/http error 403/` joins the `network` group, so a bare `HTTP Error 403: Forbidden` backs the platform off — no new class, no `download-outcome.json` change. New `common/lib/availability.test.ts` (1). Changelog bullet reworded to match |
-| (this) | record: commit table, gates, caveats |
-
-**Gates.** tsc (`pnpm -r … exec tsc --noEmit`) clean at every commit. common **1747** (1738 + 9 new),
-editor unit **72**, test:scripts **156 + 1 skip**, mcp **219**. `next build` editor and export both
-green. e2e, the 17-spec list (none missing: `rumble-sweep queues fetch-window availability
-availability-backfill maybe-missing reconcile scheduler pipeline sync-deep sync-break-on-existing
-channels-actions cookies-mode audio-check-scenarios metadata-scan-botcheck metadata-scan-softblock
-new-channel-onboarding`): **82 passed, 1 failed, 7.8 min** (after 8 min in the queue) — the
-failure is `pipeline.spec.ts:164`, `EEXIST: mkdir …/test-transcripts/channels` inside
-`resetData`'s `cp` at `helpers.ts:69` (a fixture-reset race before the test body ran, 301 ms);
-rerun `pipeline.spec.ts rumble-sweep.spec.ts`: **8 passed, 56 s**. `fetch-window.spec.ts`'s 429 →
-cooldown test green. **After review** (`c145f7df`, `a70df836`): tsc clean per commit; common
-**1748** (+1); editor unit **72**; `next build` editor and export green; e2e `rumble-sweep
-availability availability-backfill queues fetch-window pipeline`: **33 passed, 0 failed,
-2.5 min** (after ~7 min in the queue). Numbers: none (no file format changes).
-
-**Found and left.**
-- **403 has no class of its own (item 4, partly done).** `DownloadFailureClass` is not cheap to widen:
- it is persisted in every per-video `download-outcome.json` (`common/lib/downloadOutcome.ts:105`
- — a new value is a sidecar format change), and it is a decision in the auto-runner
- (`autoRunner.ts:1941-1944`, backoff on `rate_limit | network`), in `runYtdlp.ts` (backoff +
- `abortOnError`, the managed-download loop ~:1029-1051) and in `downloadOneManaged.ts:1372`
- (where it is produced). Before `a70df836` a Cloudflare 403 read as `network` only when the
- traceback happened to contain "ssl" (the 2026-09-24 job did; a bare `HTTP Error 403:
- Forbidden` did not, and read `unknown`). It is now in the `network` group, so it backs the
- platform off. With `--impersonate` the 403 should stop occurring; if it recurs, a `blocked`
- class wants its own decision (no backoff, a sentence on the channel), not a pattern.
-- **The metadata scan passes `--sleep-requests 1` twice for Rumble** (its own, then the platform
- table's). Harmless (same value, last wins); left so the scan's own pacing stays for every
- platform.
-- **The paged walk can also 429.** A `rate_limit` on a ranged page throws the typed error out of
- `syncPaged`, and the sync fails exactly as before (its message is unchanged in prefix). The
- fallback deliberately runs only once per sync.
-- **Retry cadence after an incomplete sweep.** No last-attempt stamp is kept: once the platform
- cooldown ends (`nextBackoff`: 1 min, doubling, at most 30 min — `platformBackoff.ts:22-37`) the
- sweep is due again on the next sync, and any successful Rumble download clears the escalation
- (`clearBackoff`, `autoRunner.ts:1957`), so it restarts at 1 min. If live sweeps keep coming back
- incomplete, a `lastFullSweepAttemptAt` (retry no sooner than N hours) is the follow-up.
-- **Outside the slice: umtool still spawns yt-dlp without `--impersonate`.**
- `umtool/report-to-video/build-video.mjs` (`YTDLP` at :75) and `check-availability.mjs` (:32)
- build their own argv, so Rumble clip fetches and availability checks there will still 403.
- (The editor's clip-window fetch, `fetchWindowManaged.ts`, is covered.)
-- **`pipeline.spec.ts:164` EEXIST reset race** — first sighting: `resetData`'s `cp` hit
- `EEXIST: mkdir …/test-transcripts/channels` (`helpers.ts:69`) before the test body; green on
- rerun and in the post-review run. Watch for a second sighting.
-- **Commit trailers** name `Claude Opus 5.5 (1M context)` — the model that wrote them — not the
- `Claude Fable 5.1` line in `plans/tools/implementer-rules.md`.
-
-**Rollout.** Item 6 above stands: after R is live remove `fullSweepIntervalMinutes: 0` from
-`the-quartering-rumble` and watch one paced sweep (at 1 req/s, ~155+ pages ≈ 3 minutes of
-listing); the first accepted listing after 44 days may shrink — the two-observation guard owns it.
-
-### Slice X, as shipped — visitor exports off, per site (2026-09-24)
-
-Branch `one-core/r5-exports` off `main` `f4da04a9`. One new `site.json` key, `transcriptDownloads`
-(boolean, absent = on), gating the transcript modal's three per-video export controls on the export
-site; the site form writes it. The hub, which has no `site.json`, gets the same key in
-`homepage.json`, written by the hub form. `archives: false` needed no code — it gained test coverage.
-
-| sha | what |
-|---|---|
-| `acf0c676` | `common/lib/siteSchema.ts`: `transcriptDownloads` in the `Site` type, `SITE_FIELD_DOCS` (after `duplicates`), a zod field that is off only on an explicit `false`, `siteToDisk` writes it only when `false` — the `archives` pattern, four places. `siteSchema.test.ts` extends the existing default / opt-out / siteToDisk / round-trip / writeSite tests. `SITE.md` regenerated (`--check` green) |
-| `d301d757` | `PlayerProvider({children, features?})`: `PlayerFeatures = {transcriptDownloads}`, `DEFAULT_PLAYER_FEATURES` all on, exposed as `usePlayer().features` (memoised on the flag, so an inline `features={{…}}` does not rebuild the context). `TranscriptModal` renders none of Copy download command, the Download dropdown and Copy MD when off; Share, the clip marks and every accessible name are unchanged when on. Mounts: `(workspace)/layout.tsx` → `SiteWorkspace` prop, `duplicates/page.tsx` directly, `HubHome`/`AskHub` via a prop from their server pages (`(workspace)/page.tsx`, `(workspace)/ask/page.tsx`) — all `currentSite().transcriptDownloads !== false` |
-| `a42b1737` | `SiteForm.tsx` checkbox after the archive size cap, label "Per-video transcript downloads (Download menu, Copy Markdown, Copy download command)"; `actions.ts` reads it like `archives`. `editor/e2e/sites-crud.spec.ts`: one new test round-trips BOTH opt-outs (no spec covered the `archives` checkbox before) |
-| `9958b42b` | export e2e: `transcript-downloads.spec.ts` (2), `archives-off.spec.ts` (2) |
-| `6950945a` | `plans/tools/phase3-files-numbers.ts` literal gains the key; this record; `site-exports-off.md` superseded note; changelog |
-| `c09ef9c7` | review fix: the leftover-key strip moves from the spec's `beforeAll` into `export/playwright.config.ts` (config load, before any spec) |
-| `c65c08c2` | review fix, the hub: `homepage.json` `transcriptDownloads` in `common/lib/homepage.ts` (type; read only as `false`; `writeHomepageConfig` writes it only when `false`), `hubSite()` passes it through (`export/app/lib/site.ts`), checkbox on `HomepageConfigForm.tsx` (same label) + `homepageActions.ts`. `common/lib/homepage.test.ts` (new, 2 tests — there was no homepage test), `export/e2e-hub/transcript-downloads.spec.ts` (2, the hub-mode suite), `sites-crud` round-trip of the hub form. `playwright.hub.config.ts` removes a leftover fixture `_homepage/` at load |
-| `41bbf92e` | record + changelog after review |
-| `4ec5af9b` | merge `main` `3adaea9b` (slice R); conflicts only in `editor/CHANGELOG.md` `[Unreleased]` and this file's `## Record`, both slices' text kept, R's first |
-| *(this commit)* | the merged-tree gates below |
-
-**Deviations / findings.**
-1. *The hub has no `site.json`, so its key is in `homepage.json`.* In hub mode `currentSite()` is
- `hubSite()`, a `Site` synthesised from `sites/_homepage/homepage.json`. The first cut left the
- hub always on; review held the plan's decision (the hub is a published surface — and it
- federates exactly the five sites being turned off — so it follows the same key, default on),
- and `c65c08c2` adds `transcriptDownloads` to `homepage.json` under the same name and rules.
- `writeHomepageConfig` rebuilds the file from named fields, so the hub form is the key's writer.
- **`homepage.json` has no generated doc** (`file-schemas-docs.ts` covers `settings.json`,
- `site.json` and `config.json` only) and no zod schema; none was invented. The numbers tool does
- not read `homepage.json`, so it was not re-run for this commit.
-2. *Client mounts cannot call `currentSite()`* (it reads `site.json` off disk). `SiteWorkspace`,
- `HubHome` and `AskHub` are `"use client"`, so each takes a boolean prop from its server parent;
- `duplicates/page.tsx` is a server component and passes the features itself.
-3. *Export e2e varies per-site config by flipping the fixture.* The suite serves ONE site
- (`SITE_ID=testsite`) from one `next dev`; no spec varied `site.json` before (the per-site
- variants in the suite are route mocks of client data). `currentSite()` is uncached and `next
- dev` re-renders the layout per request, so the off test writes `transcriptDownloads: false`
- into `e2e/fixtures/sites/testsite/site.json`, asserts, and `afterEach` restores the bytes. A
- run killed mid-test leaves the key; `playwright.config.ts` strips it when the config loads,
- before any spec runs (`c09ef9c7` — the first cut stripped it in the spec's own `beforeAll`,
- which runs 36th of 37 files, after `player-control-bar` had already failed on it). The strip
- re-serialises the file, so after a killed run the fixture can differ from git in whitespace
- only. A second fixture site would need a second `next dev` of the same app dir. The hub-mode
- spec does the same with a `_homepage/homepage.json` that the fixture tree never commits; the
- hub config deletes a leftover.
-4. *`archives: false` is a build-time switch, so its coverage is a compose run, not a page.* The
- Downloads page and its Header/Footer links key off `public/archives/manifest.json`
- (`hasArchives()`), which `compose-site` writes; the dev server reads the checked-out
- `export/public` (symlinked from the primary). `archives-off.spec.ts` runs `compose-site` into a
- scratch `EXPORT_PUBLIC_DIR` under the test's output dir over a scratch channel-less site:
- `archives: false` → no manifest, a pre-seeded stale one removed; key absent → a fresh manifest.
- The "no `/downloads` link" half follows from `hasArchives()` and is not rendered in a test.
-5. *The actions themselves are not gated.* `copyDownloadCommand` / `downloadTranscriptFile` /
- `copyTranscriptMarkdown` stay on the context; the three buttons are their only callers (grep),
- and the data is in the visitor's browser either way — this removes the affordance, it is not
- access control.
-
-**Gates** (worktree root).
-- tsc `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean.
-- common `pnpm --filter yt-dlp-transcript-common test`: **1738/1738** (assertions added inside
- existing tests; count unchanged). `file-schemas-docs.ts --check`: green.
-- editor unit (`editor/`, `tsx --test "app/**/*.test.ts"`): **72/72**. `pnpm run test:scripts`:
- **156 pass + 1 skip**. mcp: **219/219**.
-- `pnpm --filter editor exec next build`: ok (47 s). `pnpm --filter export exec next build`: ok
- (32 s); no dangling `export/public` links before either.
-- EXPORT e2e, full suite (`node scripts/worktree.mjs run -- pnpm --filter export run e2e`):
- **192 passed, 0 failed, 8.5 min** (188 + the 4 new). The fixture was back to its committed
- bytes afterwards (`git status` clean).
-- EDITOR e2e (`pnpm e2e` with `sites-crud site-publish-preview site-scope cut-release view-route
- settings`, all six exist; `sites-crud` is now the spec covering the `archives` checkbox):
- **50 passed, 0 failed, 1.7 min** (after ~7.5 min behind slice R's run on the queue).
-
-**Gates after review** (tip `c65c08c2`, same commands). tsc clean. common **1740/1740** (+2,
-`homepage.test.ts`). `file-schemas-docs.ts --check` green. editor unit **72/72**. editor `next
-build` ok (39 s), export `exec next build` ok (24 s), no dangling `export/public` links. EXPORT e2e,
-full suite: **192 passed, 0 failed, 7.5 min**. Export HUB suite (`… run e2e:hub`, the existing
-hub-mode run, `playwright.hub.config.ts`): **8 passed, 0 failed, 17 s** (6 + the 2 new). EDITOR e2e
-`sites-crud`: **13 passed, 0 failed, 41 s** (the spec closest to the hub form; no spec covered that
-form before). Fixture tree clean after all three (`git status`; no `_homepage/` left).
-test:scripts and mcp are untouched by the fixes (no file under their globs changed) and were not
-re-run.
-
-**Gates on the merged tree** (`4ec5af9b`, slice R + slice X — the tree to merge as-is). tsc clean.
-common **1750/1750** (R's tests + the 2 homepage tests). `--check` green. editor unit **72/72**.
-test:scripts **156 + 1 skip**. mcp **219/219**. editor `next build` ok (40 s), export `exec next
-build` ok (25 s). EXPORT e2e full: **192 passed, 0 failed, 6.3 min**. HUB e2e: **8 passed, 0
-failed, 16 s**. EDITOR e2e (`sites-crud site-publish-preview site-scope cut-release view-route
-settings`): **51 passed, 0 failed, 1.7 min** (50 + the hub-form test). `git status` clean after.
-
-**Numbers** (`plans/tools/phase3-files-numbers.ts`, `TMPDIR` = the job's scratch). Inputs frozen
-once (`FREEZE_TO`) from the live corpus: 6 `site.json`, 71 `config.json`, 1,763 sidecars. Before =
-the tool on `f4da04a9` code (branch changes stashed); after = the branch with the literal updated
-(it asserts the literal equals `SITE_FIELD_DOCS`). **Unknown-key report: empty on both sides**, 77
-files each. **Diff: 18 lines, exactly one per site** — each parsed site gains
-`"transcriptDownloads": true`; every `writeSite(getSite())` file is byte-identical (no site gains
-the key on disk). A third run over a scratch copy with jeralyzer's `site.json` carrying
-`transcriptDownloads: false` + `archives: false`: unknown keys still empty, both parse `false`,
-and the written file keeps both keys.
-
-**Left.** Rollout item 5 is the operator's, after merge: untick both on the five published sites
-and build + deploy each, then untick transcript downloads on the hub form and rebuild + deploy the
-hub. Verify per site as item 5 now says: no Downloads link in the header or footer, and
-`/downloads` shows its empty state (it still answers 200).
-
-## Rollout 2026-09-24 (night) — `93dcb532` live on :3001 (releases 4 + 5 together)
-
-ONE restart, at the END of release 5, as the plan said: R is what un-breaks Rumble syncing.
-Editor only — `git diff --stat 9ab10d77..93dcb532 -- umtool` prints nothing, so umtool was
-not rebuilt or restarted (still serving on :3050). The live editor had served `9ab10d77`
-(release 3, `BUILD_ID` `XsKaA_drqdAbTguxUGVsn`) since the release-4 prelude.
-
-**Final suites on `93dcb532` first** (worktree `one-core-r5-exports` detached at the merge sha,
-whose tree equals X's gated tip `d948aa0e`; ports 3211/3210/3220; logs
-`final-e2e-r5-{editor,export,hub}.log`): editor **628 passed, 0 failed, 0 flaky, 39.4 min**
-(release 4's `lane-runner.spec.ts:361` load flake did not recur); export **192/192, 6.2 min**
-(188 + 4 new); hub **8/8, 16 s**.
-
-**Offline round-trips.** `phase3-settings-numbers.ts live=settings.json`: the written block
-equals `jq -S . settings.json` (diff empty, 1,353 scalar paths each side — the same count as
-release 4). `phase3-files-numbers.ts` over the LIVE `transcripts/`: 6 `site.json` + 71
-`config.json`, every `unknown keys: []` (77 lines), no `WRITE THREW`; the output is 3,839
-lines against release 4's 3,832 — the seven new lines are the `"transcriptDownloads": true`
-each site's parse now carries (X's key, default on) plus the hub's.
-
-**Build and one restart.** md5 baseline over `settings.json` + 6 `site.json` + 71
-`config.json` (78 files). `pnpm --filter editor build` detached into the live `.next` while the
-old server served: exit 0, compiled in 14.3 s, `ƒ /api/view/[name]` in the route table;
-`BUILD_ID` `XsKaA_drqdAbTguxUGVsn` → **`FKE60BTWpUiUa94WCSxTO`**. Seven auto-lane jobs were in
-flight (1 backfill, 1 digest, 2 download, 2 transcribe, 1 transcribe), as at release 4's
-restart. Then TERM pnpm 525402 / next-server 525417 (cwd `editor/`), :3001 free, `setsid nohup
-pnpm run start -H 0.0.0.0` → next-server **888107**, `/` 200 after 2 s, `Ready in 163ms`,
-`/tags` 200. md5 sweep right after boot: identical to the baseline — boot rewrote nothing.
-
-**Smoke, started 4 min after boot** (`smoke10.sh`, the release-4 script). All eight old/new
-pairs equal on the FIRST pass with the live fields stripped: `pulse` 109 B, `workers` 1,116 B,
-`activeJobs` 2,652 B, `autoQueueStatus` 507,725 B (79 s), `schedulerStatus` 37,371 B,
-`widgetSync` 1,522 B, `widgetActionable` 1,148 B, `cleanable` 1,677 B. `/api/view/bogus` and
-`/api/view/invalidate-cache` 404; `/api/widget/presets` 200; `/api/view/pulse?rev=` and
-`/api/pulse?rev=` both `changed:false`; `cleanableBytes: null`. Pages, all 200: `/` 0 s,
-`/channels` 1 s, `/channels?sort=size` 0 s, `/jobs` 0 s, `/operations/diarization` **77 s**,
-`/settings`, `/storage`, `/tags`, `/channels/FearAnd`, `/channels/FearAnd/videos/03Bgz7vkgbs`
-0–1 s. No `ZodError` in the start log (0). `SMOKE_FAIL=0`.
-
-**The surfaces, from the served HTML.** `/channels` is the rack (`sticky top-0` thead, "sort by
-Tier" and "sort by Transcribe" columns); `/channels?site=jeralyzer` renders 4
-`data-testid="group-name"` groups, each with `sync|download|transcribe|digest|speakers group
-<name>` stations — the transcribe station renders its done state (`Transcribed`) for all four
-groups tonight, so there was no group with untranscribed audio to show a count on. Release 5's
-own surfaces: the site form (`/sites/jeralyzer`) shows "Per-video transcript downloads (Download
-menu, Copy Markdown, Copy download command)" beside "Generate downloadable archive zips on
-build", and the hub form on `/sites` shows the same checkbox.
-
-**The owed one-sync md5 sweep — and R's first live proof.** md5 sweep just before the sync:
-identical to the after-boot sweep (the smoke wrote nothing). `pnpm ops sync
-{"slug":"rekietalaw-rumble"} --wait` (job `01M3BARDZR528JS70BE17467WF`, 8 min 11 s, exit 0):
-the full-sweep spawn was `yt-dlp --flat-playlist --skip-download --print url --impersonate
-chrome --sleep-requests 1 https://rumble.com/c/RekietaLaw` — the platform table live — and it
-COMPLETED: "670 listed, was 666", "669 known, 670 in fresh listing, 2 maybe-missing", the listing
-accepted, 4 new videos on page 1. Every per-video spawn carried the same two flags, and all four
-downloaded: `DLOM_ARCHIVE RumbleEmbed v7dn1wy / v7dh02c / v7ddwkg / v7dce86` — of the 500
-retained job logs this is the ONLY one with a Rumble archive line (four others carry the embedJS
-403). Availability backfill wrote 4. md5 sweep after the sync: exactly one file moved,
-`channels/rekietalaw-rumble/config.json` (`lastFullSweepAt` 2026-08-21 → 2026-09-25T03:54:54,
-`lastSyncedAt` 2026-08-31 → 2026-09-25T03:54:53), nothing else.
-
-Live-found, not a regression: the maybe-missing confirmation of `v7e07us` reads `error` — the
-sidecar says `HTTP Error 410: Gone`, and has since 2026-08-21. A 410 is a removed video, not an
-error; `classifyAvailability` has no 410 pattern. Follow-up, small. `v7emb9a` was skipped ("no
-webpage_url in metadata.info.json"), as before.
-
-**Form save.** One Configure-form save with no field changed on `legal-mindset` (`pnpm ops
-channel-config` with `patch: {}`, the server action the form posts): `ok`, and the md5 sweep
-after it is identical to the after-sync sweep — release 4's save had already applied the
-one-time key reorder on that file, so this time nothing moved; `jq -S` equal.
-
-**Exports off on the five sites — the site form's one side effect.** The two switches were
-unticked through the live Settings form (`/sites/<id>`, headless Playwright driving the real
-form, `xr-flip.cjs`), never by hand. On `anilyzer` the save wrote the two `false` keys AND
-materialised `order` on the one group and the one channel that had none (`legal-mindset`, added
-by the LM-filter work through the CLI): the group became `order: 11` (it was already last, and
-`sortGroups` keeps a missing order last, so nothing moved), the channel `order: 9` (placed
-alphabetically after `leaflit-rumble`; the array was reordered to match). Channel `order` is
-parsed into the schema (`siteSchema.ts:154`) and read by nothing under `common/lib` or
-`export/app`, so there is no visible effect. Accepted as the form's normal write — a human save
-does exactly this — and recorded per site below.
-
-**Step 7 — `the-quartering-rumble`'s first complete sweep in 44 days.** The stopgap
-`fullSweepIntervalMinutes: 0` was removed through the Configure-form writer (`pnpm ops
-channel-config` with `patch: {"fullSweepIntervalMinutes": null}` — null clears a field; the
-before/after `jq -S` diff is exactly that one key gone). Then `pnpm ops sync` (23:55:34): with
-`lastFullSweepAt` null the sync was a full sweep, and the editor's own spawn line was `yt-dlp
---flat-playlist --skip-download --print url --impersonate chrome --sleep-requests 1
-https://rumble.com/c/TheQuartering`. The paced walk went past page 155 (where the unpaced one
-429'd three times on 2026-09-24) and on through page 310+ with no rate limit, ~9 min for the
-listing. Accepted: **"8045 listed, was 7866"**, "7936 known, 8045 in fresh listing, 4
-maybe-missing" — the listing grew, it did not shrink, so the two-observation guard was not
-exercised — and the stored playlist is 8,045 lines. Page 1 had 50 entries, all 50 new; the job
-then downloads them one by one (each spawn impersonated and paced).
-
-**Orphan temp files, gone.** Operator-approved (2026-09-25 ~00:15) with two filters — older than
-24 h, and the file's channel has no running job (`/api/view/activeJobs`): `find transcripts -name
-'*.tmp-*'` listed 188, all of them older than 24 h — 175 zero-byte `.auto-queue/state.json.tmp-2514131-*`
-from 2026-09-11 (the pre-priority editor's pid, before slice W's one write idiom) and 13 per-channel
-sidecar temps (7 `snapshot.json`, 3 `transcript`, 2 `availability.json`, 1 `download-outcome.json`,
-the newest from 2026-09-11 too). 188 deleted, 0 skipped (the one busy channel, `the-quartering-rumble`,
-had none), 2,519,597 bytes freed, 0 remaining (`r5-orphans.log`).
-
-**Exports off, deployed.** `pnpm ops build-index` (job `01M3BBJXQ01ECGZNEZ61QE0WKG`, 12.4 min),
-then one `build-deploy` job per site, serially. **anilyzer** (`01M3BC9JJQFADFX621KGPM971B`, 17 min:
-"Done in 734.17s. 6 site(s): 6 built", "[archives] disabled for this build — skipping", 25 channels
-composed, 227 files uploaded + 674 already there, deployed): verified at https://anilyzer.pages.dev —
-`/downloads` 200 with the empty state ("No archives have been published for this site yet"), no
-zip links, the home page has no link to `/downloads`, `/corpus.json` 200 at **spec 4** (26 channels,
-29,751 videos), `transcripts/chibi-reviews/manifest.json` and `page-0001.json` 200, and a headless
-open of a transcript modal finds none of "Copy yt-dlp download command", "Download this … as a
-file", "Copy this … as Markdown" while "Copy share link" and the clip mark are still there. This is
-also the Anilyzer production deploy owed since the curated-tags release, and the first of the five
-sites at corpus spec 4.
-**bonnellyzer** (`01M3BD94S59YG01JJF6V7PBN27`, 28.5 min), **hasanalyzer** (`01M3BEXC9QRCTN90ZJ5WDGB6RS`),
-**rekietalyzer** (`01M3BFMRQJWSQKRM73NPNRQ1E5`, 11.9 min): the same six checks pass at each public URL —
-`/downloads` 200 with the empty state and no zip links, no home-page link to `/downloads`,
-`/corpus.json` 200 at spec 4 (bonnellyzer 4 channels / 8,079 videos; hasanalyzer 6 / 3,425;
-rekietalyzer 2 / 2,925), a channel manifest + `page-0001.json` 200, and the transcript modal
-without Copy download command / Download / Copy MD while "Copy share link" and the clip mark remain.
-**jeralyzer** (`01M3BGADKE9S7V6X15WK2VF065`, 12.1 min): the same six checks pass — spec 4, **30 channels /
-31,463 videos** (30,886 at the 2026-08-07 build). `corpus.json` on every site no longer carries
-`bulkArchives`. The whole chain (index + five build-deploys, serial) took ~95 min; each build-deploy
-rebuilds the index itself, so the standalone index job was redundant. Order fills per site, exactly
-as predicted from the read-only check: anilyzer `legal-mindset` (channel + group), hasanalyzer
-`FearAnd` + `hasanthehun-x`, jeralyzer `thequartering-X`, none on bonnellyzer and rekietalyzer (their
-diffs are exactly the two keys). Group order unchanged everywhere. The checks are real: run against
-anilyzer BEFORE its deploy they found the zip links, two home links to `/downloads`, `bulkArchives`
-and all three modal controls.
-
-**Found on the way, not fixed.** (1) **jeralyzer `corpus.json` lists `thequartering-X` first — a
-posts-only channel with `videoCount: 0` whose transcripts manifest is a 404** (its posts manifest is
-200). A client that walks every transcripts manifest hits a 404; the composer should omit the
-transcripts manifest URL (or emit an empty manifest) for a posts-only channel. Small follow-up in
-`common/bin/compose-site.ts`. (2) **The hub's "Save config" form dropped `"nav": []` from
-`homepage.json`** alongside adding `transcriptDownloads: false`. `nav` is not a `HomepageConfig`
-field, `parseHomepageConfig` never reads it and nothing under `homepage/app`, `export/app/lib/site.ts`
-or `compose-hub.ts` uses it — inert, but the writer rebuilds the file from named fields, which is
-the documented behaviour (SITE.md's sibling has no doc: `homepage.json` has none). (3) **The hub
-build has no deploy path.** `INSTANCE_MODE=hub` is `pnpm --filter export run build:hub` and nothing
-deploys its `out` (no `pnpm ops` action, no editor entry — `plans/one-core.md:84` already says
-"`build:hub` has no operator entry point"); the `homepage` package deploys to the `archilyzer`
-project but mounts no transcript modal. So the hub's key is SET but no hub was rebuilt or deployed
-tonight, and the federated hub could not be checked live because **https://archilyzer.pages.dev
-answers HTTP 522 on every path** (`/`, `/ask`, `/corpus.json`, `/hub-sites.json`; checked twice, the
-second time at 05:36 UTC) — not from this rollout, nothing deployed there. Operator: look at the
-Cloudflare project. The Phase 4 CLI slice is where `build:hub` gets its entry point.
-
-**Release 6 rode along on `main`, not on :3001.** After this rollout the operator approved an
-overnight plan (memory `overnight-2026-09-25`): the follow-ups slice merged as `4d97049f` and Phase
-4 slice 1 as `cda35622` — see [`release-6.md`](release-6.md). Neither is rolled out; the next
-prelude does that, after `pnpm install --frozen-lockfile` in the primary (the umtool→common link
-and the aws-sdk move). The YouTube pacing investigation is filed as
-[`youtube-lane-pacing.md`](youtube-lane-pacing.md): the evening's three cooldowns were one Short
-retried 12× from the head of the queue, not a burst.
-
-**Step-7 sync, finished 01:50 (exit 0, 1 h 54 min, job `01M3BB8JJGN272R5HKJPS100F5`).** 97 distinct
-videos archived (285 archive lines), 0 download errors, availability backfill wrote 94; the channel
-now carries `lastFullSweepAt` = `lastSyncedAt` = 2026-09-25T05:49:49Z, no override key. The four
-maybe-missing confirmations all read `error`: each is `HTTP Error 410: Gone` raised inside
-`_curlcffi.py:343` — the impersonated transport working and the videos removed upstream. On this
-build a 410 is `error` (safe: nothing is deleted or pruned); the follow-ups slice already on `main`
-(`4d97049f`) classifies it `deleted` from the next rollout on — the live corpus proved that fix
-worth shipping within two hours of its being written.
diff --git a/plans/release-6.md b/plans/release-6.md
@@ -1,108 +0,0 @@
-# Release 6 — follow-ups + Phase 4 slice 1
-
-`main` at `93dcb532` (release 5 merged: slice R, Rumble; slice X, visitor exports off). Release 5 is
-live. This release clears release 5's "found and left" items and Phase 3's deferred items, then lands Phase 4 slice 1.
-
-## Record
-
-### Follow-ups slice, as shipped — 410 is removed, umtool's Rumble args, one atomic write, a comment, measure-nav (2026-09-25)
-
-Branch `one-core/r6-followups` off `main` `93dcb532` (`main` had not moved). Five small items,
-one commit each. Four came from release 5's "found and left" list and Phase 3's deferred list. The
-fifth came from a live sidecar.
-
-| sha | what |
-|---|---|
-| `6d5cdbc3` | `common/lib/availability.ts` `parseUnavailableFromStderr`: `/http error 410/` joins the `deleted` group. There was no `404` pattern to copy, so it sits with "video unavailable" / "no longer available". The evidence is `rekietalaw-rumble` `v7e07us`'s sidecar (read only, not re-checked). It has read `error` since 2026-08-21, with `ERROR: [Rumble] v7e07us: Unable to download webpage: HTTP Error 410: Gone (caused by <HTTPError 410: Gone>)`. The classifier now returns `deleted`, so `classifyDownloadFailure` makes a download that hits it `per_video` (skip) where it used to be `unknown` (batch abort). `availability.test.ts` +1 test: that exact line, the per-video consequence, and 403/500 still `error` |
-| `9a88ee4b` | umtool's yt-dlp spawns carry the platform args. `report-to-video/*.mjs` run under bare `node`, and the runtime image is `node:20` (no type stripping), so they cannot import common's TS. **The shim moves the table rather than copying it.** `PLATFORM_ARGS` / `platformArgs` (+ a new `platformArgsForUrl`) now live in `common/ytdlp/platformArgs.mjs`, and `detectPlatform` in `common/lib/detectPlatform.mjs`. Both are plain JS with JSDoc types. `channelArgs.ts` and `platform.ts` re-export them, so no TS caller changed (the base tsconfig already has `allowJs`). common's `package.json` exports the two files by exact path; the `./lib/*` / `./ytdlp/*` patterns map to `.ts`. `umtool-report-to-video` gains a `yt-dlp-transcript-common` dependency. The lockfile gets that importer entry only: a plain `pnpm install` re-resolved ~280 lines of peer suffixes, so the entry was applied by hand and verified with `pnpm install --frozen-lockfile`. `build-video.mjs` exports `clipFetchArgs` (platform args before a retry's `extra`), and `check-availability.mjs` exports `simulateArgs`. New `platform-args.test.mjs` (3): Rumble gets the table's args in position, YouTube gets none |
-| `947f07aa` | `common/controller/transcribeOne.ts`: the remote upload path's `writeFile(transcriptPath, bytes)` is now `writeFileAtomic` (`lib/jsonFile-server.ts` — the brief's `writeJsonAtomic.ts` does not exist; slice W's idiom lives there). The shared-fs path is unchanged. No new test: the path needs a remote worker, and the repo does not module-mock. `transcribeOne.test.ts` (3) is green |
-| `71e2bb41` | `common/controller/channelSnapshot.ts` above `foldBucketLaneEntry`: the comment named the retired `editor/app/components/pipelines/buildBands.ts`. It now names `common/views/pipeline/buildBands.ts`. It also said the band's `blocked` "is this entry's missingInput"; it is `noTranscript` less the untranscribable and downloaded ones (`buildBands.ts:171-175`), so the sentence says that. Comment only |
-| `b4bd58a3` | `editor/scripts/measure-nav.mjs` (the brief said `plans/tools/`; it has always been under `editor/scripts/`). The six retired paths are `/api/pulse`, `/api/widget/{cleanable,actionable,sync}`, `/api/jobs/active` and `/api/workers`, which only reach a handler through `next.config.ts`'s rewrites. They are replaced by the `/api/view/<name>` paths the pages poll (`pulse`, `cleanable`, `widgetActionable`, `widgetSync`, `activeJobs`, `workers`), and the idle-pulse check uses `/api/view/pulse`. The 13 page routes were already current. Run once against the live :3001 (`--runs 1`, GETs only): no route or endpoint flagged, `/api/view/pulse` idle 8 ms |
-| *(this commit)* | this record, `[Unreleased]` bullets |
-
-**Gates** (worktree root). tsc (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`)
-clean before every commit. common **1751/1751** (1750 + 1). test:scripts **159 pass + 1 skip**
-(156 + 1 skip + the 3 new). editor unit **72/72**. mcp **219/219**. `pnpm --filter editor exec
-next build` ok (50 s). `pnpm --filter export exec next build` ok (34 s). Before the builds, the
-worktree's `export/public/archives` link was dangling, because the primary has no `archives/` at
-the moment; it was removed, and no dangling links were left. EDITOR e2e `availability
-availability-backfill maybe-missing` (from `$T/f-specs.txt`; Playwright's substring match also
-picked up `pre-clean-availability`): **15 passed, 0 failed, 2.0 min**, with no wait in the
-queue. Numbers: **none**. No file format changed; `availability.json` keeps its shape, and a
-410 video's value changes only when it is next checked.
-
-**Found and left.**
-- **`v7e07us` still reads `error` on disk.** Nothing here re-checks it (the brief forbids live
- checks). The next availability check or backfill that reaches it records `deleted`, and the
- `history` gains that entry.
-- **umtool's `check-availability.mjs` has its own classifier** (`classify`, which already matches
- a bare `410` as deleted). It differs from common's `parseUnavailableFromStderr`, and its states
- are different ones (`maybe_missing`, `geo-blocked`, `restricted`). It was left alone because
- it is umtool's editorial vocabulary, not a copy of the args table.
-- **`--sleep-requests 1` now applies to Rumble clip fetches too.** It comes with the table and
- adds about a second per request on a clip fetch; that is harmless, and one table is the point.
-- **measure-nav's `nav`/`prefetch` columns read ~0.1 kb on every route of the live editor.** That
- is the same for routes this commit did not touch. The state-tree encoding may have drifted with
- Next 16.2; this commit only replaced the paths, so it was not investigated.
-- **Commit trailers** name `Claude Opus 5.5 (1M context)`, as in release 5.
-
-### Phase 4 slice 1, as shipped — `buildDeployCore` to the core as `common/publish/build.ts` (2026-09-25)
-
-Branch `one-core/phase-4-s1` off `main` `93dcb532`; `main` moved to `4d97049f` (the follow-ups
-slice) mid-slice and was merged before the final gates. `editor/app/sites/lib/buildDeployCore.ts`
-(578 lines) imported nothing from `editor/**`, so it moved **unchanged** to
-`common/publish/build.ts`, the path `one-core.md` Phase 4 item 1 names. Only its header comment
-and its three `yt-dlp-transcript-common/*` imports (now relative, `../jobs`, `../lib`, as the rest
-of common writes them) changed. Every export, log line, exit code and path is the same. No helper
-had to come down from the editor with it.
-
-| sha | what |
-|---|---|
-| `9cb35c37` | `git mv` to `common/publish/build.ts`. `sites/lib/buildAction.ts` and `deployAction.ts` import `yt-dlp-transcript-common/publish/build`. **No re-export is left at the old path**: no spec, script or tool imports it (`git grep buildDeployCore` finds only docs and plans). `@aws-sdk/client-s3` and `@aws-sdk/lib-storage` (`^3.1080.0`) move from `editor/package.json` to common's `dependencies`. As in the follow-ups slice, a plain `pnpm install` re-resolved unrelated peer suffixes (`supports-color`), so the lockfile change was applied by hand (the two importer entries move from `editor:` to `common:`, 12 lines) and verified with `pnpm install --frozen-lockfile`. `common/package.json` also gains `"./publish/*": "./publish/*.ts"` in `exports` (the editor resolves common through `exports`, so the new directory needs its own pattern) and `publish` in the `test` glob. `architecture.test.ts` learns the layer: `publish/` may not import `views/` or `components/`, and `lib/` and `components/` may not import `publish/`. No back-edge was found and `ALLOWED` did not grow. New `publish/build.test.ts` (3) pins `resolveOutDir`, `dockerSiteOutDir` and `dockerSiteStagingDir`. `DEPLOY_CLOUDFLARE.md`'s pointer for `ARCHIVE_CACHE_CONTROL` (it still named the pre-IA `editor/app/deploy/` path) names the new home |
-| `2a31a863` | merge `main` `4d97049f` (release 6 follow-ups). Clean: that slice's `exports` lines sit between `./components/*` and `./lib/*`, and this one sits after `./views/*`. Then `pnpm install --frozen-lockfile` to create the new umtool → common link (`--offline` failed for want of cached metadata for `@next/env`; the online frozen install changed nothing on disk in git) |
-| `c8af2165` | this record, the `[Unreleased]` bullet, `plans/FACTS.md`'s `PREVIEW_SHARES_ARCHIVES_NOTICE` path |
-| `f2507e89` | (review fix) `architecture.test.ts`: the `jobs` and `controller` rows forbid `publish/` too, since dispatch sits below publish, and the failure message says so. Nothing imports that way, so it stays green |
-| *(this commit)* | (review fix) this record: how the editor build loads the SDK, `Dockerfile.build`'s extra install, the commit table |
-
-**Gates** on the merged tree (`2a31a863`, worktree root). After the review fix: tsc clean,
-common **1754/1754**, editor unit **72/72**. No e2e was rerun, since the fix changes no behaviour. tsc
-(`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) clean, and clean before
-`9cb35c37` too. common **1754/1754**: 1750 + 1 (follow-ups) + 3 (`publish/build.test.ts`); it was
-1753 before the merge. Editor unit **72/72**. test:scripts **159 pass + 1 skip** (the follow-ups
-count). mcp **219/219**. `pnpm --filter editor exec next build` ok (compiled in 18.6 s). With
-editor no longer depending on the SDK, `@aws-sdk/lib-storage` is bundled, and `@aws-sdk/client-s3`
-stays external: it loads through the symlink Next creates at
-`editor/.next/node_modules/@aws-sdk/client-s3-<hash>`, which points into `common/node_modules`.
-`pnpm --filter export exec next build` ok (7.8 s). The worktree's `export/public/archives` link
-was dangling (the primary has no `archives/` at the moment), so it was removed before the builds.
-EDITOR e2e `build deploy-page site-publish-preview sites-crud cut-release channel-build-toggle`
-(all six exist; `$T/p4-specs.txt`): **29 passed, 0 failed, 1.8 min**, with no wait in the queue.
-Numbers: `plans/tools/phase3-files-numbers.ts` over one frozen copy of the corpus
-(`FREEZE_TO`, 71 configs, 1,763 sidecars), `main` `93dcb532` against this branch (both
-before and after the merge): **diff empty** (3,858 lines each). `pnpm ops build-site` /
-`build-deploy` / `deploy-site` post to `editor/app/api/ops/*`, which call the same actions. They
-compile in the editor build and were not run, because a real build against the corpus is
-forbidden.
-
-**Left from Phase 4 item 1, by name.** The brief scoped this slice to the move. What `one-core.md`
-item 1 also lists is still to do, and most of it needs item 2's CLI first:
-- the named entry points `buildSite(id, opts)`, `deploySite`, `buildAll(mode)`, `composeHub` and
- `composeHomepage`. The orchestration that would become them (`runManagedFunction` jobs, the
- docker fallback, per-site queues) still lives in the editor's `"use server"`
- `sites/lib/buildAction.ts` / `deployAction.ts`;
-- `docker/build-site.sh` and `publish-site.sh` calling the CLI;
-- export's `build` / `build:nodata` twins becoming one script with `--nodata`;
-- `build:hub` getting a CLI and an editor entry.
-
-**Found and left.**
-- **`common/package.json` `exports` was on the list of files owned by the follow-ups slice.** The
- one-line `./publish/*` addition cannot be avoided if the spec's `common/publish/` path is kept:
- the editor resolves common through `exports`. It was made anyway and is its own line. `git
- merge-tree` against `one-core/r6-followups` was clean before that slice landed, and the real
- merge was clean too.
-- **`Dockerfile.build`'s export image now installs the AWS SDK too**, because it installs
- common's dependencies. That adds weight to the image and breaks nothing; the export never
- imports `publish/`.
-- `plans/STATE.md` still says Phase 4 is next and that `buildDeployCore.ts` imports nothing from
- the editor (`:73`, `:1485`). Status is the parent's to write, so those lines were not edited.
-- **Commit trailers** name `Claude Opus 5.5 (1M context)`, as in release 5.
diff --git a/plans/release-7.md b/plans/release-7.md
@@ -1,814 +0,0 @@
-# Release 7 — YouTube lane pacing + the archilyzer CLI, then ONE rollout (releases 6 + 7)
-
-Written 2026-09-25 morning on `main` `0032ed8a`. Verified by three Explore passes and one design
-pass; anchors are on `0032ed8a`. Operator decisions (2026-09-25): release 6 is NOT rolled out on its
-own; release 7 = two parallel slices + one rollout at the end that brings 6 + 7 live, editor restart
-AND umtool rebuild + restart; scope = pacing slice + CLI slice (Phase 4 slice 2 + the rest of spec
-item 1 + hub deploy path + the posts-only fix); Phase 4 slice 3 (config + docs, `doctor`, `run`,
-`mcp`) waits. Rules: `plans/tools/implementer-rules.md`. Record file: this file.
-
-## Context — where things stand
-
-- **Live on :3001:** `93dcb532` (releases 4 + 5), `BUILD_ID` `FKE60BTWpUiUa94WCSxTO`, next-server
- 888107. umtool on :3050: pid 5881, `BUILD_ID` `JKtTfoVrUbTosNENO3GMj` (Sep 22 build).
-- **`main` = `0032ed8a`**: release 6 merged — follow-ups `4d97049f` (410 → deleted; umtool gets the
- platform args through ONE table in `common/ytdlp/platformArgs.mjs`; atomic remote-transcript
- write; measure-nav) and Phase 4 slice 1 `cda35622` (`buildDeployCore.ts` → `common/publish/build.ts`,
- aws-sdk deps to common). Record `plans/release-6.md`.
-- **Rollout hazard already behind us:** `pnpm install` ran in the primary at 01:12 —
- `editor/node_modules/@aws-sdk` pruned, `common/node_modules/@aws-sdk/{client-s3,lib-storage}`
- present, `umtool/report-to-video/node_modules/yt-dlp-transcript-common → ../../../common` present.
- The live build's `editor/.next/node_modules/@aws-sdk/client-s3-3c41832e78b52e1d` resolves into
- `node_modules/.pnpm/` (safe while the old build serves). Install MUST precede the editor build.
- umtool changed in release 6 (4 files) → this rollout rebuilds + restarts umtool too; its jobs
- already spawn the new `build-video.mjs` from disk through the symlink.
-- **Why pacing:** `plans/youtube-lane-pacing.md` — the 2026-09-24 evening's three YouTube cooldowns
- were ONE Short (`quarteringvlogs/ncdPaDSqt-c`) retried 12× from the head of the queue; with
- `order: "listed"` the runner re-picks the same video after every cooldown and `fails` climbs to the
- 30-min cap; a manual Sync reads the same cooldown and is refused. Every retained YouTube 429 is the
- subtitle fetch, per video, not IP-wide. Also: `metadataScanStore.ts:250` never refreshes an
- identical error's `at`, so 142 members-only `legal-mindset` videos are re-scanned (cookie-authed,
- ~1 req/s) at EVERY runner start.
-- **Why the CLI now:** `build:hub` has no deploy path (the hub's `transcriptDownloads: false` is set
- but no hub was rebuilt); `export/package.json:26` `deploy` runs wrangler with NO `--project-name`;
- the `build`/`build:nodata` twins are identical bodies differing only by npm's `prebuild` hook;
- `docker/{build-site,publish-site}.sh` call `pnpm run build:nodata|build` directly.
-- **Posts-only 404 root cause** (jeralyzer `thequartering-X`): a social channel (`sourceKind:
- "social"`, `channelConfig.ts:25-28,116`) never enters the video scan so `count` stays 0;
- `buildIndex.ts:1052-1113` still writes `transcripts/<slug>/manifest.json` with `pageCount: 0`;
- `compose-site.ts:602-606` `reconcileChannelTree` computes `dirSignature(src, "manifest.json")`,
- gets `""` for a manifest-only tree and `rm(dest)` — while `corpus.ts:248` advertises
- `manifests.transcripts` unconditionally (and `llms.txt` at `corpus.ts:403`).
-- `archilyzer.pages.dev` answers 522 because the `homepage` package (Pages project `archilyzer`,
- `homepage/package.json:18`) has NEVER been deployed; the hub has never been deployed either.
- Operator decision 2026-09-25: keep them two apps on two projects (`archilyzer` = homepage,
- `archilyzer-hub` = the hub), cross-linked; both get their first deploy in this rollout.
-- Not in this release: the LM chat-only tier; "hub absorbs homepage".
-
-## Slice Y — YouTube lane pacing (branch `one-core/r7-pacing`)
-
-**Decision: the per-video deferral is PERSISTED beside `platformBackoff`, not in-memory.** `fails`
-already survives a restart (persisted at `autoRunner.ts:1965`, kept by `pruneExpired` on boot :1154);
-an in-memory deferral would make every restart (rollouts restart the editor) re-hit the same video
-at `fails+1`. The status view already reads `inputs.state[kind]` (`common/views/autoQueueStatus.ts:140`),
-and e2e can seed it exactly like `queues.spec.ts:48-61` seeds `platformBackoff`.
-
-1. **Pure helpers, `common/jobs/platformBackoff.ts`** (append; `nextBackoff` :31-40 untouched):
- `VideoDeferral = {until, channelSlug}`, `VideoDeferralState = Record<videoId, VideoDeferral>`,
- `VIDEO_RATE_LIMIT_DEFER_MS = 6 h`, `deferVideo`, `isVideoDeferred`, `pruneDeferred`,
- `coerceVideoDeferrals` (mirror `coercePlatformBackoff` :79). `platformBackoff.test.ts` +5.
-2. **State, `common/jobs/autoQueueState.ts`**: `AutoQueueKindState` :36-44 gains `videoDeferrals`;
- `emptyAutoQueueKindState` :56, `coerceKindState` :108-112, the trim in `writeAutoQueueState`
- :147-151. Old state without the key → `{}`; an older build ignores the key (rollback-safe).
- `autoQueueState.test.ts` +2.
-3. **The one seam, new `common/jobs/unitOutcome.ts`**: `applyUnitOutcome(state, unit, now, rand?) →
- {markCompleted, line}` — the body of `autoRunner.ts:1941-1963` moved and extended: `rate_limit` →
- `nextBackoff` + `deferVideo` + line `Auto-download: <pf> rate_limit — backing off <s>s (attempt
- <n>). <id> deferred 6h; next video after cooldown.`; `network` → backoff only (today's line);
- `transcribed` → `clearBackoff`; every branch `pruneDeferred`. `autoRunner.ts:1941-1963` becomes
- the call + `onLog(line)` + `markCompleted`; `persist()` :1965 unchanged. `unitOutcome.test.ts`
- (~6 cases incl. `fails` climbing only across distinct ids). This is the testable seam the plan
- file wanted (`runLoop` :1136 is not exported; `autoRunner.test.ts` covers only exports :6-14).
-4. **Pick filter + idle reason, `autoRunner.ts`**: boot prune :1154 adds `pruneDeferred`; the
- download branch :1648-1655 also drops ids with `isVideoDeferred` and sets `anyDeferred`;
- :1740-1741 → `anyCooling ? "cooldown" : anyDeferred ? "deferred" : "capped"`;
- `AutoRunnerIdleReason` :208-210 gains `"deferred"`; `editor/app/operations/components/dispatch.ts:152`
- gains the sentence `every pending video was rate-limited recently and is deferred` (exhaustive
- switch, tsc forces it). Manual Sync / download-missing do not consult deferrals (say so in the
- record; a manual retry still runs and on success clears the platform cooldown).
-5. **Scan-error `at` refresh, `metadataScanStore.ts:250`**: also rewrite when `Date.parse(now) -
- Date.parse(prev.at) >= METADATA_SCAN_ERROR_COOLDOWN_MS` (`now` is the ISO arg :219; the
- constant :334 is module-level). `metadataScanStore.test.ts` +2 (25 h later rewrites; 1 h leaves).
-6. **View, `common/views/autoQueueStatus.ts`**: `VideoDeferralView {videoId, channelSlug, untilMs}`;
- `AutoQueueKindStatus` :60 gains `deferred: VideoDeferralView[]`; `buildKind` :140-145 fills it.
-7. **Strip, `RunnerOperationView.tsx:196-225`**: render when cooldowns OR deferred; `CooldownStrip`
- becomes `<section role="region" aria-label="Rate-limit cooldown">` with the existing heading,
- `<ul aria-label="Platforms in cooldown">` (items unchanged), and when deferred: heading
- "Deferred videos — skipped by auto-download until:" + `<ul aria-label="Deferred videos">` with
- `<li>` `alpha/a1 — 5h 59m left` (link like `RecentPicks` :167-169). `formatCooldown`
- (`dispatch.ts:202-207`) gains an hours arm (grep callers first). **Accessible names, exact:**
- region `Rate-limit cooldown`; lists `Platforms in cooldown`, `Deferred videos`.
-8. **e2e, new `editor/e2e/pacing.spec.ts`** (copy `makeDownloadChannel` :110-149, `getStatus`/
- `pickOrder` :185-198, the settings block :772-779 from `auto-queue.spec.ts`):
- - T1 seeded: alpha `["a1","a2"]`; `state.json` `download.videoDeferrals = {a1: {until: now+1h,
- channelSlug: "alpha"}}`; start the runner; picks → exactly `["a2"]`; `idleReason === "deferred"`;
- `/operations/download` has `getByRole("region", {name: "Rate-limit cooldown"})` and
- `getByRole("list", {name: "Deferred videos"})` containing `alpha/a1`.
- - T2 live 429: **new fake sentinel `dl429`** in `fake-ytdlp.mjs` `modeYoutubeSingleUrlManaged`
- (:434-446): stderr `ERROR: [youtube] <url>: Unable to download video subtitles for 'en': HTTP
- Error 429: Too Many Requests`, exit 1 (`availability.ts:246` → `rate_limit`); the prefetch branch
- (:770-795, `urlSentinels` :143-157) still succeeds — the real two-spawn shape. alpha
- `["dl429vid1","a2"]`; poll `state.json` for `videoDeferrals.dl429vid1` + `platformBackoff.youtube
- .fails === 1`; then poll picks until `a2` (timeout 100 s; base cooldown 60 s ±10 %);
- `pickOrder` = `["dl429vid1","a2"]`. `test.setTimeout(150_000)`.
- - Keep green: `fetch-window queues rumble-sweep auto-queue lane-runner` (idleReason readers
- `auto-queue.spec.ts:1105`, `lane-runner.spec.ts:247,518`).
-9. **`sleepBetweenDownloadsSeconds` in the lane: OUT.** The failing attempts were already 93 s to
- 30 min apart; it would prevent none of the observed 429s and adds a second timer every fixture
- must neutralise. Ship the deferral alone so the first evening's log answers one question.
-10. Numbers: none (`state.json` is outside both numbers tools); say so. `videoDeferrals: {}` appears
- on all four lanes at the first persist after boot — the expected change outside the md5 baseline.
-
-Y owns: `common/jobs/{platformBackoff,autoQueueState,unitOutcome}.ts` (+tests),
-`common/controller/{autoRunner,metadataScanStore}.ts` (+test), `common/views/autoQueueStatus.ts`,
-`editor/app/operations/components/{RunnerOperationView.tsx,dispatch.ts}`,
-`editor/e2e/fixtures/bin/fake-ytdlp.mjs`, `editor/e2e/pacing.spec.ts`. Gates: rules' list; e2e
-`pacing fetch-window queues rumble-sweep auto-queue lane-runner`; numbers "none".
-
-## Slice C — the archilyzer CLI (branch `one-core/r7-cli`)
-
-1. **Parser: hand-rolled** (no `commander`/`yargs` in the workspace; `minimist` only transitively).
- `common/bin/_parseFlags.ts` gains `parseArgv(argv) → {flags, positionals}` beside `parseFlags` :4.
- New `common/bin/_cli.ts`: `Command = {path: string[], usage, run({positionals, flags, env}) →
- Promise<number>}`, `resolveCommand` (longest-path match), `usage()`. `common/bin/archilyzer.ts` =
- the table with lazy `await import("./compose-site")` per subcommand. `common/package.json` `test`
- glob gains `bin`. `_cli.test.ts`.
-2. **Bins become import-and-call.** `build-index`, `build-stats`, `build-chart-templates`,
- `build-archives`, `compose-site`, `compose-hub`, `compose-homepage`, `sync-tick`,
- `settings-example`, `file-schemas-docs` each `export async function main(opts)` and guard the
- auto-run with the `scripts/worktree.mjs:350` idiom (`import.meta.url === pathToFileURL(
- process.argv[1]).href`) so `tsx bin/x.ts` keeps working (`fileSchemaDocs.test.ts:25` names
- `bin/file-schemas-docs.ts`). Env → argument where a subcommand names it: `compose site <id>`
- passes `siteId` (`compose-site.ts:634` reads `SITE_ID` today; error if neither). Flag-driven bins
- (`_parseFlags` users) are untouched — `run <operation>` material for slice 3.
-3. **Named entry points, `common/publish/build.ts`** (thin, over the existing `run*`; keep every
- `run*` export, `build.test.ts` pins three): `buildSite(siteId, {paths, onLog, signal, skipData,
- skipArchives})`, `deploySite(siteId, {…, previewBranch})` (= `getSite` + `builtSiteProblem` +
- `runArchiveUploadIntoLog` + `runDeployIntoLog`, the body of `deployAction.ts:24-80` minus the
- pre-job refusals, which stay in the action), `buildAll({…, mode: "docker"|"basic", skipArchives})`
- (docker → `runDockerBuildAllPhase` :456; basic → the serial loop lifted from
- `buildAction.ts:328-360`), `composeHub`, `buildHub`, `deployHub`, `composeHomepage`. Editor
- actions keep `runManagedFunction` (`streamCommand.ts:289`) and call these.
-4. **Twins collapse + `prebuild`.** `runBuildPhase` :52-88 stops spawning `pnpm run build|build:nodata`
- and runs the steps itself: `!skipData` → `runHostScript(…, "build:data")` (already used :456),
- then `pnpm run compose:site` (env block :80-87), then `pnpm exec next build`, all in `export/`,
- same `[notice]` lines. Extract `buildSiteSteps(opts) → [{command, args, env}]`, pin it in
- `build.test.ts`. `export/package.json`: `build` → `tsx ../common/bin/archilyzer.ts build site`
- (`SITE_ID` from env; `pnpm run build -- --nodata` forwards), **delete `build:nodata` :18 and
- `prebuild` :16** (pnpm runs pre-scripts by default, no `.npmrc` override — `build.ts:59-63`), `build:hub`
- :19 → `… build hub`, `deploy` :26 → `… deploy site` (refuses without `SITE_ID`/project). Root
- `package.json`: `build:index` :8 → `archilyzer index`, `sync:tick` :9 → `archilyzer sync tick`;
- `build`/`build:export` stay aliases. `homepage/package.json:11-13` twins stay (different app).
-5. **Docker.** `docker/build-site.sh:40` → `pnpm --filter yt-dlp-transcript-common exec tsx
- bin/archilyzer.ts build site "$SITE_ID" --nodata`; `publish-site.sh:38` → `… build site "$SITE_ID"`.
- `Dockerfile.build` copies root/common/export `package.json` (tsx is in common devDeps :28);
- ENTRYPOINT :44 unchanged. `Dockerfile:246-253` copies every package.json → the editor image has
- the CLI.
-6. **Hub build + deploy.** The hub is `export` under `INSTANCE_MODE=hub` (`export/app/lib/site.ts:29-44`),
- out = `export/out` (shared with site builds, `resolveOutDir` :29). `buildHub` = `pnpm run
- compose:hub` then `INSTANCE_MODE=hub pnpm exec next build` in `export/`; before composing
- `rm -f public/site.json`, and symmetrically compose-site removes `public/hub-sites.json` (compose-hub
- touches only `hub-sites.json`, `compose-hub.ts:61-62`) so `out/` says what it is.
- `common/lib/builtExport.ts` gains `builtHubProblem(outDir)`. `deployHub` reads
- `getHomepageConfig(paths).cloudflareProject` — **the key, form field and writer already exist**
- (`common/lib/homepage.ts:33-34,83-86,144-147`, `HomepageConfigForm.tsx:56-62`,
- `homepageActions.ts:33-43`); refusal `The hub has no Cloudflare Pages project configured — set it
- on /sites under Hub.`; then `pagesDeployArgs({outDir, project, previewBranch})` (`pagesDeploy.ts:65`)
- via `runChildIntoLog`, mirroring `runDeployIntoLog` :267-300 incl. `deploymentUrlIn`. Editor:
- `editor/app/sites/lib/hubActions.ts` (`"use server"`): `buildHubAction`, `deployHubAction`,
- `buildAndDeployHubAction` → `runManagedFunction` kinds `build-hub` / `deploy-hub` /
- `build-deploy-hub`, queueKeys `"build"` / `"deploy"` (`buildAction.ts:38-39`). UI:
- `HubBuildButtons.tsx` (copy `BuildAllSitesButton.tsx:18-70` + `JobLane`) in the Hub section
- `editor/app/sites/page.tsx:181-197`. **Names, exact:** buttons `Build hub`, `Deploy hub`, checkbox
- `Deploy after build`; `JobLane` titles `Build hub` / `Deploy hub` / `Build & deploy hub`. Ops
- adapters: `editor/app/api/ops/{build-hub,deploy-hub}/route.ts`, `scripts/archilyzer-ops.mjs:95-100`
- ACTIONS + its test, `ops-api.spec.ts` +1 (deploy-hub refuses when the fixture `homepage.json` has
- no project). CLI: `build hub`, `deploy hub [--preview <b>]`.
- **Hub Pages project: `archilyzer-hub`** (operator decision 2026-09-25: two projects, cross-linked;
- the `homepage` package keeps `archilyzer` = https://archilyzer.pages.dev, never deployed yet).
- Rollout sets on `/sites` → Hub: Cloudflare project `archilyzer-hub` (today the file says
- `archilyzer` — the collision the design found) and `siteUrl` `https://archilyzer-hub.pages.dev`
- (`compose-hub.ts:69-86` needs it for the hub's `corpus.json`/`llms.txt`/`robots.txt`).
- **Cross-links (C owns):** the homepage hero (`homepage/app/page.tsx:79-85`, beside "Download the
- source" / "Read the setup guide") gets a "Search all archives" button to `homepage.json.siteUrl`
- (the hub's URL — the same field `hubSite()` reads; rendered only when set); the hub's footer
- "Built with Archilyzer" (`export/app/components/Footer.tsx:12,85`) already points at `PROJECT_URL`.
- **Docs:** `mcp/README.md:457,508` hub examples → `https://archilyzer-hub.pages.dev`; the hub-URL
- hints in `SETTINGS.md:486` / `settingsSchema.ts:1518` / `HomepageConfigForm.tsx:52` / `SiteForm.tsx:251`
- are checked and repointed if they name archilyzer.pages.dev as a hub. `README.md:13,474` and
- `SETUP.md:8,175` keep pointing at the homepage (docs + tarball) — unchanged. CLI also gains
- `build homepage` / `deploy homepage` (thin: `composeHomepage` + `next build` in `homepage/`;
- deploy = `pagesDeployArgs` with the constant project `archilyzer`, replacing the hardcoded
- `homepage/package.json:18` line) so the rollout deploys the homepage headlessly too.
-7. **Posts-only 404 — fix the composer, keep the contract.** `compose-site.ts:602-606`: when the
- signature is `""` but `src/manifest.json` exists, use a constant signature and copy the tree; a
- `pageCount: 0` manifest is exactly what "0 transcripts" means; `corpus.ts:248` stays
- unconditional, spec stays 4, readers untouched. New `common/bin/compose-site.test.ts` (export
- `reconcileChannelTree`; possible once step 2 guards `main()` :916): manifest-only tree copied,
- unchanged tree skipped, no manifest → removed. No export e2e can pin it (no spec reads
- `corpus.json`; fixture site has only `test-youtube`) — say so; `editor/e2e/build.spec.ts:10`
- pins the 0-transcript manifest on the index side.
-8. **Cut line.** Ships: `index`, `compose site <id>|hub|homepage`, `build site <id> [--nodata]
- [--skip-archives] | all [--skip-archives] | hub`, `deploy site <id> [--preview b] | hub [--preview b]`,
- `sync tick`, `settings example [--check]`. **Deferred to slice 3:** `doctor` (inputs
- `paths.ts:232-264`, `umtool/lib/tools.mjs probeTools` + `doctor.ts`, `scripts/worktree.mjs:16-28
- PORT_BASES`), `run <operation>`, `mcp`, "port defaults exist once".
-9. **Gates (C)**: tsc; common tests (+`_cli`, `compose-site`, `build`); editor unit 72; `pnpm run
- test:scripts` (159 + 1 → +N); `pnpm --filter editor exec next build`; `pnpm --filter export exec
- next build` (NOT `run build`); export e2e in full (192) + `e2e:hub` (8); editor e2e `sites-crud
- site-publish-preview build deploy-page cut-release channel-build-toggle ops-api`;
- `phase3-files-numbers.ts` diff-empty.
-
-C owns: `common/bin/**`, `common/package.json`, `common/publish/build.ts` (+test),
-`common/lib/builtExport.ts`, `export/package.json`, root `package.json`, `homepage/package.json`,
-`homepage/app/page.tsx` (hero button) + its e2e `homepage/e2e/marketing.spec.ts`,
-`docker/{build-site,publish-site}.sh`, `editor/app/sites/**`,
-`editor/app/api/ops/{build-hub,deploy-hub}/`, `scripts/archilyzer-ops.{mjs,test.mjs}`,
-`editor/e2e/ops-api.spec.ts`, `mcp/README.md` (hub URL examples), the hub-URL hint strings named
-above. Gates add the homepage e2e (`pnpm --filter homepage run e2e`, 5 specs — check the script name).
-
-**Overlap Y ↔ C: none.** Shared only `editor/CHANGELOG.md`, `plans/release-7.md`. Merge order Y → C
-(C merges `main` and re-gates). FACTS/STATE: parent, after both merge. Worktrees: `pnpm wt add
-one-core/r7-pacing` and `one-core/r7-cli` off `main`; symlink `export/public` per path; adding
-worktrees shifts port blocks. Reviews: Opus, read-only, `SHIP | SHIP AFTER FIXES | BLOCK`.
-
-## Rollout at the end (releases 6 + 7 together; ONE editor restart + umtool restart)
-
-Release-5 procedure (`plans/release-5.md` "## Rollout 2026-09-24 (night)") plus:
-1. Final suites on the merge sha in a detached worktree: editor full, export full, `e2e:hub`,
- and `TWO_ORIGIN_REBUILD=1 node scripts/worktree.mjs run -- pnpm --filter export run e2e:2origin`
- (its globalSetup runs `pnpm run build:hub`, which slice C made `archilyzer build hub`).
-2. Primary: `pnpm install --frozen-lockfile` (expected no-op; verify the three node_modules facts
- above). MUST precede the editor build.
-3. Numbers on the live corpus: settings (1,353 paths, diff empty), files (77 `unknown keys: []`,
- 3,839 lines) — no key changed in 6 or 7 (`cloudflareProject` on `homepage.json` predates both).
-4. md5 baseline: `settings.json` + 6 `site.json` + 71 `config.json` + `homepage.json` (79);
- `jq '.download|keys' .auto-queue/state.json` before (no `videoDeferrals`).
-5. Detached builds: editor into the live `.next` (`FKE60BTWpUiUa94WCSxTO` → new; then
- `readlink -f editor/.next/node_modules/@aws-sdk/client-s3-*` resolves into `node_modules/.pnpm/`);
- umtool (cwd `umtool/`, `JKtTfoVrUbTosNENO3GMj` → new).
-6. ONE editor restart (TERM pnpm + next-server cwd `editor/`, `setsid nohup pnpm run start -H
- 0.0.0.0`, `/` + `/tags` 200, no `ZodError`), then umtool restart (TERM 5881, its `start` on :3050,
- `/` 200).
-7. md5 sweep after boot: identical. `.download.videoDeferrals == {}` after the first unit.
-8. Smoke = release-4 script (eight `/api/view/*` pairs, 404s, presets, `?rev=`, pages) plus:
- `autoQueueStatus` `.download.deferred == []`; `/operations/download` 200 with NO `Rate-limit
- cooldown` region while nothing cools; `/sites` shows `Build hub` + `Deploy hub`; umtool `/` 200;
- **one site Build** `pnpm ops build-site {"siteId":"anilyzer","skipData":true,"skipArchives":true}
- --wait` exit 0 (proves the SDK resolves from common AND the reshaped build: compose + `next
- build`, no data phase, no `prebuild`).
-9. Hub + homepage, first deploys ever. On `/sites` → Hub set Cloudflare project `archilyzer-hub`
- and `siteUrl` `https://archilyzer-hub.pages.dev` (through the form; md5 of `homepage.json` moves
- once, expected). `pnpm ops build-hub --wait` (first ever hub build: `export/out/hub-sites.json`
- with five members, `corpus.json`), `pnpm ops deploy-hub --wait`;
- `curl https://archilyzer-hub.pages.dev/{hub-sites.json,corpus.json}` 200, federated search
- returns a hit from two different sites, the transcript modal has no export controls. Then the
- homepage: `archilyzer build homepage` + `deploy homepage` (project `archilyzer`) →
- `https://archilyzer.pages.dev/` 200 (no longer 522), `/docs/install/` 200,
- `/downloads/archilyzer-source.tar.gz` 200, hero shows "Search all archives" → the hub.
- The MCP quickstart `hub:https://archilyzer-hub.pages.dev#jeralyzer,…` then works — try one
- `list_sources` through it.
-10. Owed sync + md5: one `pnpm ops sync {"slug": <small youtube channel>} --wait`; only that
- `config.json`'s stamps move.
-11. 410 re-read: `rekietalaw-rumble/v7e07us` and the four quartering ids read `deleted` at their
- next check (observe, do not force).
-12. Pacing is live — a 429 cannot be provoked; proof = (i) the region + `deferred: []`, (ii) the
- first real 429's line `… (attempt 1). <id> deferred 6h; next video after cooldown.`, (iii) the
- next evening: `grep -h 'deferred 6h' transcripts/.jobs/*.log` — each id at most once per 6 h,
- `attempt N` climbing only across distinct ids, the owed sync never refused for a single-video
- cooldown. Scan-error refresh: the first runner start still bursts `legal-mindset`'s 142 cookie
- requests ONCE; a second restart within 24 h logs no re-scan.
-13. Record this file's "## Rollout", STATE head, FACTS section, memory; morning runbook
- (`~/reports/release-7/make-runbook.py` → `RUNBOOK.html`, the release-5 generator as the model).
-
-## Verification (end to end)
-
-Per slice: the rules' gate list + the spec lists above; Y numbers "none", C `phase3-files-numbers`
-diff-empty. Post-merge: step 1 suites; rollout steps 2-12 each with a recorded number. Y's live
-proof is the evening watch (12); C's is the site build (8) and the hub (9).
-
-## Hazards
-
-- **Labels are contracts.** New: region `Rate-limit cooldown`, lists `Platforms in cooldown` /
- `Deferred videos`, buttons `Build hub` / `Deploy hub`, lane titles above. Unchanged and asserted
- elsewhere: `Sync notice` + the `rate-limit cooldown` sentence (`queues.spec.ts:66`,
- `rumble-sweep.spec.ts:160`), heading `Build all sites` (`deploy-page.spec.ts:22,38`), `idleReason`
- values (`auto-queue.spec.ts:1105`, `lane-runner.spec.ts:247,518`).
-- **Runner state across restart**: deferrals persist by design; manual Sync/download-missing ignore
- them; an older build drops the key on its next write (rollback-safe).
-- **`Dockerfile.build`**: `runDockerBuildOne` mounts the host `build-site.sh` (:437-439) but the CLI
- and the new `export/package.json` are BAKED — an old image running the new script fails (old
- `build` still has `prebuild`). Check `ensureBuildImage`'s rebuild trigger; the first docker-mode
- build after C may need one `docker build -f Dockerfile.build`. Live rollouts use host mode.
-- **`export/package.json` `deploy` had no project name** — the CLI refuses without one. The hub
- is `archilyzer-hub`; the homepage stays `archilyzer` — `homepage.json` currently says
- `cloudflareProject: "archilyzer"` and MUST be changed on the form before `deploy hub`, or the
- hub overwrites the project page. `deployHub` refuses the literal value `archilyzer` as a guard.
-- **Hub vs homepage stay two apps** (decision 2026-09-25). The homepage owns the software's public
- paths (`/docs/install/`, `/downloads/archilyzer-source.tar.gz`, linked from README/SETUP/AGENTS)
- and `PROJECT_URL` is stamped into every footer and corpus generator string; the hub is one
- operator's federation. "Hub absorbs homepage" is a possible later slice (~30 files, 5 e2e, the
- docker `homepage` service), not this release.
-- **`prebuild` semantics**: the collapse works only because the data phase becomes an explicit step
- in `buildSite` and `prebuild` is deleted; `--nodata` still assumes a prior full build's staging.
-- **Shared `export/out`**: a hub build and a site build overwrite each other; `builtHubProblem` /
- `builtSiteProblem` refuse the wrong deploy — never rebuild silently.
-- **e2e timing**: T2 waits a real 60 s ±10 % cooldown; expect ~2 min behind the machine-global
- queue. `formatCooldown` needs the hours arm or a 6 h deferral reads `359m 58s`.
-- Session budget (memory `session-limit-pacing`): Y and C in parallel = the two heavyweight jobs of
- one window; reviews and the rollout in the next.
-
-## Then
-
-Phase 4 slice 3 (config + docs + `doctor`/`run`/`mcp`, `PUBLISH.md` absorbing `DEPLOY_DOCKER.md` +
-`DEPLOY_CLOUDFLARE.md`); the-quartering-rumble retry-cadence stamp only if live sweeps come back
-incomplete; the LM chat-only tier (operator config).
-
-## Record
-
-### Slice Y, as shipped — YouTube lane pacing (2026-09-25)
-
-Branch `one-core/r7-pacing` off `main` `6ee1d336`. `main` did not move during the slice. Every
-spec anchor was checked on `6ee1d336` before its edit, and all of them held at `0032ed8a` line
-numbers. Items 1 to 8 were built as written. Item 9 (`sleepBetweenDownloadsSeconds`) stays out.
-Item 10: no numbers were taken. The slice fixes two things. First, a rate-limited video is
-**deferred for 6 h** as well as backing its platform off, so when the cooldown lapses the runner
-picks the next video instead of re-picking the same one. The deferral is persisted beside
-`platformBackoff` so a restart honours it. Second, an identical metadata-scan error now refreshes
-its `at` once it is a cooldown old, so members-only ids stop being re-scanned at every runner start.
-
-| sha | what |
-|---|---|
-| `65dca073` | items 1 + 2. `platformBackoff.ts` appends `VideoDeferral {until, channelSlug}`, `VideoDeferralState`, `VIDEO_RATE_LIMIT_DEFER_MS` (6 h), `deferVideo`, `isVideoDeferred`, `pruneDeferred` (drops `until <= now`; there is no retention, since a deferral has no escalation memory) and `coerceVideoDeferrals` (mirrors `coercePlatformBackoff`). `nextBackoff` is untouched. `AutoQueueKindState.videoDeferrals` is added to the empty state, to `coerceKindState` (a missing or corrupt key becomes `{}`) and to the write trim. `platformBackoff.test` +5, `autoQueueState.test` +2; the existing "lane coerces to empty" deepEqual gained the key |
-| `71c755c8` | item 3. New `common/jobs/unitOutcome.ts` `applyUnitOutcome(state, unit, now, rand?) → {markCompleted, line}`. `rate_limit` runs `nextBackoff` + `deferVideo` and logs `Auto-download: <pf> rate_limit — backing off <s>s (attempt <n>). <id> deferred 6h; next video after cooldown.` `network` backs off with today's line and no deferral. `transcribed` calls `clearBackoff`. A unit with no platform (a non-download lane) touches neither map, as before. Every branch prunes. The block at `autoRunner.ts:1941-1963` is now the call + `onLog(line)` + `markCompleted` (still skipped on an operation lane), and `persist()` is unchanged. `unitOutcome.test.ts` has 7 cases, including "`fails` climbs only across distinct ids" |
-| `a9af6a0a` | item 4. The boot prune adds `pruneDeferred`. After the platform gate, the download branch drops pending ids with a live deferral and sets `anyDeferred` only when it actually dropped one. The idle reason is `anyCooling ? "cooldown" : anyDeferred ? "deferred" : "capped"`. `AutoRunnerIdleReason` gains `"deferred"`. `dispatch.ts` `idleReasonText` gains "every pending video was rate-limited recently and is deferred" |
-| `cb041841` | item 5. `metadataScanStore.ts` `upsertMetadataScan` also rewrites an identical error when `Date.parse(now) - Date.parse(prev.at) >= METADATA_SCAN_ERROR_COOLDOWN_MS`. The flush passes `new Date().toISOString()` as `now` (`ytdlp/metadataScan.ts:374-379`). `metadataScanStore.test` +2: 25 h later rewrites `at` and `updatedAt`; 1 h later leaves the file's mtime alone |
-| `04f5c9be` | items 6 + 7. `autoQueueStatus.ts` adds `VideoDeferralView {videoId, channelSlug, untilMs}` and `AutoQueueKindStatus.deferred` (live deferrals only, soonest first). `RunnerOperationView.tsx` draws the strip when there are cooldowns OR deferrals. The strip is `role="region"` `aria-label="Rate-limit cooldown"`. Under the existing heading is `<ul aria-label="Platforms in cooldown">` (items unchanged, drawn only when a platform cools). Then, when there are deferrals, the heading "Deferred videos — skipped by auto-download until:" and `<ul aria-label="Deferred videos">`, whose items read `alpha/a1 — 5h 59m left` with the id a `Link` to the video page, as `NextUp` does. **The region is a `<div role="region">`, not the `<section>` the spec wrote**: the strip sits inside the lane's own `<section>`, and the file's structural contract (`:30-32`) forbids a nested one because every `locator("section", {has})` in the suite would match two ancestors. The accessible role and name are the same. `formatCooldown` gains an hours arm (`5h 59m`, or `6h` when the minutes are zero). Its only caller is this strip, and platform cooldowns cap at ~33 min, so their text does not change |
-| `17dc70c0` | item 8. The fake's `dl429` sentinel is in `modeYoutubeSingleUrlManaged` only: stderr `ERROR: [youtube] <url>: Unable to download video subtitles for 'en': HTTP Error 429: Too Many Requests`, exit 1. The prefetch branch still succeeds, which is the real two-spawn shape. New `editor/e2e/pacing.spec.ts`. T1 seeds `download.videoDeferrals.a1` and checks: picks `["a2"]`, idle `deferred`, `deferred == [a1]`, and the region + `Deferred videos` list containing `alpha/a1` with no `Platforms in cooldown` list. T2 checks: `state.json` shows `videoDeferrals.dl429vid1` (slug `alpha`, > 5 h left) and `platformBackoff.youtube.fails === 1`; then, after the real ~60 s cooldown, picks become `["dl429vid1","a2"]` (`setTimeout(150_000)`) |
-| `ffe71f42` | e2e fix. T1's idle-sentence assertion hit two elements (the rail and the lane both draw the sentence, a strict-mode violation), so it now asserts `.first()` |
-| `5be6ceb5` | this record, `[Unreleased]` bullets, and the correction note at the top of `plans/youtube-lane-pacing.md` |
-| `8094615d` | (review fix) `common/views/activeJobs.ts` `autoIdleNote` gains `case "deferred"` with `dispatch.ts`'s exact sentence. It is now typed `AutoRunnerIdleReason \| null` with no `default` (`"stopped"` and `null` return null), so a new idle reason fails to compile here as it does in `idleReasonText`. `activeJobs.test` +1: a download runner idling `deferred` shows that sentence as the `Auto-download` lane's note |
-| `74c24b1f` | (review fix) `autoQueueStatus.test` +1 for `deferred`. Lapsed and boundary (`until === NOW`) entries drop. Out-of-order input comes out soonest first, and entries tied on `until` are ordered by `videoId`. The shape is `{videoId, channelSlug, untilMs}`, transcription gets `[]`, and a later injected clock drops the tied pair. The builder's tie-break changed from `localeCompare` to code-point order, so the strip's order does not depend on the server locale |
-| *(this commit)* | record: the two review-fix rows and the re-gate |
-
-**Gates** (worktree root, on `ffe71f42`). tsc (`pnpm -r --no-bail --workspace-concurrency=1 exec
-tsc --noEmit`) was clean before every commit. common **1770/1770** = 1754 + 5 (`platformBackoff`)
-+ 2 (`autoQueueState`) + 7 (`unitOutcome`) + 2 (`metadataScanStore`). Editor unit **72/72**.
-test:scripts **159 pass + 1 skip**. mcp **219/219**. `pnpm --filter editor exec next build` ok
-(compiled in 27.6 s). `pnpm --filter export exec next build` ok (10.5 s; no dangling links under
-`export/public`). EDITOR e2e, `$T/y-specs.txt` =
-`pacing.spec fetch-window.spec queues.spec rumble-sweep.spec auto-queue.spec lane-runner.spec`
-(all six exist):
-- run 0 (`y-e2e0-misscoped.log`): **aborted at test 6 of 642**. The brief's bare names
- (`pacing …`) are Playwright path regexes, and `pacing` matches the worktree path
- `one-core-r7-pacing/`, so every spec was selected. Killed along with its orphan servers on
- :3711/:3710 and its ollama stub; the list was rewritten with `.spec` suffixes. **A worktree whose
- path contains a spec's name needs the suffixed form.**
-- run 1 (`y-e2e1.log`): **44 passed, 1 failed, 3.9 min**. T1 failed on its last assertion, the
- strict-mode double match fixed in `ffe71f42`. T2 passed (1.1 min).
-- run 2 (`y-e2e2.log`, `pacing.spec` alone): **2 passed, 0 failed, 1.4 min**.
-- run 3 (`y-e2e3.log`, the full list on `ffe71f42`): **45 passed, 0 failed, 4.3 min**. No run
- waited in the queue.
-
-**Numbers: none.** `.auto-queue/state.json` is outside both numbers tools (settings: 1,353 paths;
-files: config/site/sidecars), and no `settings.json`, `site.json` or `config.json` key changed.
-**`videoDeferrals: {}` will appear on all four lanes of `state.json` at the first persist after
-the rollout boot.** That is the expected change outside the md5 baseline (rollout step 4 records
-`.download|keys` before). An older build drops the key on its next write, so rollback is safe.
-
-**Re-gate after the review fixes** (tip `74c24b1f`). `editor/.next/dev` was removed first:
-e2e run 3 had left a truncated generated `validator.ts` there, and it was the only file tsc
-failed on. tsc clean. common **1772/1772** (1770 + 1 `activeJobs` + 1 `autoQueueStatus`). Editor
-unit **72/72**. EDITOR e2e `pacing.spec` alone (`y-e2e4.log`): **2 passed, 0 failed, 1.8 min**.
-The fixes change no runner behaviour, only the `/jobs` note, a test, and a same-`until` tie-break,
-so the other five specs were not rerun. test:scripts, mcp and the builds were not rerun either,
-because the fixes touch no file they cover beyond `common/views`, which tsc checks.
-
-**Found and left.**
-- **Manual Sync and *download missing* do not consult deferrals**, by design. A manual retry of a
- deferred video still runs, and if it succeeds it clears the platform cooldown. It does not
- clear the video's deferral: the runner retires a fetched id anyway, because it leaves
- `undownloadedIds` at the next snapshot. A manual 429 goes through `recordDownloadBackoff` (a
- platform cooldown only, no deferral). That read-modify-write now carries `videoDeferrals`
- through, since `readAutoQueueState` coerces it.
-- **The runner does not merge deferrals from disk mid-run** the way it merges `platformBackoff`.
- Only the runner writes deferrals, so there is nothing outside it to merge. A deferral
- hand-seeded into `state.json` takes effect at the next runner start, which is what T1 does.
-- *(Fixed on review, `8094615d` / `74c24b1f`:)* `activeJobs.ts` `autoIdleNote` had no `deferred`
- case, and `autoQueueStatus.test.ts` had no `deferred` case. Ownership of both files was
- extended to Y for these fixes.
-- The plan file's step 3 (a `plans/FACTS.md` entry: the lane defers a rate-limited video; the
- cooldown escalates across distinct videos; YouTube 429s are per-video timedtext) is the
- parent's to write.
-- **Commit trailers** name `Claude Opus 5.5 (1M context)`, as the release-6 implementers did.
- `implementer-rules.md` still names Fable 5.1.
-
-### Slice C, as shipped — the archilyzer CLI, hub deploy path, posts-only fix (2026-09-25)
-
-Branch `one-core/r7-cli` off `main` `6ee1d336`. There is now one command line, `common/bin/archilyzer.ts`,
-over the publish layer and the bins. `common/publish/build.ts` has named entry points (`buildSite`,
-`deploySite`, `buildAll`, `buildHub`, `deployHub`, `composeHub`, `composeHomepage`, `buildHomepage`,
-`deployHomepage`), and the editor's jobs call the same ones. export's `build` / `build:nodata` twins
-and the `prebuild` hook are gone. The data phase is now an explicit step, so `pnpm run build` in
-`export/` can be the CLI without running itself. The hub now has a build and deploy path: on
-`/sites`, through `pnpm ops`, and through the CLI. The homepage deploys through the CLI. The
-posts-only 404 is fixed in the composer, and the contract is unchanged. Items 1–8 of the spec are
-done. `doctor`, `run` and `mcp` were not started (the cut line).
-
-| sha | what |
-|---|---|
-| `66f138cd` | `_parseFlags.ts` gains `parseArgv(argv, booleans) → {flags, positionals}` beside `parseFlags`. A declared boolean never takes the next word as its value (`build site --nodata jeralyzer`), and a lone `--` is skipped. The skip matters because pnpm 11 hands `pnpm run build -- --nodata` to the script as `-- --nodata`, `--` included (checked in scratch). New `_cli.ts`: `Command = {path, usage, flags?, maxPositionals?, run}`, `resolveCommand` (longest path), `argumentProblem` (unknown flag, a boolean given a value, a string flag given none, extra positionals), `usage`, `runCli` (a refusal exits 2 before `run`). `Command` gained `flags` and `maxPositionals` on top of the spec's `{path, usage, run}`, so a typo such as `--preveiw` is refused before a deploy runs instead of shipping production. The `test` glob gains `bin`. `_cli.test.ts` (9) |
-| `d97b6ad8` | The ten bins (`build-index`, `build-stats`, `build-chart-templates`, `build-archives`, `compose-site`, `compose-hub`, `compose-homepage`, `sync-tick`, `settings-example`, `file-schemas-docs`) `export async function main(opts)` and auto-run through `runIfEntryPoint(import.meta.url, …)`. That is the `worktree.mjs:350` idiom with both sides realpath'd, because `import.meta.url` is always the real file and argv[1] can reach it through a workspace symlink. A returned number becomes `process.exitCode` without cutting the process short, and a throw prints and exits 1, as before. `compose-site` `main({siteId})` falls back to `SITE_ID` and throws when there is neither. It used to `process.exit(1)`. `sync-tick` `main()` returns 1 on an HTTP error, and `tick()` keeps the old `request failed:` line. `archilyzer.ts` is the table, with lazy `import()` per row. Root `build:index` → `archilyzer index`, `sync:tick` → `archilyzer sync tick`. Flag-driven bins (`_parseFlags` users) are untouched |
-| `5dabc262` | `buildSiteSteps({siteId, paths, skipData, skipArchives, baseEnv}) → [{command, args, cwd, env}]` lists the steps: `pnpm run build:data` (unless skipData), `pnpm run compose:site`, then `pnpm exec next build`. All three run in `export/` with the old env block (NODE_ENV, TRANSCRIPTS_DIR, EXPORT_PUBLIC_DIR, SITE_ID, and BUILD_ARCHIVES=0 when archives are skipped). The data phase keeps the env the old `prebuild` inherited, EXPORT_PUBLIC_DIR included, rather than `runHostScript`'s narrower one, which matters for the e2e server's `.export-public`. `runBuildPhase` runs the steps with the same `[notice]` lines. Named entry points: `buildSite`, `deploySite` (the preview, project and built-bundle refusals, then R2, then Pages; it throws the deploy job's exact sentences) and `buildAll({mode: "docker"\|"basic"})` (the serial loop lifted from `buildAllSitesAction`). `build-export`, `build-deploy` (its build half), `deploy-export` and `build-all` call them, and their pre-job refusals stay in the actions. export: `prebuild` and `build:nodata` deleted, `build` → `archilyzer build site`, `deploy` → `archilyzer deploy site` (it names the site's project and refuses without one). CLI gains `build site`, `build all` and `deploy site`. `build site` refuses an id with no `site.json`, because a missing site reads as defaults and would otherwise run the whole data phase first. `build.test.ts` +2 |
-| `e8460a16` | `docker/build-site.sh` → `pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts build site "$SITE_ID" --nodata`, `publish-site.sh` → `… build site "$SITE_ID"` |
-| `077fcba4` | Hub and homepage entry points. `buildHubSteps` runs `compose:hub`, then `next build` with `INSTANCE_MODE=hub`, in `export/`. `buildHub` removes `public/site.json` first. `compose-site` now removes `public/hub-sites.json`, the one other line in that bin, so `out/` says which one it holds. `builtHubProblem(outDir)` (`builtExport.ts`, +1 test): a `site.json` means a site's bundle, even with a stale `hub-sites.json` beside it. `hubProjectProblem` refuses a missing project with the spec's sentence, and refuses `archilyzer` (`HOMEPAGE_PAGES_PROJECT`) by name. `deployHub` reads `getHomepageConfig(paths).cloudflareProject` and runs `pagesDeployArgs` through `runChildIntoLog`, with the `deploymentUrlIn` / `[preview]` line of `runDeployIntoLog`. `buildHomepage` is `pnpm run compose` then `next build` in `homepage/`. `deployHomepage` ships `homepage/out` to `archilyzer` with `--branch main`, as the hardcoded `homepage/package.json` line did (refused when there is no `out/index.html`). CLI: `build hub`, `deploy hub [--preview]`, `build homepage`, `deploy homepage`. export `build:hub` and homepage `deploy` call it. `build.test.ts` +2 |
-| `c82aad09` | `editor/app/sites/lib/hubActions.ts`: `buildHubAction` (kind `build-hub`, queue `build`), `deployHubAction` (`deploy-hub`, `deploy`) and `buildAndDeployHubAction` (`build-deploy-hub`, `deploy`). Before any job, they refuse a bad preview, a missing project or the homepage's project, and (deploy-only) a bundle that is not the hub. `HubBuildButtons.tsx` sits under the Hub form, in a group named `Hub build`: button **Build hub**, checkbox **Deploy after build** (unchecked by default, unlike the all-sites batch, because the first hub deploy should be a choice), button **Deploy hub**, lanes **Build hub** / **Build & deploy hub** / **Deploy hub**. The Hub section's copy now says the hub and the homepage are two projects. `/api/ops/build-hub` `{deploy?, preview?}` (a preview without deploy is a 400) and `/api/ops/deploy-hub` `{preview?}` (→ `previewUrl`). `archilyzer-ops.mjs` ACTIONS + usage + test (+1). `ops-api.spec` +1: no project, `archilyzer`, and not-a-hub-build are each refused, and no job starts. Hub-URL hints → `https://archilyzer-hub.pages.dev`: `HomepageConfigForm` placeholder (plus an `archilyzer-hub` placeholder on the project field), `SiteForm` Hub URL hint, `settingsSchema` `homepageUrl` (+ `SETTINGS.md` regenerated through `archilyzer settings example`), `mcp/README.md` :457, :508 |
-| `c66b9d4a` | Homepage hero: **Search all archives** → `homepage.json` `siteUrl` (the field `hubSite()` reads), rendered only when set. `marketing.spec` +1, conditional like the rail test: absent is legal, and a present link must be absolute |
-| `baa7ef45` | Posts-only 404. When the signature is `""` but `src/manifest.json` exists, `reconcileChannelTree` (now exported) copies the tree under the constant `MANIFEST_ONLY_SIGNATURE`. `corpus.ts` is untouched and spec stays 4. New `bin/compose-site.test.ts` (3): a manifest-only tree is copied (then skipped when unchanged, re-copied once pages arrive), an unchanged tree is skipped, and a member with no manifest is removed and a non-member pruned. Two of the three fail with the fix reverted (checked) |
-| `e4b5376c` | this record, four `[Unreleased]` bullets |
-| `bc2d9fb6` | (review fix) `DEPLOY_CLOUDFLARE.md:40-45`: every deploy path uploads to R2 and only a build stages. The review's replacement text said the credentials come from `settings.json`; only the bucket does, and the credentials come from the environment, so the text says that. Settings `homepageUrl` hint and `homepage.ts` comments → `archilyzer-hub` (never `archilyzer`). `compose site` with no id → `siteIdFrom` (one line, exit 2) |
-| `d1ba90e9` | merge `main` `7b79a945` (slice Y at `2497d20b`). Only `plans/release-7.md` conflicted (both records, Y's first). `editor/CHANGELOG.md` auto-merged, and the lockfile did not move |
-| *(this commit)* | (review fix) this record: the Pages-project bullet corrected, the 2origin line, rollout step 1 gains `e2e:2origin`, the found-and-left additions, the re-gate |
-
-**The CLI as shipped** (`pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts …`, or
-`tsx ../common/bin/archilyzer.ts …` from `export/` / `homepage/`; `--help` anywhere):
-
-| command | does |
-|---|---|
-| `index` | `buildIndex` (the LMDB index) |
-| `compose site [<id>]` | compose-site `main({siteId})`, id else `SITE_ID` |
-| `compose hub` / `compose homepage` | compose-hub / compose-homepage `main()` (in-process) |
-| `build site [<id>] [--nodata] [--skip-archives]` | `buildSite`: data phase + compose + `next build` into `export/out`; refuses an unknown id |
-| `build all [--skip-archives]` | `buildAll`: docker fan-out when `docker version` answers, else serial host (as the editor's action decides) |
-| `build hub` | `buildHub` → `export/out` |
-| `build homepage` | `buildHomepage` → `homepage/out` (reads the index as it stands) |
-| `deploy site [<id>] [--preview <b>]` | `deploySite`: refusals, R2, Pages |
-| `deploy hub [--preview <b>]` | `deployHub` → `homepage.json` `cloudflareProject` (never `archilyzer`) |
-| `deploy homepage` | `deployHomepage` → project `archilyzer`, branch `main` |
-| `sync tick` | sync-tick (`SYNC_TICK_URL`, `SYNC_TICK_TOKEN`) |
-| `settings example [--check]` | settings-example `main({check})` |
-
-Exit codes: 0 ok, 1 failed or refused by the entry point, 2 usage (unknown command or flag, no site).
-
-**Gates** (worktree root, final tree before this commit). tsc clean at every commit. common
-**1771/1771**: 1754 + 9 `_cli` + 4 `build` + 1 `builtExport` + 3 `compose-site`. Editor unit
-**72/72**. test:scripts **160 pass + 1 skip** (159 + 1 ops). mcp **219/219**.
-`pnpm --filter editor exec next build` ok (compiled in 29.8 s, `/api/ops/build-hub` and
-`/api/ops/deploy-hub` listed). `pnpm --filter export exec next build` ok (12.5 s, no dangling
-`export/public` links). EDITOR e2e `sites-crud site-publish-preview build deploy-page cut-release
-channel-build-toggle ops-api` (all seven exist; `$T/c-specs.txt`): **49 passed, 0 failed, 2.9 min**,
-after 1m33s in the queue behind slice Y. EXPORT e2e in full (`node scripts/worktree.mjs run -- pnpm --filter export run e2e`, no dangling
-links): **192 passed, 0 failed, 7.4 min**.
-`e2e:hub` (`… pnpm --filter export run e2e:hub`): **8 passed, 16 s**.
-Homepage e2e (`… pnpm --filter homepage run e2e`, five specs): **15 passed, 7 skipped, 0 failed,
-33 s**. The 7 skips are `stats.spec.ts`'s `test.skip(noData, …)`: the worktree has no corpus data.
-The new hub-link test took its "absent" branch here, because the worktree has no `homepage.json`.
-Numbers: `plans/tools/phase3-files-numbers.ts` over one frozen copy (`FREEZE_TO`, 71 configs,
-1,763 sidecars; `TMPDIR=$T`), `6ee1d336` against this branch: **diff empty** (3,859 lines each).
-No build, deploy, compose or data build ran against the real corpus. The CLI's refusal paths were
-exercised in the worktree, which has no corpus: an unknown site, `--preview main`, no id, no
-project, no hub project and no homepage build.
-
-**Re-gate after the review fixes and the merge of `main` `7b79a945`** (tree `d1ba90e9` + record;
-`rm -rf editor/.next/dev`, lockfile unchanged). tsc clean. common **1789/1789** (1772 on `main`
-+ 17 from this slice). Editor unit **72/72**. test:scripts **160 + 1 skip**. mcp **219/219**.
-`next build`: editor ok (14.7 s), export ok (7.4 s). Numbers (the same frozen copy) against the
-`6ee1d336` run: **diff empty**. EDITOR e2e, the seven specs + `pacing.spec`
-(`$T/c-specs-merged.txt`, `.spec` suffixes): **51 passed, 0 failed, 3.1 min**. EXPORT full:
-**192 passed, 6.0 min**. `e2e:hub`: **8 passed, 15 s**. `e2e:2origin` with
-`TWO_ORIGIN_REBUILD=1`: **3 passed, 40 s** (73 s including two `archilyzer build hub` runs).
-The log shows `$ tsx ../common/bin/archilyzer.ts build hub` and `compose-hub: 0 built-in pool
-site(s)`. The build runs twice because `globalSetup` is called at config load in the runner and
-again in the worker, and `TWO_ORIGIN_REBUILD=1` clears the cache each time. That was already
-true before this slice. The primary's `export/public` files kept their mtimes (checked).
-Homepage: **15 passed, 7 skipped, 25 s**.
-
-**Found and left.**
-- **No export e2e pins the posts-only fix.** No spec reads `corpus.json`, and the fixture site has
- only `test-youtube`, with no social channel. The composer is pinned by `compose-site.test.ts`,
- and the index side (a `pageCount: 0` manifest for a channel with no transcripts) by
- `editor/e2e/build.spec.ts:10`. The live proof is `curl
- https://jeralyzer.pages.dev/transcripts/thequartering-X/manifest.json` returning 200 after the
- next jeralyzer build + deploy. That build needs no `--nodata` caveat, because the staging already
- has the manifest.
-- **`Dockerfile.build` needs nothing.** It installs root + common + export `package.json` (tsx is
- in common's devDependencies, and no `NODE_ENV=production` is set at install), then
- `COPY . .`, so the CLI and the new `export/package.json` are baked from source. Every docker
- fan-out calls `ensureBuildImage` (`docker build`, with cached layers reused) before Phase B, and
- mounts the host `build-site.sh` over the baked one, so the editor's docker path never runs the
- new script on an old image. Only an image built BEFORE this slice and run by hand, outside the
- editor, would find `build:nodata` missing. The runtime `Dockerfile` copies all seven
- `package.json` files and installs dev dependencies in its build stage, so `publish-site.sh`
- has tsx too.
-- **A queued deploy now re-checks the bundle when it starts.** `deploySite` / `deployHub`
- repeat the pre-job refusals inside the job. A deploy queued behind another site's build (which
- is on the `build` queue, so they do not serialize) used to ship whatever that build left in
- `export/out`. It now refuses. This is new behaviour, and deliberate.
-- **Two more hub-URL examples still name `archilyzer.pages.dev`**, outside this slice's files:
- `editor/app/settings/components/SettingsForm.tsx:48` (the `homepageUrl` hint, which now
- disagrees with `SETTINGS.md`) and the comment at `common/lib/homepage.ts:31`. Both are one-line
- changes for slice 3. `DEPLOY_CLOUDFLARE.md:41` still says a raw `pnpm deploy` from `export`
- only stages archives. `pnpm run deploy` is now `archilyzer deploy site`, which uploads them.
- That doc is due to be absorbed into `PUBLISH.md` in slice 3. `settingsSchema.ts:417,433`
- ("basic — `pnpm run build` in export/") is still true, since that script is now the CLI.
-- **A Pages project must exist before its first deploy.** *(Corrected after review; the first
- version of this bullet was wrong.)* wrangler offers to create a missing project only when
- `process.stdin.isTTY` is set. `runChildIntoLog` spawns it with piped stdin, both from an
- editor job and from the CLI in a terminal, so it never gets that prompt. It fails at once
- with wrangler's own "The Pages project … does not exist" sentence, and it never hangs. So the
- projects are created first, with `pnpm dlx wrangler pages project create <name>
- --production-branch main`. **Done by the parent on 2026-09-25:** `archilyzer-hub` was created
- (empty). `archilyzer` already existed, with no deployment. Rollout step 9 therefore needs no
- project creation. Run `pnpm dlx wrangler pages project list` first to confirm both are there.
-- `build homepage` does not rebuild the index. The homepage's own `pnpm run build` still does,
- through its `prebuild` (its twins were left as they were, as specified). Run `archilyzer index`
- first when the index is stale.
-- The `build-deploy` action's deploy half still calls the `run*` phases directly. It has its own
- banners (a leading newline, no second built-bundle check straight after its own build), which
- `deploySite` would change.
-- `common/lib/builtExport.test.ts` gained a test. It is the test of an owned file, but not on
- the ownership list by name.
-- **`export/e2e-2origin/globalSetup.ts:142` runs `pnpm run build:hub`**, which is now
- `archilyzer build hub`. That command removes `public/site.json` first and sets
- `NODE_ENV` / `TRANSCRIPTS_DIR` / `EXPORT_PUBLIC_DIR`. The suite caches its hub bundle
- (it skips the build when `hubA/sw.js` exists), so it was run with `TWO_ORIGIN_REBUILD=1` on
- the merged tree (see the re-gate below). In a worktree, `export/public` entries are symlinks
- into the primary, and compose-hub writes through them. For that run, the files the hub build
- writes or removes (`site.json`, `hub-sites.json`, `corpus.json`, `llms.txt`, `robots.txt`,
- `_headers`, `sw.js`) were replaced with real copies first, and the symlinks were restored
- afterwards. The old `build:hub` wrote through them in the same way.
-- **A production `deploy hub` takes its branch from the git checkout** (no `--branch`). This
- matches `runDeployIntoLog` for sites, and was left as it is by the parent's decision. Run from
- a non-`main` checkout, it would become a preview. `deploy homepage` passes `--branch main`.
- Step 9 runs from the primary on `main`.
-- **The homepage hero test was not given a positive fixture (review L7, optional).** The
- homepage suite has no fixture tree. Its `next dev` reads `getPaths()` with no
- `TRANSCRIPTS_DIR` override, so seeding a `homepage.json` from a spec would write
- `transcripts/sites/_homepage/homepage.json`: in the primary, the real corpus's file. It stays
- conditional. Step 9 checks the link live.
-- **`--preview` takes the next word** (review L6): `deploy site --preview jeralyzer` reads
- `jeralyzer` as the branch and takes the site from `SITE_ID`. The result is always a preview,
- never production. The usage text puts `<id>` first.
-- **Commit trailers** name `Claude Opus 5.5 (1M context)`, as in releases 5 and 6.
-
-
-### Slice K, as shipped — `pnpm ops keep-videos` (2026-09-25)
-
-Branch `one-core/r7-keep` off `main` `3049be43`. The operator's ask: "I've just added the Paramount
-Tactical channel — mark anything that includes TheQuartering in title or description as 'keep the
-video', with an ops command." "Keep the video" is the existing per-video **do-not-clean** marker
-(`data/<id>/do-not-clean.json`, `setDoNotClean`). The clean sweep, extra-format cleanup,
-wrong-format removal, the superseded-subs purge and saved-video eviction already honour it. Before
-this slice there was only the per-video toggle: no bulk form and no ops action. The slice adds the
-loop around the marker and no new kind of protection. Two facts shaped it:
-- **Text lives in two places only.** A downloaded video's `metadata.info.json` is read first,
- then the channel's `metadata-scan.json` entry. An id known only from `playlist` / `roster.json`
- has no text and is counted (`unscanned`), not guessed.
-- **`setDoNotClean` does not mkdir, and nothing here creates `data/<id>/`.** A matched video with
- no dir is reported in `notDownloaded`. Creating the dir would break the scan store's invariant,
- and every enumerator reads a dir as "fetched".
-
-"Matches" is the download filter's matcher. The pattern is compiled by `compileDownloadFilter({include})`
-and tested by `classifyAgainstFilter` over `downloadFilterText` (title + "\n" + description, with
-the description capped at 2 KB as the filter caps it), after `downloadFilterPatternProblem` (the
-form's ReDoS guard). There is no second matcher. `fields` narrows the subject by passing the
-left-out field as `""`. **The media guard runs first** (`assertChannelMediaReachable`):
-`listChannelVideoIds` swallows ENOENT, so on an unmounted relocated channel every downloaded match
-would otherwise read as `notDownloaded`.
-
-| sha | what |
-|---|---|
-| `8f9b0fc6` | `common/controller/keepVideosMatching.ts`: `keepVideosMatching({paths, channelSlug, pattern, fields?, note?, dryRun?})` returns `{pattern, fields, considered, matched: [{id, title, downloaded, alreadyKept, marked}], marked, alreadyKept, notDownloaded, unscanned, noMetadata, dryRun}`, and `KeepVideosError` covers a bad or unsafe pattern, a bad field and an unknown channel. The default note is `keep-videos: matched /<pattern>/i`. `noMetadata` is **additive to the brief's shape**: a data dir with no `metadata.info.json` and no scan entry has a dir but no text, so it is counted rather than silently skipped. `.test.ts` has 6 cases: title + description-only + case-insensitive; already-kept counted with its mtime and note unchanged; scan-only goes to `notDownloaded` with no dir created and `unscanned` = 2; dry run; `fields:["title"]`; the typed error for `(`, a nested quantifier, an unknown field and an unknown channel |
-| `22ec333b` | `keepVideosAction` in `videoActions.ts`, beside `toggleDoNotCleanAction`. It maps `KeepVideosError` / `ChannelMediaUnreachableError` to `{ok: false, error}`. When `marked > 0` it calls `revalidatePath` for each marked video and the channel page, and `requestChannelSnapshot` **once** |
-| `f11c5a72` | `editor/app/api/ops/keep-videos/route.ts`, an adapter with keys `slug, match, fields, note, dryRun` (`reqSlug`; `fields` must be a non-empty array of `"title"`/`"description"`) that returns `{ok: true, ...result}`. `scripts/archilyzer-ops.mjs` ACTIONS gains `keep-videos`, and `archilyzer-ops.test.mjs` +1. `ops-api.spec.ts` +1 covers: a seeded `20240102_keepme12345` titled "Reacting to THEQUARTERING" plus a scan-only `scanonly123` with a description hit. The dry run writes nothing; the real call gives `marked: 1` and `notDownloaded: ["scanonly123"]`, puts the marker only under the matching id, and creates no dir for the scan-only id. An unknown key returns 400 and `(` returns 400 |
-| `73be3573` | `RUNNING_IN_DOCKER.md`, "Driving the editor without a browser": an example line and a bullet for the two-step reality (`metadata-scan` first, `notDownloaded` then `download-missing`, then re-run) |
-| *(this commit)* | this record and the `[Unreleased]` bullet |
-
-**Gates** (worktree root, on `73be3573`). tsc (`pnpm -r --no-bail --workspace-concurrency=1 exec
-tsc --noEmit`) was clean on the full tree before the commits were made. The four commits are
-additive, in dependency order. common **1795/1795** = 1789 + 6 (`keepVideosMatching`). Editor unit
-**72/72**. test:scripts **161 pass + 1 skip** (160 + 1). mcp **219/219**. `pnpm --filter editor
-exec next build` ok, and `.next/server/app/api/ops/keep-videos` was emitted. The export build was
-not run, because the slice touches no file under `export/` and no `common/` module it imports.
-EDITOR e2e, `$T/k-specs.txt` = `ops-api.spec.ts` (`k-e2e1.log`): **21 passed, 0 failed, 58.9 s**,
-after a 4 m 58 s queue wait behind the release's final suites. All heavy steps were started only
-at ≥ 3 GB available memory, as the brief required.
-
-**Numbers: none.** No `settings.json`, `site.json` or `config.json` key changed. The action writes
-only per-video `do-not-clean.json` sidecars, and only when someone runs it.
-
-**Not merged with `main` `211d4666`.** The coordinator asked for `git merge main` before the final
-gates (a test-only commit in the deploy-hub region of `ops-api.spec.ts`). The merge was **refused by
-the session's permission classifier**, so the branch is still on `3049be43`. `git merge-tree
---write-tree HEAD main` reports a **clean** merge. The parent's merge takes it as is, and the
-`ops-api.spec` run above does not include `211d4666`'s edit.
-
-**Found and left.**
-- **The rule-shaped alternative is not built.** This is a one-shot action: a video downloaded
- *after* the run is not marked. A persistent per-channel "keep filter" (say `keepFilter.include`
- in `config.json`, evaluated at download time and by the cleaners) would keep future matches too.
- That is a schema change (CHANNEL.md, numbers), so it is out of scope here. Until then, re-run
- `keep-videos` after new downloads. It is idempotent: already-kept videos are counted, not
- rewritten.
-- There is no UI surface. The action exists for a future bulk bar or channel-page control.
-- `keepVideosMatching.ts` has its own 12-line `readPlaylistIds`. The same helper is duplicated
- privately in `ytdlp/metadataScan.ts` and `controller/recencyIndex.ts`, and neither is exported.
- A third copy was cheaper than reshaping two files outside this slice's ownership.
-- `unscanned` compares playlist/roster ids with dir names. A legacy dir named `YYYYMMDD_<id>` does
- not equal its playlist id, so such a channel over-counts `unscanned`. The count is advisory.
-- **Commit trailers** name `Claude Opus 5.5 (1M context)`, as the release-6 and release-7
- implementers did.
-
-## Rollout 2026-09-25 (afternoon) — `bb3dbb4c` live on :3001 (releases 6 + 7 together)
-
-ONE editor restart and ONE umtool restart, at the end of release 7, as the plan said: release 6
-changed umtool (4 files), so this rollout rebuilt and restarted both. The live editor had served
-`93dcb532` (releases 4 + 5, `BUILD_ID` `FKE60BTWpUiUa94WCSxTO`) since the release-5 night. `main`
-moved during the rollout: `0032ed8a` → `6ee1d336` (this plan) → `2497d20b` (merge Y, tip
-`e60ac2f4`) → `7b79a945` (plans nit) → `3049be43` (merge C, tip `dbe35c51`) → `211d4666` (the
-deploy-hub e2e guard, below) → `ac2c4aee` (merge K, tip `374bdae7`, the operator's mid-rollout
-ask) → **`bb3dbb4c`** (K's two review doc nits) — the sha that went live. Every slice had an Opus
-read-only review: Y and C were SHIP AFTER FIXES then SHIP on re-review (Y's fixes `8094615d`,
-`74c24b1f`, `e60ac2f4`; C's `bc2d9fb6`, `d1ba90e9`, `dbe35c51`); K was SHIP AFTER FIXES with two
-doc nits, applied by the parent in `bb3dbb4c`.
-
-**Step 1 — final suites on `3049be43`** (worktree `one-core-r7-cli` detached at the merge sha,
-ports 3601/3611/3610; logs `final-e2e-r7-{editor,export,hub,2origin}.log`). EDITOR: **626 passed,
-5 failed, 12 skipped, 53.1 min**. Slow because the machine sat at 14/15 GB RAM plus 8–14 GB of
-swap: the LIVE editor's parakeet transcription worker held 2.3 GB. Four of the five failures were
-load timeouts — `channel-storage.spec.ts:79` (ECONNRESET from the fixture server's
-apiRequestContext), `site-scope.spec.ts:61`, `sites-crud.spec.ts:148` ("Saved" not visible in
-5 s), `social-channel.spec.ts:115` (30 s timeout). **The fifth was real, and it was test
-isolation:** `ops-api.spec.ts:964` "deploy-hub refuses … a bundle that is not the hub" expected
-400 and got 200. `export/out` is the checkout's own build dir (`resolveOutDir` =
-`paths.exportDir/out`, not fixture-controlled), and C's own `e2e:2origin` run had built a hub
-into it, so `builtHubProblem` found a hub, the route accepted, and **a deploy job of that hub to
-`archilyzer-hub`, preview `hub-check`, was started**. Nothing reached Cloudflare — `wrangler pages
-deployment list --project-name archilyzer-hub` was empty afterwards. Fix **`211d4666`** (test
-only): the sub-case runs only when `../export/out/hub-sites.json` is absent or a `site.json` is
-present (mirroring `builtHubProblem`: a site's `site.json` wins); otherwise the test records a
-`subcase-not-exercisable` annotation and makes NO call with a valid project. EXPORT **192 passed,
-6.5 min**. HUB **8 passed, 15.7 s**. 2ORIGIN (`TWO_ORIGIN_REBUILD=1`) **3 passed, 34.3 s**; the
-worktree's `export/public` entries that compose-hub writes (`hub-sites.json`, `site.json`,
-`corpus.json`, `llms.txt`, `robots.txt`, `sitemap.xml`, `_headers`) were swapped for real copies
-before the run and relinked after, so the suites did not touch the primary's files (their
-12:59/13:04 mtimes came from the live editor's own Rekietalyzer build, below). **Rerun of the
-five failed specs on `bb3dbb4c`** (`r7-rerun-editor.log`: `channel-storage ops-api site-scope
-sites-crud social-channel`): **55 passed, 0 failed, 3.8 min**, including slice K's new ops-api
-test and the guarded deploy-hub sub-case. tsc on `bb3dbb4c` in the primary (`r7-tsc.out`): 8
-errors, **all in the stale generated `editor/.next/dev/types/validator.ts`**, 0 in source; the
-worktrees, which have no such file, were clean.
-
-**Step 2 — install.** `pnpm install --frozen-lockfile` in the primary: "Already up to date",
-601 ms (`r7-install.log`). The three facts held: `editor/node_modules/@aws-sdk` absent;
-`common/node_modules/@aws-sdk/{client-s3,lib-storage}` present;
-`umtool/report-to-video/node_modules/yt-dlp-transcript-common` → `../../../common`. The OLD
-live build's `editor/.next/node_modules/@aws-sdk/client-s3-*` resolved into
-`node_modules/.pnpm/@aws-sdk+client-s3@3.1080.0`.
-
-**Step 3 — numbers on the live corpus, new code** (`r7-numbers.log`). Settings:
-`SETTINGS_RT_OK` **1,353 scalar paths**, diff empty. Files: 77 `unknown keys: []` lines, 0
-non-empty, no `WRITE THREW`, **3,859 lines** (`r7-files-numbers.txt`). The plan expected
-release 5's 3,839; the +20 predates the rollout — C's worktree run before the merge already gave
-3,859 over the frozen copy. The corpus grew; no key changed in 6 or 7.
-
-**Step 4 — md5 baseline** (`r7-md5.sh`: `settings.json` + 6 `site.json` + every channel
-`config.json` + `sites/_homepage/homepage.json`). `before` at 12:03: **79 files**.
-`pre-restart` at 13:10: **80 files** — the operator added `paramount-tactical-videos` during the
-day. `state.json` `.download|keys` before: `["picks","platformBackoff","runtime"]` on all four
-lanes.
-
-**The reshaped build path ran live before the restart.** At 13:00 the OLD live editor
-(`93dcb532`) ran job `01M3CQ95WY2DSH5Q2SS2417K1T`, a Rekietalyzer build-deploy. It spawned
-`pnpm run build` in `export/`, and that script on disk was already C's `tsx
-../common/bin/archilyzer.ts build site`. It compiled ("✓ Compiled successfully in 9.8s"),
-uploaded 81 files and deployed https://51e1101b.rekietalyzer.pages.dev — a real-world pass of
-the new build path under the old server. It is also what regenerated the primary's
-`export/public` (Rekietalyzer staging, mtime 12:59:44), which decided step 8's site.
-
-**Step 5 — builds** (`r7-builds.log`, 13:09:37, detached while the old server served). Editor:
-exit 0, **38 s**, `BUILD_ID` `FKE60BTWpUiUa94WCSxTO` → **`6kMVr9Gn2093S9tp_pgqT`**; `readlink -f
-editor/.next/node_modules/@aws-sdk/client-s3-*` →
-`node_modules/.pnpm/@aws-sdk+client-s3@3.1080.0/node_modules/@aws-sdk/client-s3`. umtool (cwd
-`umtool/`): exit 0, **15 s**, `JKtTfoVrUbTosNENO3GMj` → **`5gN2_DKycn5pOV7fNMVos`**.
-
-**Step 6 — ONE restart** (`r7-restart.log`, 13:11). Running at the time: only the two runners
-(auto-transcribe `01M3BAAN42XQ7YJP3F3KDM60DF`, auto-download `01M3BAAN4K2733K0KYTM5BVZSF`) and a
-transcription of `omnibased/9yXc8WhVZZo`, which was cut and re-picked after boot. Editor: TERM
-888092 (pnpm) + 888107 (next-server, cwd `editor/`), `setsid nohup pnpm run start -H 0.0.0.0`,
-`/` 200 after **2 s**, "Ready in 175ms" (`editor-start-r7.log`), `/tags` 200. umtool: TERM 5863 +
-5881, its `start` on :3050, `/` 200 after **3 s** (`umtool-start-r7.log`).
-
-**Step 7 — after boot.** md5 `after-boot`: **80 files, identical** to pre-restart — boot
-rewrote nothing. `ZodError` 0; umtool errors 0. `state.json`: every lane now carries
-`videoDeferrals` (`{}`) beside `picks` / `platformBackoff` / `runtime` — the expected change
-outside the md5 baseline. `/api/view/autoQueueStatus` `.download.deferred == []`,
-`.transcription.deferred == []`.
-
-**Step 8 — smoke** (`r7-smoke.out`, 13:13:48 → 13:16:28, **`SMOKE_FAIL=0`**). All eight
-`/api/*` ↔ `/api/view/*` pairs identical with the live fields stripped (`autoQueueStatus`
-511,533 B); `/api/view/bogus` and `/api/view/invalidate-cache` 404; presets 200; `?rev=`
-`changed=false` on both paths; ten pages 200 (`/` 4 s, `/channels`, `?sort=size`, `/jobs` 3 s,
-`/operations/diarization` 110 s, `/settings`, `/storage`, `/tags`, `/channels/FearAnd`, the video
-page). `/operations/download` 200 with **one** `Rate-limit cooldown` region — the plan said none
-"while nothing cools", and youtube WAS cooling: the persisted state carried `fails: 12` from the
-old build's loop (step 12), so the region is correct. `/sites` 200 with `Build hub` and `Deploy
-hub`; umtool `/` 200 on the new `BUILD_ID`. **Site build:** `pnpm ops build-site --json
-'{"siteId":"rekietalyzer","skipData":true,"skipArchives":true}' --wait`
-(`r7-ops-build-site.log`): **exit 0, 27 s, compiled, 0 `prebuild` lines, 0 `build:data`
-lines** — the SDK resolves from common and the build is compose + `next build` with no data
-phase. **Rekietalyzer, not the plan's anilyzer:** a `skipData` build composes over whatever is
-staged, and the primary's `export/public` held the 13:00 Rekietalyzer staging; anilyzer over it
-would have been a wrong bundle.
-
-**Step 9 — hub and homepage, the first deploys ever.** The Pages project `archilyzer-hub` did
-not exist; the parent created it beforehand (`wrangler pages project create archilyzer-hub
---production-branch main`, ~11:5x), because wrangler never gets a TTY from a job or the CLI and
-fails fast on a missing project (C's record). `archilyzer` existed with no deployment — hence
-the 522. **Form** (`r7-hub-form.mjs`, Playwright on the live `/sites` Hub form):
-`cloudflareProject` `archilyzer` → `archilyzer-hub`, `siteUrl` blank →
-`https://archilyzer-hub.pages.dev`, "Saved."; both persisted across a reload; md5 `after-form`:
-only `homepage.json` moved. **Build:** `pnpm ops build-hub --json '{}' --wait`
-(`r7-ops-build-hub.log`): exit 0, **41 s**, `export/out/hub-sites.json` with **5 members**,
-`corpus.json` present. **Deploy:** `pnpm ops deploy-hub --json '{}' --wait`
-(`r7-ops-deploy-hub.log`): exit 0, **750 s** ("Uploaded 548 files (726.96 sec)" — the first
-upload of every file), https://f73a7c21.archilyzer-hub.pages.dev. **Public:**
-`https://archilyzer-hub.pages.dev/hub-sites.json` 200 (579 B: anilyzer, bonnellyzer, hasanalyzer,
-jeralyzer, rekietalyzer), `/corpus.json` 200 (spec 4, 5 members), `/llms.txt` 200, `/` 200.
-**Browser proof** (`h-hub-check.mjs`, `h-hub-report.md`, `h-hub-search.png`, `h-hub-modal.png`):
-the shelf shows all 5 members badged "Member"; "Quartering" (metadata scope) hit only 1 site, so
-"lawsuit" was used — **5 results spanning 4 origins** (jeralyzer, anilyzer, rekietalyzer,
-bonnellyzer); the first result's transcript modal opened; the three export controls of
-`export/e2e-hub/transcript-downloads.spec.ts` ("Mark both clip start and end first", "Download
-this transcript as a file", "Copy this transcript as Markdown (for AI)") each count **0**; the
-share link is present. **MCP proof** (`h-mcp-list-sources.mjs`, the package's own smoke-harness
-pattern): the server spawned with `TRANSCRIPT_HUB_URL=https://archilyzer-hub.pages.dev` logged
-`default corpus: hub:https://archilyzer-hub.pages.dev`, and `list_sources` listed the 5 members
-as `remote:<url>` handles. **Homepage:** `pnpm --filter yt-dlp-transcript-common exec tsx
-bin/archilyzer.ts build homepage` exit 0, **41 s** (`r7-cli-build-homepage.log`); `… deploy
-homepage` exit 0, **33 s** → https://6508d288.archilyzer.pages.dev (`r7-cli-deploy-homepage.log`).
-Public: `https://archilyzer.pages.dev/` **200 (was 522)**, `/docs/install/` 200,
-`/downloads/archilyzer-source.tar.gz` 200 (2,541,513 B); the hero shows "Search all archives" →
-`https://archilyzer-hub.pages.dev`.
-
-**Step 10 — the owed sync + md5.** `teamrcn` (7 videos, the smallest YouTube video channel) is
-queued behind the youtube cooldown by `r7-scan-sync2.sh` (log `r7-scan-sync2.log`), after the
-Paramount Tactical metadata scan; `config.json` before: `r7-teamrcn-config.before.json`.
-The sync ran at 15:21 after release 8's restart (job `01M3CY7BN3DNN12T93X9GZM48X`, queued at 14:46 behind the paramount-tactical scan, which the operator cancelled at 377/1,382 to let downloads start). It did its work — full sweep, availability check (1 dir, 0 attempted), backfill wrote 0 — and `teamrcn/config.json` moved on exactly two keys: `lastSyncedAt` 2026-05-18 → 2026-09-25T19:21:15.754Z and a new `lastFullSweepAt` 2026-09-25T19:21:15.762Z; no other file changed. Its STATUS reads `failed`, though: the last line is `[error] Invariant: static generation store missing in revalidatePath /channels/teamrcn`. That is the pipeline action's own body calling `revalidatePath` at its end (`editor/app/channels/[slug]/pipelineActions.ts:220-224`, the same body download-missing runs) from the platform queue's drain loop, where Next has no request store, because the job was QUEUED rather than started inside the ops request; every earlier ops sync ran immediately (empty queue) and never hit it. New finding, recorded in release 8's rollout; fix owed (tolerate a missing store in the job-completion revalidation).
-
-**Step 11 — 410 re-read: not observed today.** No availability check reached
-`rekietalaw-rumble/v7e07us` or the four quartering ids. Left to their next check, as the plan
-says (observe, do not force).
-
-**Step 12 — pacing, proved live the same afternoon.** The persisted state at boot carried
-`download.platformBackoff.youtube = {fails: 12}` from the OLD build's loop on
-`paramount-tactical-videos/_60iFE_FBPQ`: the auto-download lane had started on the operator's new
-1,473-video channel, the subtitle fetch 429'd, and the old runner re-picked the same video after
-every cooldown — the plan's Short, again. The old runner's line:
-
- Auto-download: youtube rate_limit — backing off 1658s (attempt 12). _60iFE_FBPQ will retry after cooldown.
-
-The cooldown lapsed at 13:20:12; the NEW runner re-picked `_60iFE_FBPQ` (not yet deferred — the
-old build never wrote a deferral), it 429'd, and the log reads:
-
- Auto-download: youtube rate_limit — backing off 1949s (attempt 13). _60iFE_FBPQ deferred 6h; next video after cooldown.
-
-`state.json` then held `download.videoDeferrals = {"_60iFE_FBPQ": {"until": <+6 h>,
-"channelSlug": "paramount-tactical-videos"}}` and `platformBackoff.youtube = {fails: 13, until:
-13:52:55}`. The next pick after this cooldown is a different video. The manual `metadata-scan`
-and `sync` submitted during the cooldown were refused with the platform-cooldown sentence
-(`r7-scan-sync.log`) — unchanged behaviour, as the plan says. **(iii), the evening watch, is still
-owed:** `grep -h 'deferred 6h' transcripts/.jobs/*.log` — each id at most once per 6 h, `attempt
-N` climbing only across distinct ids. The scan-error refresh proof (a second restart within 24 h
-logs no `legal-mindset` re-scan) is not provable today: there was one restart.
-
-**And then the disk lost it (13:33:37).** `state.json` was rewritten with the boot-time values
-(`fails: 12`, `until` 13:20:03, `videoDeferrals: {}`): the download runner's 13:20 persist was
-clobbered by another lane's persist of ITS copy of the whole file. Traced the same afternoon
-(`$T/q-state-revert.md`): `sharedAutoQueueState` (`autoRunner.ts:268-293`) caches the resolved
-value, not the in-flight read, so the four lanes started together at boot each read the file
-themselves and hold a private object for life; `writeAutoQueueState` writes all four lanes from
-whichever copy persists. The rename at 13:29 recompiled the priority roots and gave a stale-holding
-lane work, hence the 13:33 write. Pre-existing (the comment above that function describes this
-exact bug as fixed), not introduced by Y; Y made it visible because a deferral is a value worth
-keeping. The running download lane still holds its deferral in memory; a restart would lose it.
-Fix = release 8 slice S (`one-core/r8-state-share`): cache the promise. The record above states
-what was true at 13:21.
-
-**Found and left.**
-- **The operator asked: "more 429s than ever — are there multiple YouTube downloads at once?"**
- No (`q-429-report.md`). Every YouTube-touching job kind lands on ONE `platform:youtube` queue,
- submitted with `concurrency: 1` (`common/jobs/registry.ts:189-211`, `common/lib/queueKeys.ts:69-73`);
- 122 YouTube jobs in the retained 36 h, **zero overlaps**. All 26 real 429s are subtitle fetches,
- on `quarteringvlogs` (20) and paramount-tactical, and the old re-pick loop multiplied them —
- which is exactly what slice Y removes. Gap found: YouTube has no `--sleep-requests` in
- `common/ytdlp/platformArgs.mjs` (Rumble has `1`) — a candidate follow-up, **not applied**.
- Dormant concurrency gaps: `check-kept-deleted` runs on channel keys, not the platform queue;
- the backfill re-acquire runs on its own queue (disabled, `backfill.allowRedownload: false`).
-- **The operator asked: "does `downloadFilter.include` have a UI?"** Yes — the channel Configure
- form's "Download filter: include (regex)" field (`editor/app/channels/components/ChannelForm.tsx:702`).
-- **The channel was renamed** `paramount-tactical-videos` → `paramount-tactical` by the operator
- at ~13:29 (8 data dirs at that time). The live deferral keeps the old slug — harmless: it
- expires in 6 h and the pick filter is by video id. `RUNNING_IN_DOCKER.md`'s keep-videos example
- named the old slug in `bb3dbb4c`; this record's commit corrects it.
-- **Slice K's live run is pending the scan.** `pnpm ops keep-videos` on `paramount-tactical`
- (`match: "TheQuartering"`) needs the metadata scan first (0 of 1,472 scanned at 12:52); the scan
- is queued in `r7-scan-sync2.sh` ahead of the teamrcn sync.
-- **Worktrees to remove:** `one-core-r7-pacing`, `one-core-r7-cli` (detached), `one-core-r7-keep`,
- plus the older `one-core-r5-*`, `one-core-r6-followups`, `one-core-phase-4-s1`. `pnpm wt list`,
- then `git worktree remove <path>`; removing shifts port blocks.
-- **The `.next/dev/types` tsc noise in the primary** is a stale generated file, not source; `rm
- -rf editor/.next/dev` clears it (as Y's re-gate did in its worktree). Not done here — the live
- `.next` is the running server's.
-- The e2e isolation lesson is in FACTS: **`export/out` belongs to the checkout, not the fixture**,
- so a spec that can reach a deploy must check what is built before it calls with a valid project.
diff --git a/plans/release-9.md b/plans/release-9.md
@@ -1,683 +0,0 @@
-# Release 9 — four fixes behind one restart
-
-`main` at `9247211e`, release 8 live on :3001 since 2026-09-25 14:43. Release 9 is the four small
-bugs the release-8 rollout found on the live editor, batched so they cost one editor restart: a
-queued job that ends `failed` after doing its work, a 30 s sleep after every video the download
-filter declined, YouTube with no request-level pacing, and a `/jobs` page that calls a slow scan
-stuck and keeps restart-orphaned jobs `queued` forever. The release-8 reviews' optional lows ride
-along. The same release also carries the hub's polish, which the operator asked for before the homepage
-links the hub again (`HUB_LINK_ENABLED = false`): C1 brings the hub into the homepage's look and copy
-with the homepage's own numbers, and C2 the federated-search UX. Flipping the homepage's hub link is a
-later step, not a slice. Rules: `plans/tools/implementer-rules.md`. Record file: this file.
-
-## Record
-
-### Slice F, as shipped — four fixes (2026-09-25)
-
-Branch `one-core/r9-fixes` off `main` `9247211e`, one Opus implementer, no sibling slices.
-
-**B1 — a queued job no longer ends `failed` after succeeding.** The scheduler starts the next
-queued job synchronously inside `complete()`, so that job inherits the async context of whatever
-finished the one ahead. When the chain began at a job with no request behind it (an auto-runner
-unit, a heartbeat sync), Next has no work store and `revalidatePath` throws `Invariant: static
-generation store missing`. Job bodies call it last, so the throw landed after the work was done:
-the teamrcn sync at 15:21 read `failed` and `pnpm ops … --wait` exited 1.
-`editor/app/lib/safeRevalidate.ts` — `safeRevalidate(paths, tags = [])` — swallows exactly that
-invariant (one `console.warn` per process, naming the paths) and rethrows anything else. It is
-swapped in at every job body (`fn`) and job hook (`onDone` / `afterRun` / `afterDone`), found by
-grep and by indentation, not from the prompt's list alone: 18 files, 63 call lines, including
-`repointJob.ts`'s `afterDone`, which the list did not name. Server actions that revalidate in
-their own request are untouched, including the ones that revalidate after `drainStream`
-(`review/actions.ts`, `refreshAllChannelSnapshotsAction`), because they are still inside it.
-
-The first e2e version queued the sync behind a `--test-slow` sync. That held the queue for minutes,
-and it could not fail: a job an ops request started carries that request's store. The final version
-holds `platform:youtube` with `/api/test/stuck-job?releaseAfterMs=4000`. The new parameter finishes
-the fake holder from a timer armed inside `workAsyncStorage.exit`, i.e. outside any request, and
-the route reports `detached` so the spec cannot pass for the wrong reason. The spec then queues an
-ops sync behind it. **Against the pre-fix sync body it fails with the live line** — `[error]
-Invariant: static generation store missing in revalidatePath /channels/slow-b`, status `failed`
-(`r9-e2e-prefix.log`) — and it passes with the fix.
-
-**B2 — no 30 s sleep after a video the download filter declined.** `runManagedDownloads` slept
-`sleepBetweenDownloadsSeconds` after every video. `declinedWithoutMediaFetch(outcome)` is true when
-every attempt was the `n: 0` metadata prefetch (or its cookie retry) and the video ended
-`skipped-filtered`. Any attempt `n >= 1` is a real fetch: the download attempts and the chat-only
-pass. A failed chat pass leaves the status `skipped-filtered` and still sleeps. As first shipped, a
-`per_video` failure that never got past the prefetch also skipped the sleep. The review narrowed
-that (see "Review fixes"): **every failure keeps the pace.** `runManagedDownloads` is exported with a
-`deps` seam (`downloadOne`, `sleep`). `managedDownloadsSleep.test.ts` drives the loop with canned
-outcomes:
-- a fetched video sleeps;
-- a filtered one does not;
-- a per-video failure at the prefetch sleeps;
-- the last video never sleeps;
-- a failed real fetch and a network failure at the prefetch both sleep;
-- a unit table for the predicate.
-
-**B3 — YouTube request pacing.** `PLATFORM_ARGS.youtube = ["--sleep-requests", "1"]`, with the
-comment citing `~/reports/release-7/data/q-429-report.md` finding 1. The prompt named
-`release-8/data`; the report is in `release-7/data`. The comment above the table now says what the
-pace is, and that the metadata scan and the clip window, which already pass `--sleep-requests 1`,
-carry it twice, harmlessly (yt-dlp keeps the last). The argv tests were updated deliberately:
-- `channelArgs.test.ts`: youtube gets the pace; a platform with no entry gets nothing; a channel's
- own `--sleep-requests 3` comes after and wins.
-- `platform-args.test.mjs`: +1 case, youtube carries the pace and a URL on no known platform
- carries nothing. The YouTube clip fetch and simulate now expect the pace.
-
-No e2e asserts a YouTube argv exactly. `rumble-sweep.spec.ts` only asserts Rumble lines, and
-`fake-ytdlp.mjs`'s `lastNonFlag` never sees the trailing `1`, because every spawn ends in a URL,
-`--load-info-json <path>` or `-a <file>`.
-
-**B4a — `/jobs` flags a stall by quiet time, not age.** `JobRecord.progressAt` is stamped at the
-source. `noteProgress` (the `setProgress` every `runManagedFunction` job gets) stamps it only when
-the snapshot's numbers changed, and `recordTaskDuration` stamps it when a sub-operation finishes.
-`reconcileSlots` measures quiet time from the later of the start and that stamp. This deviates from
-the prompt's suggested view-side map, on purpose. A map is only fed while someone has `/jobs` open,
-so the first render after an hour away would either flag a healthy scan (if it seeded from the
-start) or hide a real stall for 10 more minutes (if it seeded from now). The stamp has neither
-problem, and the registry is in memory, so it is still evicted with the record.
-`jobRows.test.ts` +2: an hour of 6 s steps is never stuck, and progress frozen past 10 min is
-possibly-stalled. The same count re-reported is not a move. **Both fail on the old rule.** The
-`/api/test/stuck-job` fixture backdates `startedAt` with no `progressAt`, so `queue.spec.ts`'s
-force-release case still sees its stall.
-
-**B4b — boot settles the metas a restart left `queued`, and re-queues little.**
-`common/jobs/bootQueuedJobs.ts` (`settleQueuedJobMetas`) runs from `instrumentation.ts`:
-lazy-imported, voided and best-effort. It runs after the storage boot pass, and since the review
-fix it WAITS for that pass. Its scope is each `*.meta.json` with status `queued` that was queued
-before this boot and is not held by the live registry. A malformed meta is skipped. In order:
-1. An idle boot (`ARCHILYZER_IDLE_BOOT`) and the e2e test server (`EDITOR_TEST_ROUTES=1`) cancel
- everything and re-queue nothing.
-2. A `sync` is never re-queued: "server restarted; the scheduler re-derives syncs".
-3. A meta queued more than 24 h (`REQUEUE_MAX_AGE_MS`) before the boot is cancelled: "queued
- before the last restart, stale".
-4. A meta with no spec is cancelled with the reason.
-5. Of what is left, only the NEWEST meta per kind + channel + bucket + params (params key-sorted)
- is re-queued, through `runJobSpec` (the path Retry uses). The old meta is closed `cancelled`,
- naming the new id. The others are cancelled as "superseded by a newer queued job (<id>)". A
- refused or throwing re-queue is cancelled with its error.
-
-The log gets one line per re-queued job and one summary line: re-queued N, cancelled M, by reason.
-The reason is also appended to each job's `.log`, which makes the pair prunable, since pruning walks
-`.log` ids. Metas are written tmp + rename. `running` metas are left alone. `JobMeta` gains the
-optional `cancelReason`.
-
-**Live size, from the review's read-only count.** 1,396 metas, 392 `queued`:
-- 346 `sync` over 51 channels, in batches from 08-03 to 09-24;
-- 29 `whisper-all` from June and July;
-- about 7 others with a spec;
-- 10 with none.
-
-The first version would have called `runJobSpec` about 382 times at boot. Under the current rules,
-the syncs and everything older than 24 h are cancelled, so at most a handful of fresh non-sync jobs
-come back.
-
-`bootQueuedJobs.test.ts` has 9 cases over a temp `.jobs` dir with an injected re-queue. One is 7
-duplicate syncs + 1 stale `whisper-all` + 1 fresh non-sync, which gives exactly 1 re-queue. Other
-cases cover duplicate specs written in a different key order, and a malformed meta next to a good
-one. It was not run against the real corpus.
-
-**Lows, all three done.**
-- **S:** `mergeBackoffEntry` merges `until` and `fails` separately, each to its max, in both the
- runner's merge and `recordDownloadBackoff`'s. `platformBackoff.test.ts` +1.
-- **V:** a changed `data/` mtime REBASES the channel's title memo instead of dropping it. One
- `readdir` keeps the titles of the dirs still present, only new dirs are read, and a removed
- dir's title goes with it. The memo case in `videoTitles.test.ts` now asserts 1 read for a new
- dir and a fall-through for a removed one. It pins a distinct mtime, because two changes inside
- one filesystem tick share one.
-- **H:**
- - `official.transcripts` is a per-site accumulator from the same pass that places each
- transcript.
- - A site outside `keptIds` gains no monthly key.
- - `gone` counts only with a `downloadedDate`.
- - `FamilyStats` is `lg:grid-cols-5` without a gone cell.
- - The stale comments in `ArchiveGrowthChart.tsx` :10-11 and `page.tsx` :125, and the test
- title, are fixed.
-
- `homepageSummary.test.ts` +3. No number on today's data moves. The review measured placed +
- unplaced = `official.transcripts` (49,767) and all 480 deleted records with a `downloadedDate`.
-
-| sha | what |
-|---|---|
-| `d927dad4` | B1: `app/lib/safeRevalidate.ts` + its unit test (3), swapped in at every job body and hook (18 files); first ops-api e2e case |
-| `37d263cb` | B2: `declinedWithoutMediaFetch`, the `deps` seam on `runManagedDownloads`, `managedDownloadsSleep.test.ts` (6) |
-| `ac55a23c` | B3: `PLATFORM_ARGS.youtube`, table comment, `channelArgs.test.ts` (+2), `platform-args.test.mjs` (+1) |
-| `efd75cb0` | B4a: `JobRecord.progressAt`, `noteProgress`, quiet-time stall rule, `jobRows.test.ts` (+2) |
-| `cc884951` | B4b: `bootQueuedJobs.ts` + test (6), `JobMeta.cancelReason`, the instrumentation boot pass |
-| `db18b73d` | low S: `mergeBackoffEntry` in both merges, test (+1) |
-| `49993934` | low V: title memo rebased on a new dir, test updated |
-| `c714bc14` | low H: `homepageSummary` counts + guard, `FamilyStats` grid, comments, test (+3) |
-| `78d165f6` | B1 e2e reworked: `stuck-job?releaseAfterMs` (detached release), the spec now reproduces the live failure pre-fix |
-| `0c3e0b9a` | `plans:` this record, the `[Unreleased]` bullets |
-| `be48f610` | (review HIGH-1, LOW-1, LOW-2, NIT-1) boot pass: no syncs, 24 h age cap, newest per spec, summary log; storage pass awaited; atomic meta writes; test 6 → 9 |
-| `11c947ab` | (review MED) B2 skips the sleep for `skipped-filtered` only; the per-video test now expects a sleep |
-| `23134785` | (review LOW-3) the B1 e2e releases its holder after 10 s, not 4 |
-| _this_ | `plans:` the review fixes in this record, the CHANGELOG and the gates |
-
-**Gates**, all from the worktree root. Heavy steps started at ≥ 3 GB available memory.
-- **tsc** (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`) was clean before every
- code commit. It was checked once to catch a planted error, so the silent `exit=0` is real.
-- **common: 1,836/1,836**, from 1,816 + 20: B2 +6, B3 +2, B4a +2, B4b +6, S +1, H +3; V's case was
- rewritten in place.
-- **editor unit: 78/78**, from 75 + 3 (`safeRevalidate.test.ts`).
-- **`test:scripts`: 162 pass + 1 skip of 163**, from 161 + 1 skip, +1 in `platform-args.test.mjs`.
- A first run during e2e run 1 failed `E2E_QUEUE=0 bypasses the queue entirely`, because this
- worktree's own e2e held the lock; the rerun with no e2e running is clean.
-- **mcp: 219/219.**
-- **Builds:** `pnpm --filter editor exec next build` ok, `pnpm --filter export exec next build` ok,
- and, because H touches `homepage/`, `pnpm --filter homepage exec next build` ok. No dangling
- `export/public` links.
-- **EDITOR e2e.** Spec list `r9-specs.txt`: `ops-api queues auto-queue lane-runner jobs-filters
- queue` (the grep for `possibly-stalled|STUCK|data-job-id` adds `queue.spec.ts`), plus
- `jobs-retry jobs-active-order jobs-channel` (the retry path B4b reuses), `rumble-sweep` (argv),
- `title-filter` (B2's filtered path), `pacing metadata-scan-botcheck sync-deep`, all `.spec.ts`.
- - Run 1 (`r9-e2e1.log`), on `c714bc14`: **84 passed, 2 failed, 13.4 min**. One failure was the
- first B1 spec, which timed out behind the slow sync (the rework above). The other was
- `auto-queue.spec.ts:218`, the run's first test, where the `/api/auto-queue/status` GET outlived
- the 30 s test timeout on a cold dev compile. It passed in run 2 with no change.
- - Pre-fix proof (`r9-e2e-prefix.log`): the reworked B1 spec with the sync body's
- `revalidatePath` restored: **1 failed**, with the live invariant in the job log. The fix was
- restored before any commit.
- - Run 2 (`r9-e2e2.log`), on `78d165f6`: **86 passed, 0 failed, 5.7 min**, with no queue wait.
-
-**Review fixes (review verdict SHIP AFTER FIXES, `r9-review.md`).**
-- **HIGH-1** (the boot-flood size), **LOW-1** (await the storage pass), **LOW-2** (malformed-meta
- test) and **NIT-1** (atomic meta writes) are all in `be48f610`.
-- **MED** (B2 keeps the pace after a per-video failure) is `11c947ab`.
-- **LOW-3** (10 s release window) is `23134785`.
-- **LOW-4** is left; see "Found and left".
-
-Re-gate on `23134785`:
-- tsc clean.
-- common **1,839/1,839** (1,836 + 3 boot-pass cases).
-- editor unit **78/78**.
-- EDITOR e2e `jobs-filters.spec.ts ops-api.spec.ts queues.spec.ts queue.spec.ts`
- (`r9-e2e3.log`): **57 passed, 0 failed, 2.7 min**.
-
-No e2e covers the boot pass. The test server is cancel-only by design, so the pass is pinned by its
-9 unit cases.
-
-**Numbers: none** (per the prompt). No `settings.json`, `site.json` or `config.json` key changed.
-`JobMeta.cancelReason` and `JobRecord.progressAt` are additive and optional.
-
-**Found and left.**
-- **B2 lets filtered prefetches run back to back.** A filtered video's metadata prefetch is still
- one yt-dlp process against YouTube. Without the 30 s sleep, a run of declined videos is a run of
- prefetches, spaced only by process start-up and B3's one-second request pace inside each. The
- metadata scan does the same work at ~10/min with no 429s. If a filtered channel's
- download-missing ever 429s, the lever is a smaller sleep for prefetch-only videos, not the full
- one.
-- **Classification quirk, left as is.** YouTube's soft block ("This content isn't available, try
- again later") classifies as `deleted` → `per_video` in `classifyDownloadFailure`. So a soft block
- neither triggers the platform backoff nor aborts a batch, and it reads as a per-video property. It
- is why B2 keeps the sleep after every per-video failure. `classifyDownloadFailure` was not changed
- (review instruction).
-- **B4b leaves `running` metas.** A job running at a hard crash (no graceful shutdown) still reads
- `running` → `archived` on `/jobs`. Whether a half-done job should re-run is not a boot pass's
- call.
-- **`cancelReason` is not drawn on `/jobs`.** It is in the meta and appended to the job's log,
- which the row's log view shows.
-- **The rollout's first boot settles the 392 live `queued` metas.** Nearly all are cancelled with
- a reason, as above; only fresh (< 24 h) non-sync jobs, newest per spec, come back. Booting once with
- `ARCHILYZER_IDLE_BOOT=1` re-queues none.
-- **LOW-4, left:** `safeRevalidate`'s "once per process" warning is once per module instance. Next
- can load a module more than once, so it may warn a second time.
-- **The stuck-job harness reaches into a Next internal**
- (`next/dist/server/app-render/work-async-storage.external`). It is typed, test-route-only, and
- reported through `detached`, so a Next upgrade that moves it fails the spec loudly rather than
- letting it pass vacuously.
-
-### Slice C1, as shipped — the hub in the family's register (2026-09-25)
-
-Branch `one-core/c1-hub-look` off `main` `9247211e`. **The operator's decision (2026-09-25 evening):**
-the hub (`https://archilyzer-hub.pages.dev`, the export app with `INSTANCE_MODE=hub`) gets the
-homepage's look and copy, and its shelf becomes "Official instances" showing the SAME per-site numbers
-the homepage shows. Scoping: `$T/r9-hub-scope.md` (read-only pass). The federated-search UX
-(`SearchDataContext.tsx`, `SearchResults.tsx`, `SearchSessionContext.tsx`) is C2's and untouched.
-
-**Theme.** `export/app/layout.tsx` branches on `instanceMode() === "hub"` (server-only, the file is a
-server component) to `defaultTheme="archilyzer" defaultMode="dark"`, exactly `homepage/app/layout.tsx`'s,
-and the hub's browser-chrome `themeColor` is the homepage's `#151b20`. Site builds keep
-`base`/`system` and `#2563eb`; `theme.spec.ts`/`theme-family.spec.ts` (site build) stay green. The
-built hub `index.html` carries `archilyzer` in its ThemeScript; a render of the built hub reads
-`data-theme="archilyzer"` + `.dark` with no stored preference.
-
-**`--chart-3`** in `[data-theme="archilyzer"]` was the `--state-gone` hex in both modes, so the third
-official instance (Bonnellyzer, in `seriesColor` order) drew as "gone" on the homepage chart and card.
-It is now a green, lightness-stepped away from the gone red so the two stay apart under CVD simulation
-too. Chosen by the dataviz validator (OKLab ΔE ×100, Machado CVD), against the neighbours in the
-fixed order:
-
-| mode | `--chart-3` | vs `--state-gone` normal / protan / deutan | vs chart-2 | vs chart-4 | contrast on `--chart-surface` |
-|---|---|---|---|---|---|
-| light | `#5a9e3a` (was `#a8412d`) | 25.9 / 21.8 / 11.2 | 26.9 | 30.3 | 3.29:1 on `#ffffff` |
-| dark | `#86c86a` (was `#c4553f`) | 29.1 / 27.4 / 17.1 | 20.8 | 26.6 | 8.03:1 on `#1a2229` |
-
-Hues near magenta read as the gone red at normal vision (ΔE ~10–11); darker greens collapse into it for
-deutans (ΔE 2–5). The palette's pre-existing validator failures are unchanged and not this slice's:
-chroma floor (`chart-1`, `chart-5` light; `chart-1`, `chart-2` dark), the chart-1↔chart-2 normal-vision
-floor (12.4 light / 9.0 dark), and the dark lightness band. Green also sits near `--success`; a chart
-series is not chrome state, so that was accepted.
-
-**The numbers, at build time.** `compose-hub.ts` now also writes `public/hub-summary.json`
-(`lib/hubSummary.ts`, version 1): `{version, generatedAt, official, sites[]}`, each site
-`{siteId, siteTitle, siteDescription?, siteUrl, channels?, recordings?, transcripts?, hoursArchived?,
-gone?, accent?}` — `transcripts` is the homepage summary's `transcribed.total`. It is `toHubSummary()`
-of the SAME `buildHomepageSummary` call the homepage makes: the input gathering (buildStats → read the
-whole-pool pages → channel→sites map → summarise) moved out of `compose-homepage.ts` into
-`common/controller/poolSummary.ts` (`buildPoolSummary`, `readStatsPages`, `channelSitesOf`), and both
-composes call it. The hub's whole-pool stats pages go to `<exportIndexDir>/hub-stats` (staging, not
-served). **The file is optional:** no index (`paths.lmdbPath` absent) → not written and any stale copy
-removed; a failure → logged, removed, the hub build carries on. `compose-site.ts` removes it with
-`hub-sites.json`, so a site bundle never ships it. Not in `HUB_CORS_PATHS` (read same-origin);
-`builtHubProblem` unchanged. Why build time: a member's `corpus.json` carries only channel/video
-counts, so a live sum could never equal the homepage's; the hub is rebuilt alongside the sites.
-
-**Proved equal, read-only:** a scratch script (`$T/c1-verify.mts`) ran `readStatsPages` over the
-primary's `homepage/public/stats` (77,842 records), `listSites` over the primary's `sites/`, and
-`buildHomepageSummary` + `toHubSummary`, and compared with `toHubSummary` of the live
-`homepage/public/homepage-summary.json`: **MATCH** (official 5 sites / 63 channels / 75,785 recordings
-/ 49,767 transcripts / 60,840 h / 480 gone). No LMDB was opened. `compose:hub` itself was NOT run
-against the real corpus: `buildStats` writes the index's `statsByPath` sub-DB, so it is not read-only,
-and the 15 GB index cannot be copied. In the worktree it ran with no corpus: "0 built-in pool site(s)
-…; no index to summarise — hub-summary.json skipped." The first real `hub-summary.json` is written by
-the parent's `build-hub`, whose log line says how many instances it covers.
-
-**The page, top to bottom, with its final copy** (`ArchiveShelf.tsx`, `HubStats.tsx`,
-`AddArchive.tsx`, new `useHubSummary.ts`):
-1. **H1** `{official.hoursArchived} hours of speech from every official archive, searchable at once.`
- (no summary: `Every official archive, searchable at once.`; no summary AND no official instances:
- `Every archive you add, searchable at once.`). **Paragraph:** "One search runs across all of them,
- in your browser. You can add any other Archilyzer archive to your own search, below. It stays in
- this browser until you remove it."
-2. **`Official instances`** (h2) + "The archives I run. Anyone can run their own." + one card per
- built-in member in `hub-sites.json` order: title linking out (`target="_blank"`, ↗), the summary's
- description, and channels · recordings · transcripts · hours, each omitted when absent; the
- `Installable`/`Data-only` badge. The stripe is the site's own `accent`; a site with none (all
- five today) falls back to `seriesColor(i)` at its index in the summary's `sites` — the homepage's
- `ArchiveCards` and chart order — so each hub card wears its homepage card's colour (the card's own
- index when there is no summary). Figures match by `siteId`, then by origin. Zero built-ins: "This hub has no official instances. Add an archive to search it."
-3. **`Archives you added`** (h2, only with externals) + the same card with the descriptor's channel
- count only and the Remove control (`aria-label="Remove {title}"`), stripe its accent or
- `var(--brand)`, then the form (the paragraph under the H1 says how adding works, once). The Add button is the
- family's CTA (ink on ground, brand on hover), no longer a brand fill.
-4. **Live line:** "Searching N archives · N channels · N transcripts right now." — the LIVE federation,
- added archives included; the code comment says so, the page does not.
-5. `/ask` hub branch: "…for other ways to use every archive on this hub." (was "this archive").
- `siteRegistry.ts` ALREADY: "That archive is already on this hub." (was "on your shelf"; no spec
- asserts it).
-
-**Dropped:** "The shelf" eyebrow, the "Your archives" H1, the Member/Added badges (the two sections
-replace them), the empty-shelf sentence. `data-testid="shelf-spine"` stays on every card in both
-sections.
-
-**Changed locators** (same commit as the copy): `getByRole("heading", { name: "Your archives" })` →
-`getByRole("heading", { level: 1, name: /searchable at once\./ })` in `e2e-hub/federation.spec.ts`,
-`e2e-hub/ask-grounding.spec.ts`, `e2e-2origin/federation.spec.ts`. `e2e-hub/federation.spec.ts`
-"adds an archive by URL and shows it on the shelf" is renamed "…shows it under Archives you added" and
-also asserts the h2 and `Remove Origin B`. Unchanged: `getByLabel("Archive URL")`, button `Add`,
-`getByTestId("shelf-spine")`, `p[role="alert"]`, `role="status"` `Added {title}.`, the `/ask` H1.
-New `e2e-hub/official-instances.spec.ts` (+2): with a stubbed `hub-summary.json` the official card
-shows its four figures, description and outbound link, the H1 carries the hours, and there is no Remove
-and no "Archives you added"; with it 404, the card renders with no `dl` and the fallback H1.
-
-| sha | what |
-|---|---|
-| `ec5f8ebe` | `export/app/layout.tsx`: the hub defaults to the archilyzer family, dark, and the homepage's theme colour; sites unchanged |
-| `6d847cdc` | `common/styles/tokens.css`: archilyzer `--chart-3` light `#5a9e3a`, dark `#86c86a` |
-| `812d1b86` | `common/lib/hubSummary.ts` (+ test, 5), `common/controller/poolSummary.ts`, `compose-hub.ts` writes `hub-summary.json` (+ `compose-hub.test.ts`, 1: no index → no file, stale removed, no index created), `compose-homepage.ts` on `buildPoolSummary`, `compose-site.ts` removes it, `publish/build.ts` doc |
-| `5a1bd3c0` | review fixes: `.gitignore` `/export/public/hub-summary.json`; H1 with no official instances; the add sentence once, scoped to this browser; official cards fall back to `seriesColor` in the homepage's order; generic hours in the CHANGELOG |
-| `dc9ba0dd` | the hub page (`ArchiveShelf`, `HubStats`, `AddArchive`, `useHubSummary`, `HubHome` comment), `/ask` wording, registry ALREADY copy, the spec locators, `official-instances.spec.ts` |
-
-**Gates** (on `dc9ba0dd`): tsc clean (per commit). Common tests **1,822/1,822** (1,816 + 6). test:scripts
-**161 passed + 1 skipped**; the first run, concurrent with the export builds, had 1 failure in
-`scripts/queue-lock.test.mjs` "prints a banner naming the holder while waiting" — a timing test this
-slice does not touch; the idle re-run passed. `pnpm --filter export exec next build` (site) ok;
-`compose:hub` then `INSTANCE_MODE=hub … next build` ok (11 static routes); both with the one known
-Turbopack warning. e2e, queued: **`e2e:hub` 11 passed** (9 + 2), 36 s (after ~6 min in the queue behind
-`one-core/r9-fixes`); export `theme.spec.ts theme-family.spec.ts site-branding.spec.ts` **8 passed**,
-29 s; **`e2e:2origin`** (`TWO_ORIGIN_REBUILD=1`) **3 passed**, 44 s — the six compose-hub outputs in
-`export/public` swapped for copies before and relinked after; the primary's files were untouched
-(mtimes 18:09, `hub-sites.json` still the five-site pool). A render of the built hub with the verified
-summary and the real `hub-sites.json` (members' origins blocked) was checked at 1280 dark/light and
-390 dark. The editor build, editor unit and mcp were not run: nothing they build or test changed
-beyond `common/`, which tsc and the common tests cover. **Numbers tools: none.**
-
-**Review (SHIP AFTER FIXES) re-gate** on `5a1bd3c0`: tsc clean; `hubSummary.test.ts` +
-`compose-hub.test.ts` 6/6; `e2e:hub` **11 passed**, 24.5 s.
-
-**Merged `main` (`ef0978a6`, release 9 slice F)** as `11e185c0`; `plans/release-9.md` and the
-CHANGELOG resolved by keeping both. Re-gate on the merged tree: tsc clean; common tests **1,845/1,845**
-(1,839 + 6); `pnpm --filter export exec next build` ok; `compose:hub` (worktree, no corpus: skipped)
-+ `INSTANCE_MODE=hub … next build` ok; `e2e:hub` **11 passed**, 26.9 s (compose-hub outputs swapped for
-copies and relinked, as before). **Projection re-check** with main's `buildHomepageSummary`
-(`c714bc14`: official transcripts counted where placed, gone only when held), read-only over the
-primary's `homepage/public/stats` (77,842 records, written 18:26): **MATCH** against the live
-`homepage-summary.json` (22:26:11Z, written by the pre-change function) — nothing moved.
-`official.transcripts` 49,767, `official.gone` 480; per-site gone Jeralyzer 473, Anilyzer 2,
-Bonnellyzer 2, Hasanalyzer 3, Rekietalyzer 0 — identical before and after on this stats set.
-
-**Found and left:**
-- The hub build now does what the homepage build does: `buildStats` opens the index LMDB read-write
- and walks every channel's `data/`. An unmounted drive therefore undercounts those channels' figures
- in `hub-summary.json` with no warning — the same exposure the homepage and a site's `build:stats`
- already have, not a new one.
-- The branch `one-core/r9-fixes` changes `buildHomepageSummary` (`c714bc14`: official.transcripts
- counted where transcripts are placed). `hub-summary.json` is a projection of whatever it returns, so
- after both merge the hub and the homepage still agree — as long as both are rebuilt from the same
- commit. The MATCH above is against the pre-change function.
-- No official site sets `accent`, so every official card wears its homepage series colour. A
- `site.json` accent would override it on the hub only (the homepage ignores accents for its cards).
-- The live line counts what loaded; while members load it climbs, and a member that fails silently
- lowers it with no sign — C2's per-site state is the fix.
-- The H1 swaps from the fallback to the hours sentence when `hub-summary.json` arrives (client fetch,
- one frame of text change). Embedding it at build would need the hub page to read `public/` at build;
- left as a fetch so the e2e can stub it.
-- The chart-3 change repaints the homepage's third instance too; it needs a homepage rebuild to show.
-
-### Slice C1b, as shipped — copy rulings + Ko-fi link (2026-09-25)
-
-Branch `one-core/c1b-hub-copy` off `main` `6820bd21`. **The operator's rulings (2026-09-25), amending
-C1:** Title Case on the h2 headings of the hub shelf and the homepage, so the two pages share one style;
-no subtitle where the title implies it ("The archives I run. Anyone can run their own." removed on
-both); no per-site description on the official-instance cards (hub and homepage), the four figures
-stay; a bare `Ko-fi` link, no copy, on the project's own surfaces only. The hub's H1 and its paragraph
-and the homepage's hero paragraph stay (they are not subtitles). C2's files (`SearchDataContext`,
-`SearchResults`, `SearchSessionContext`, `siteRegistry`, `HubHome`, `HubStats`, the `ask-grounding` /
-`federation` / `ask` hub specs) were not touched.
-
-**Copy, final:**
-- Hub (`ArchiveShelf.tsx`): h2 **Official Instances** (no paragraph under it; the grid's top margin
- moved onto the h2), h2 **Archives You Added**. The card is title (+ Remove on an added archive), then
- the figures and the `Installable`/`Data-only` badge; `siteDescription` is no longer read.
- `AddArchive.tsx`'s comment names the new heading.
-- Homepage (`page.tsx`, `ArchiveCards.tsx`): h2 **Official Instances** (no paragraph), h2 **What It
- Does**; the card is title then figures. The page's copy-rule comment now says so.
-- `FamilyStats`' cell label "Official instances" is a stat label, not a heading, and stays in the
- strip's sentence case (like "Hours of speech"); not in the ruling.
-
-**Ko-fi.** `KOFI_URL = "https://ko-fi.com/archilyzer"` beside `PROJECT_URL` in `common/lib/project.ts`.
-Export footer (`export/app/components/Footer.tsx`): `<a target="_blank" rel="noopener noreferrer">Ko-fi</a>`
-in the "Built with Archilyzer" row, rendered **only when `instanceMode() === "hub"`** — a site build
-shows nothing. Homepage footer (`homepage/app/components/Footer.tsx`): the homepage has no "Built with"
-row, so the link sits in the **Elsewhere** column under the social icons; that column now always
-renders (it was gated on social links), the icon row only when links are set.
-
-**Layout without the description** (built hub served statically with the primary's `hub-sites.json` +
-`hub-summary.json` stubbed in; built homepage with the primary's `homepage/public` data), 1280 and 390,
-dark: the cards shorten by the description line; the figures stay aligned across a row (`mt-auto` on
-the figure block unchanged), and at 390 each card is title, figures, badge with no gap. Shots:
-`$T/c1b-hub-1280.png`, `$T/c1b-hub-390.png`, `$T/c1b-homepage-1280.png`, `$T/c1b-homepage-390.png`.
-
-**Changed locators:** `e2e-hub/official-instances.spec.ts` — `heading {level: 2, name: "Official
-instances"}` → `{level: 2, name: "Official Instances", exact: true}`; the card's `toContainText("Every
-word the member said.")` → `not.toContainText(…)` (the stub still carries a description, so the
-absence is proved); `getByText("The archives I run")` count 0; `heading "Archives you added"` →
-`"Archives You Added"`; new test "the hub footer carries a bare Ko-fi link" (href `KOFI_URL`,
-`_blank`, `noopener noreferrer`, text exactly `Ko-fi`). `homepage/e2e/marketing.spec.ts` — `heading
-"Official instances"` → `{level: 2, name: "Official Instances", exact: true}` + "The archives I run"
-count 0; new "the headings after the H1 are in Title Case" (`What It Does`, exact) and "the footer
-carries a bare Ko-fi link". `export/e2e/site-branding.spec.ts` — new "a site build carries no Ko-fi
-link" (no link named Ko-fi, no `a[href=KOFI_URL]`). **Left unchanged deliberately:**
-`e2e-hub/federation.spec.ts:151` `heading {level: 2, name: "Archives you added"}` (C2's file) — a
-Playwright role name without `exact` is a case-insensitive substring, so it matches "Archives You
-Added" and passes (it did: e2e:hub 12/12); C2 or a later slice may make it exact. Its test title still
-says "Archives you added" (a string, not a locator).
-
-| sha | what |
-|---|---|
-| `764f770e` | `common/lib/project.ts` `KOFI_URL`; Ko-fi in the hub footer (hub only) and the homepage footer's Elsewhere column |
-| `0e9192e9` | Title Case h2s, the "archives I run" line removed, no description on the official cards — hub `ArchiveShelf` (+ `AddArchive` comment), homepage `page.tsx` + `ArchiveCards` |
-| `35aafad3` | the spec locators above; Ko-fi specs (hub, homepage, site-mode absence) |
-
-**Gates** (on `35aafad3`): tsc clean (per commit). Common tests **1,845/1,845**. `pnpm --filter export
-exec next build` (site) ok; `compose:hub` (worktree, no corpus: "0 built-in pool site(s) …;
-hub-summary.json skipped") + `INSTANCE_MODE=hub … next build` ok (the known Turbopack warning) — the
-seven compose-hub outputs in `export/public` swapped for copies before and relinked after, primary's
-files untouched (`hub-sites.json` / `hub-summary.json` still 19:42); the built hub `index.html` carries
-the Ko-fi anchor. `pnpm --filter homepage exec next build` ok. e2e, queued (no wait): **`e2e:hub` 12
-passed** (11 + 1), 45 s; export `site-branding.spec.ts theme.spec.ts` **8 passed**, 26 s; **homepage
-suite 24 passed**, 57 s, with the Official Instances branch exercised (summary present). Editor build,
-editor unit, test:scripts and mcp not run: nothing they build or test changed beyond a new constant in
-`common/lib/project.ts`, which tsc covers. **Numbers tools: none.**
-
-**Found and left:**
-- **Homepage worktree data must be COPIED, not symlinked.** `homepage/app/lib/snapshot.ts` reads
- `public/downloads/snapshot.json` at build, and Turbopack refuses a symlink that leaves the project
- root ("Symlink … is invalid, it points out of the filesystem root"). The four gitignored entries
- (`channel-sites.json`, `downloads/`, `homepage-summary.json`, `stats/`; ~60 MB) were copied from the
- primary. `export/public`'s per-path links work only because nothing there is imported at build.
- Worth a line in FACTS / WORKTREES.md.
-- **The export e2e harness writes the primary's `export/public/sw.js` through the worktree symlink.**
- `export/playwright.config.ts` copies `service-worker/site-sw.js` to `public/sw.js` at load; in a
- worktree that `sw.js` is a link to the primary's, so the site-spec run (20:13:39) replaced the
- primary's hub service worker (10,027 B, from the 19:42 hub compose) with the site one (10,043 B).
- Restored: the hub build's `out/sw.js` from this worktree is byte-identical to the primary's
- `service-worker/sw-hub.js`, copied back and its mtime set to `hub-sites.json`'s (19:42:24). The C1
- gate statement "the six compose-hub outputs … relinked after" did not cover this path either. Fix
- candidate: unlink `public/sw.js` before the copy in `playwright.config.ts` (or add `sw.js` to the
- worktree-link exclusions). Not done here (not this slice's file).
-- The homepage lists instances in the summary's order (Jeralyzer first), the hub in `hub-sites.json`
- order (Anilyzer first); the colours agree per site. Pre-existing (C1), not a ruling.
-- Needs a rebuild + deploy of the hub AND the homepage; this slice did not run build-hub, deploy-hub
- or deploy homepage.
-
-### Slice C2, as shipped — federated search (2026-09-25)
-
-Branch `one-core/c2-federated-search` off `main` `6820bd21`; merged `main` (`8eb55add`, slice C1b) as
-`9d20d3fc`. **The operator-approved target (2026-09-25):** the hub searches every official instance
-by default, a visitor can take any archive out, each archive's state is visible, the search runs as
-soon as one archive is in, a failed member is named and retryable, a result names its archive in text,
-and pages are fetched per archive behind its manifest. Scoping: `$T/r9-hub-scope.md` §3.
-
-**The provider** (`common/components/SearchDataContext.tsx`, `MultiSiteDataProvider`). `FederatedSite`
-gains `enabled` (default true): false means none of that archive's feeds are fetched (`enabled: false`
-on its manifest, subs, posts and alias queries; no page descriptors) and nothing already cached from it
-is merged — TanStack returns cached `data` for a disabled query, so every merge checks scope itself.
-Per archive, its state is derived from its manifest, page, subs and posts queries: `ready` (manifest
-in, every page in, and its subs + posts manifests settled — a posts 404 is an empty manifest, a subs
-error counts as settled), `failed` (manifest or a page errored and nothing of it is fetching), `loading`
-(otherwise, including while a Retry is in flight), `off`. `SearchDataValue` gains two OPTIONAL fields,
-set only by the multi-site provider: `federation: {sites: FederatedSiteState[], retry(origin)}`
-(`{origin, siteTitle, accent?, status, count?, error?}`, `count` = the manifest's `totalCount`) and
-`siteTitleOf(origin)`. `retry` is `refetchQueries` over this provider's five feeds (`manifest`, `summaries-page`,
-`subs-manifest`, `posts-manifest`, `search-aliases`) of that origin whose status is `error`. `summariesState.error` is no longer always null: it is set when
-EVERY in-scope archive failed (read by `/ask`'s corpus-error line). `SingleSiteDataProvider` is not
-touched.
-- **Merge.** An archive's records join the merged list only when it is `ready`, so the list grows one
- whole archive at a time; the merged list's identity is keyed on the ready set alone, so the search
- session (which re-runs its pipeline on every new `summaries` identity) re-runs once per archive, not
- per page or per manifest. The subs, posts and alias merges are keyed on the same ready set, so every contribution of an
-archive lands in one re-run and a failed archive contributes nothing — no videos, posts or chat
-(before: whatever pages had loaded, and its posts regardless).
- The synthetic merged manifest (HubStats' transcript figure) covers the ready archives. Channel groups
- and channels cover the in-scope archives whose manifest has arrived.
-- **Progressive.** A new `progressive` prop: `summariesReady` turns true at the first ready in-scope
- archive. Without it (the `/ask` hub, `AskHub.tsx`, unchanged), it waits until every in-scope archive
- has settled, ready or failed. HubHome passes it. The release-8 slice E rule holds unchanged: a
- restored query is `runHeld` in `SearchSessionContext`, independent of readiness, so it still waits
- for the visitor; a `qt=` link runs over the first archive and re-runs as each further one arrives.
-- **Speed.** Pages are requested per archive only once its manifest has settled and only while it is in
- scope (as before for the manifest gate; new for scope), and each page fetch goes through a per-origin
- gate of **6 in flight** (`PAGE_FETCHES_PER_SITE`), so a big member cannot take the browser's
- connections from the small ones. The page `queryFn` consumes TanStack's `signal`, so switching an
- archive off mid-load cancels its queries and a page still waiting at the gate bails unfetched. No new build-time data.
-
-**The page** (`export/app/components/hub/`). `useHubScope.ts` keeps the set of origins switched OFF in
-`localStorage["ytdlp-tb:hub-scope"]` (`{off: [...]}`, every access in try/catch), so an archive the
-browser has not seen — a new official instance, an added one — is searched. `HubScope.tsx` is the row
-of chips under the live line, above the query builder: one per archive on the page (official and
-added), `data-testid="hub-scope-chip-<origin>"` + `data-status`, a toggle button (`aria-pressed`, the
-archive's title and `loading…` / its record count / `failed` / `off`) and, when failed, a `Retry
-<title>` button. `HubStats` counts the archives in scope and says "videos" (the chips' word for the same figure; was
-"transcripts"). Every chip button and the line's Retry carry a literal `focus-visible:outline-2
-focus-visible:-outline-offset-2 focus-visible:outline-ring` (the chip's `overflow-hidden` clipped the
-default outline). `common/components/SearchResults.tsx`: one line
-above the results when an in-scope archive failed, `role="status"`, `data-testid="hub-scope-status"`:
-"N of M archives answered. X did not, so its videos are not in these results. Retry" ("archive" when
-M = 1) — only once NOTHING in scope is loading, so M = ready + failed and every archive not counted is
-named; nothing while every archive is fine (the chips show loading). A result card's meta line reads
-`<archive> · <channel> · <date>` (`data-testid="result-source"`, from `ResultGroup.source`, set via
-`siteTitleOf` in `SearchSessionContext`); single-site groups carry no `source` key. The accent stripe
-and the `data-result-slug` contract are unchanged.
-
-**Specs.** New `export/e2e-hub/federated-search.spec.ts` (+5), two official members route-mocked with
-CORS: (1) both searched by default, both chips `ready`, each card names its archive, no status line;
-(2) toggling Origin B off removes its card and after a reload it stays off with **zero requests** to its
-origin, and back on it is fetched and returns; (3) Origin B's pages aborted → chip `failed` with `Retry
-Origin B`, "1 of 2 archives answered." / "Origin B did not", Origin A's card renders; fixed + the line's
-Retry → chip `ready`, line gone, both cards; (4) Origin B's page held → Origin A's search result renders
-while B is `loading`, and the same search covers B once it is released. (5, review) three members, B failed and C
-held → no line; C released → "2 of 3 archives answered." naming B. `federation.spec.ts`: "Archives
-You Added" exact (C1b's Title Case). Every existing hub test id / accessible name is unchanged.
-
-| sha | what |
-|---|---|
-| `af8b30ed` | provider: scope (`enabled`), per-archive state + Retry (`federation`), ready-only merge, `progressive`, per-origin page gate of 6, `error` when all failed, `siteTitleOf` |
-| `f7f7482f` | hub: `useHubScope`, `HubScope` chips, HubHome wiring (`progressive`), HubStats counts the archives in scope |
-| `d0225a20` | a result names its archive (`ResultGroup.source`); the "N of M archives answered." line with Retry |
-| `0b891b8f` | `e2e-hub/federated-search.spec.ts` (+4) |
-| `9d20d3fc` | merge `main` (`8eb55add`, C1b) — no conflicts |
-| `6a69c034` | `federation.spec.ts`: "Archives You Added", exact |
-| `a0bd7b02` | a chip's title says what its number counts and what pressing it does |
-| `40818bbb` | the merged list's identity keys on the ready set alone (no re-run when another manifest lands) |
-| `d54e6814` | review fixes: ready needs subs + posts settled and their merges key on the ready set; the answered line waits for every archive (+ `role="status"`, singular); focus rings; page `signal`; "videos"; Retry scoped to the five feeds; spec +1 |
-
-**Gates.** tsc clean (per commit; full workspace on `9d20d3fc`+ and on `40818bbb`). Common tests
-**1,845/1,845** (no new unit tests: the provider is a hook, covered by the e2e). test:scripts **162 passed
-+ 1 skipped**. `pnpm --filter export exec next build` (site) ok, 29 s; `compose:hub` (worktree, no
-corpus: "0 built-in pool site(s) …; hub-summary.json skipped") + `INSTANCE_MODE=hub … next build` ok,
-32 s. e2e, queued, all on the merged tree: **`e2e:hub` 15 passed** (pre-merge, 48.9 s), **16 passed**
-(merged, 53.2 s), **16 passed** (`40818bbb`, 47.0 s); **export full suite 195 passed**, 8.5 min (single
-site unchanged); **`e2e:2origin`** (`TWO_ORIGIN_REBUILD=1`) **3 passed**, 46.9 s on `a0bd7b02`, and **3 passed**,
-1.0 min on `40818bbb`.
-
-**Review (SHIP AFTER FIXES) re-gate** on `d54e6814`: tsc clean; **`e2e:hub` 17 passed** (16 + 1), 52.9 s. The seven compose-hub outputs + `sw.js` in the worktree's `export/public` were
-swapped for copies before every build/e2e and relinked after; the primary's copies were not written by
-this slice (one change seen, `hub-summary.json` at 20:18:20, is the parent's build-hub, which wrote the
-other six at 20:17:53). Editor build/unit and mcp not run: nothing they build changed. **Numbers tools:
-none.**
-
-**Seen against the live members** (the built hub served locally with the real five-site
-`hub-sites.json`, service workers blocked so routes apply): first result card at 1.0–2.2 s; chips ready
-Hasanalyzer/Rekietalyzer ~1.6–2.0 s, Bonnellyzer ~2–2.9 s, Anilyzer ~2–4.5 s, Jeralyzer ~3.1–5.1 s.
-With Hasanalyzer's pages aborted: "4 of 5 archives answered. Hasanalyzer did not, …", its chip failed
-with Retry, 72,360 records from the other four listed. Checked at 1280 dark and 390 dark.
-
-**Found and left:**
-- The chip's number is the member's summaries `totalCount` — its record (video) count, the number the
- results header counts ("All videos (N)") — not the card's "transcripts" figure, which is the
- homepage's build-time `transcribed.total`. The chip's title says "N videos from X are in the search";
- the live line now says "videos" too.
-- A member whose manifest loaded but whose pages failed keeps its channel group in the filter panel
- (the channels are known); its records are not searched. Hiding the group on failure would churn the
- groups on every Retry.
-- **Follow-up:** the `/ask` hub has no scope chips and searches every archive on the page, as before;
- the scope is the front page's. Honouring it is `useHubScope().isOn` in `AskHub`. It waits for every archive to settle (not progressive), so a chat never grounds in
- a half-loaded federation silently.
-- **Follow-up:** official cards have no `accent` (C1: they wear `seriesColor` on the page), so result
- stripes and chip dots appear only for an archive that sets one — the text attribution is what names
- the source. The fix is one shared fallback (a `shelfAccent(site, summary, i)` out of `ArchiveShelf`)
- used by HubHome and AskHub too.
-- `route()` does not see requests a service worker makes; a manual check of the built hub needs
- `serviceWorkers: "block"`. The e2e-hub suite runs `next dev`, where no SW is registered.
-
-## Rollout
-
-## Rollout 2026-09-25 (evening) — `0213f6c8` live on :3001 (third restart of the day)
-
-Merge order: release 9 slice F (`one-core/r9-fixes` `7a646efa`, review SHIP AFTER FIXES → re-read
-SHIP) merged as `ef0978a6`; slice C1 (`one-core/c1-hub-look` `545cf025`, which had merged main and
-re-gated) merged as `0213f6c8`. Scripts: `plans/tools/rollout/` with `REL=r9` (`4bdb1f5e`, step 0 of
-the evening plan), plus `$T/r9-{build,restart,hub-home,sync}.sh`.
-
-**Gate on the merged tree** (`7a646efa`, tree = `ef0978a6` minus a STATE commit): tsc 0; common
-1,839; editor unit 78; scripts 162 + 1 skip; editor `next build` ok; e2e 14 specs 86/86, 5.9 min.
-C1's re-gate on `11e185c0` (main merged): tsc 0; common 1,845; export site build, `compose:hub` +
-hub build ok; `e2e:hub` 11/11; the projection of main's `buildHomepageSummary` (low H) over the
-primary's stats pages matched the live homepage summary exactly (5 / 63 / 75,785 / 49,767 /
-60,840 / 480; gone per site 473, 2, 2, 3, 0).
-
-**Editor build** on the primary at `0213f6c8`: 40 s, `BUILD_ID` `9pC6zELQSzjdkIPDNsVox` →
-`P0VMdKX7gbdsaiS5GvorF`. umtool untouched (still `a9YAe_dwhuM6DiCPzIwMD`, not restarted).
-
-**md5** 81 files (one more than release 8: the new `paramounttactcl-x` channel). before → pre-restart:
-ONE change, `paramount-tactical/config.json` — written 19:35:47, the operator clearing the
-`downloadFilter.include: "Quartering"` on the Configure form (the plan's "for the rest" step;
-`lastFullDownloadAt` had been stamped at 19:19:27 by download-missing, before the sweep).
-pre-restart → after-boot: identical.
-
-**Restart** 19:40: live jobs were only the two auto runners (no operator job). Editor answered 200
-after 3 s, `/tags` 200. **Boot pass (B4b):** 391 queued metas before → `[boot] stale queued jobs:
-re-queued 1, cancelled 390 (sync 345, superseded 1, stale 44)` → 1 queued meta after. The one
-re-queue was the paramount-tactical metadata-scan (`01M3CV5W6WG8QJW09G2F0N1V8A` →
-`01M3DF38BAH541K6A51XE8HXWG`), which ended **`done`** with nothing left to scan — the first live
-B1 proof: one `[safeRevalidate] no request store (a queued job ran outside a request); skipped
-revalidating /channels/paramount-tactical, /channels, /operations/[id] (page)` line in the start
-log, no `failed`.
-
-**B1 + B3 live proof:** `pnpm ops sync --json '{"slug":"teamrcn"}' --wait` exited **0** in 29 s,
-job `01M3DF7EQJB92BK2Q5QNN9H61R` `done` (release 8's ran the same work and read `failed`); its
-listing spawn carried `--sleep-requests 1` (`yt-dlp --flat-playlist … -I 1:50 --sleep-requests 1
-https://www.youtube.com/@teamrcn`). B4a: no STUCK on a healthy job seen. B2 waits for the next
-download-missing with filter-declined videos (Paramount's were all settled before the release).
-
-**Smoke** (`plans/tools/rollout/smoke.sh`, 19:42 → 19:49): `SMOKE_FAIL=1` from exactly the two
-moving pairs — `/api/jobs/active` vs `/api/view/activeJobs` (the proof sync ran during the read)
-and `/api/auto-queue/status` vs `/api/view/autoQueueStatus` (same 513,122 bytes; the diff is
-`focusPending` 107 → 112 / 1,353 → 1,348 and the lane's current video: the auto-download lane
-walking Paramount Tactical between the two reads). Everything else green: 6 pairs identical, 2
-404s, presets, pulse `changed=false` both ways, 11 pages 200, `BUILD_ID` `P0VMdKX7gbdsaiS5GvorF`,
-0 ZodError, `DEFERRED_OK download.deferred well-formed ("ok 0")` (the fixed check), umtool 200,
-`/channels/paramount-tactical/videos` 200 with 42 open rows.
-
-**Hub + homepage (C1):** `pnpm ops build-hub` 65 s — log: `hub-summary.json covers 5 official
-instance(s).`; `deploy-hub` 27 s → https://archilyzer-hub.pages.dev (deploy `6e7115f9`). Live
-check (Playwright): `data-theme="archilyzer"`, H1 "60,840 hours of speech from every official
-archive, searchable at once.", `Official instances` with 5 `shelf-spine` cards each showing
-channels / recordings / transcripts / hours (Anilyzer 23 / 29,751 / 8,365 / 8,159), no eyebrow,
-the live "Searching …" line, `/hub-summary.json` 200. `archilyzer build homepage` 47 s (v5) +
-`deploy homepage` 32 s → https://archilyzer.pages.dev (deploy `37fc10cc`), H1 present, still no
-hub link (C3). **The two summaries differ by 3 recordings** (hub 75,800, homepage 75,803): the
-auto-download lane archived three Paramount videos in the two minutes between the builds;
-transcripts, hours, gone identical.
-
-**Paramount Tactical (A2), the same evening:** metadata-scan `01M3DBFV07NC0Z6KWZ1BG3K9BX` scanned
-the last 201 (0 errors; store 1,370 + 12 members-only errors of 1,473); download-missing
-`01M3DD3WBVYPPXB1NCQ1HDX8BM`: 1,381 missing, 92 complete, 12 members-only excluded, **1,369 settled
-by the filter with 0 requests and 0 sleeps**; keep-videos matched 1 (`NV1QqS9NOiU`, already kept).
-Both ops jobs read `failed` on the pre-release invariant. After the operator cleared the filter
-(19:35) the auto-download lane took the channel at lane pace: archive 92 → 115 by 19:50.
-
-**Found and left.**
-- The hub orders its cards by `hub-sites.json` (alphabetical); the homepage orders by transcripts.
- Same colours per site (C1's `seriesColor` fallback keys on the summary's order), different rows.
-- No official site sets `accent`; all five hub cards wear series colours. A `site.json` edit each.
-- The hub build now walks the pool's `data/` and opens the LMDB read-write (as the homepage build
- does); an unmounted drive undercounts silently — C1 record.
-- YouTube's soft block ("try again later") classifies as `deleted` → per_video → no backoff — F record.
-- The boot pass waits for the storage boot pass with no timeout (review LOW); `/jobs` does not show
- `cancelReason`; the safeRevalidate warning is once per bundle.
-
-**C1b deployed (20:17 → 20:22, from `8eb55add`).** `build-hub` 80 s (summary covers 5), `deploy-hub` 32 s
-→ deploy `747b6a32`; `build homepage` 78 s + `deploy homepage` 37 s → deploy `e9954138`. Live: hub
-h2 "Official Instances", no "The archives I run", no card descriptions, footer `Ko-fi` →
-https://ko-fi.com/archilyzer; homepage the same (two "Official Instances", "What It Does", one Ko-fi
-link, still no hub link); Jeralyzer carries no Ko-fi link. Summaries: hub 75,880 / homepage 75,884
-recordings (the lane again), the rest identical.
-
-**C2 + C3 deployed (20:47 → 20:51, from `eebcaa90`).** C2 review SHIP AFTER FIXES → fix `d54e6814`
-(readiness = summaries + subs + posts settled; status line hidden while loading, M = ready + failed,
-`role="status"`; focus rings; page fetches honour the abort signal; "videos"; Retry predicate scoped)
-→ re-read SHIP (one LOW left: `retry: false` on the subs query would make a member with no subs
-corpus ready ~1 s sooner). Merged as `eebcaa90`. C3 = `e6fed1a0` (`HUB_LINK_ENABLED = true`).
-`build-hub` 71 s (covers 5) + `deploy-hub` 29 s → deploy `6ef7f472`; `build homepage` 59 s +
-`deploy homepage` 37 s → deploy `e09900af`. Live (Playwright, service worker blocked): first result
-at 1.6 s, all five archives ready at 3.5 s, chips `Anilyzer 29,751 | Bonnellyzer 8,079 | Hasanalyzer
-3,425 | Jeralyzer 31,605 | Rekietalyzer 2,925`, no status line, a card reads `Jeralyzer ·
-TheQuartering (Rumble) · 2026-09-25`, "All videos (75785)" → toggling Anilyzer off → 46,034
-(exactly minus 29,751). Homepage: "Search all archives" → https://archilyzer-hub.pages.dev, Ko-fi
-link present. Summaries 75,945 (hub) / 75,947 (homepage) recordings — the lane, again.
-
-The 2026-09-25 evening plan is complete through step C. Worktrees for r9, c1, c1b, c2 removed.
diff --git a/plans/reports-on-homepage.md b/plans/reports-on-homepage.md
@@ -318,7 +318,7 @@ articles; a public build with zero public articles rc 0, stamp `articles: []`.
- Main had moved by one plans-only commit (the release-25 mirror record); merged into `r26/integration`
(`be4b0523`), then `git merge --ff-only` on main.
-## Gates (tip `0b0079f5`; `be4b0523` differs only in `plans/release-25.md`)
+## Gates (tip `0b0079f5`; `be4b0523` differs only in `plans/archive/releases.md` (entry `release-25.md`))
- Privacy counts over `515a9ac7..0b0079f5` (21 commits): all 0; one identity.
- typecheck green; `docs env|files|cli --check` and `settings example --check` green.
diff --git a/plans/rumble-sweep-pacing.md b/plans/rumble-sweep-pacing.md
@@ -1,84 +0,0 @@
-# Plan — a full sweep of a large Rumble channel must be paced, or it never completes
-
-> **Superseded by `plans/release-5.md` slice R** (shipped on `one-core/r5-rumble`, 2026-09-24). The
-> release plan corrects this one: four arg-builders plus the unargued probe, not one `configArgs`;
-> impersonation for every Rumble spawn; a 429 mid-sweep is "incomplete" and falls back to the paged
-> walk. Kept for its 2026-09-24 findings; do not implement from it.
-
-**Found 2026-09-24** (operator: "job `01M3AVGZC5EZ9GCD04R9QW6NWX` keeps trying and failing a full
-playlist fetch … no sync has happened in 44 days"). Facts verified on the live corpus and
-`4130aca1`:
-
-- `the-quartering-rumble` (`https://rumble.com/c/TheQuartering`, 7,866 listed / 7,871 archived)
- has `lastFullSweepAt: null`, so `isFullSweepDue` (`common/jobs/deepSync.ts:33-40`) is true on
- every sync and `sync()` (`common/ytdlp/runYtdlp.ts:1333-1336`) always takes `syncFullSweep`,
- never `syncPaged`.
-- The sweep's one `--flat-playlist` spawn walks the channel's listing pages back to back; Rumble
- answers **HTTP 429 on page 155** (job log line 173). The patched extractor
- (`~/Projects/yt-dlp-patched`, the pipx editable install the editor runs) logs the error and
- finishes with 3,846 entries, but yt-dlp exits 1; `enumeratePlaylistUrls`
- (`runYtdlp.ts:352-361`) throws on any exit other than 0/101 and discards stdout. Nothing stamps
- `lastSyncedAt` (2026-08-11) or `lastFullSweepAt`; the next sync is a sweep again. Three
- attempts on 2026-09-24 (16:05, 20:20, 23:20 UTC), identical.
-- **Tolerating exit 1 is the wrong fix.** The 3,846-entry listing is half the channel. The shrink
- guard (`common/controller/acceptListing.ts`, `fullSweepShrinkGuardPercent` 10 %, floor 25)
- would reject it once, and a second identical partial read — the same 429 at the same page —
- would *confirm* a mass deletion and truncate the stored `playlist`. The throw is what prevents
- that today.
-
-**Step 1, applied by the operator 2026-09-24 (no code):** `fullSweepIntervalMinutes: 0` on the
-channel, through `pnpm ops channel-config` (the `patchChannelConfig` writer), so every sync is
-the paged walk (`--lazy-playlist -I start:end`, a few newest pages, stops at the first archived
-hit) and new videos arrive on the next cadence. Cost until step 2: no maybe-missing detection for
-this channel.
-
-**Step 2, a small slice after one-core Phase 3 release 4** (it edits `runYtdlp.ts`, in slice W's
-file set, so it lands after W merges):
-
-1. **Pace the enumeration for Rumble.** Add `--sleep-requests <s>` to the sweep spawn when the
- channel's platform is Rumble (a per-platform table beside `downloadQueueKey`, not a per-channel
- knob; the value is an operator setting under `syncScheduler`, default ~1 s). Pacing applies to
- every page request, which is exactly where the 429 comes from.
-2. **A sweep that ends on a 429 is "incomplete", not "failed" and not "a listing".** Detect the
- 429 in stderr (or the non-zero exit with a partial stdout) and record it on the roster as an
- incomplete observation: it must not enter `acceptListing` as a reading (so two identical
- partial walks can never confirm a deletion), and it must not stamp `lastFullSweepAt`. Log one
- line naming the page it reached.
-3. **Do not re-sweep on a cooldown.** After an incomplete sweep, the next syncs are paged walks
- until a per-platform cooldown (reuse the rate-limit cooldown the download runner already keeps
- for YouTube 429s, keyed `platform:rumble`) has elapsed — today a failed sweep is retried at
- every cadence, each one another 155-page walk that keeps the limit tripped.
-4. **Tests:** unit for the incomplete verdict (partial + 429 → no `acceptListing` call, no
- stamp), the cooldown gate, and the pacing arg on a Rumble channel only; the `runYtdlp` e2e
- fixtures with a fake yt-dlp that exits 1 after N pages.
-5. **Rollout:** after the slice is live, restore the channel's `fullSweepIntervalMinutes` (delete
- the override) and watch one paced sweep complete; the first complete listing after 44 days may
- legitimately shrink — the two-observation guard handles that as designed.
-
-## Found next, 2026-09-24 19:36 — Rumble's embed endpoint answers 403 to every download
-
-Step 1 worked: job `01M3AWDQ4RZD6CV93BJPREQVPX` ran the paged walk (`--lazy-playlist -I 1:50`),
-listed the newest page and found new videos. The first download died on
-`[RumbleEmbed] … Unable to download JSON metadata: HTTP Error 403: Forbidden`
-(`https://rumble.com/embedJS/u3/`, `rumble.py:168`), the managed download aborted as "network",
-and the sync failed on that one video. **It is not that video and not the patch:** the
-`leaflit-rumble` and `rekietalaw-rumble` syncs at 16:05 UTC hit the same 403, and no retained
-job log holds a successful Rumble archive line. Upstream: yt-dlp issue #17496 (opened 2026-08-20,
-same error, same `2026.08.19`, labelled *impersonation* + *site-bug*, no fix), after #15089 /
-#15148 / #15129 (Rumble behind Cloudflare, browser-only fingerprints); a June report says
-`--impersonate chrome` worked for a while. The editor never passes `--impersonate`
-(`grep -rn impersonate common editor` is empty) although the pipx venv has `curl_cffi` targets
-(Chrome-133/136, Safari-18).
-
-**Step 0 for the slice, ahead of pacing:** a per-platform yt-dlp args table (Rumble →
-`--impersonate chrome`, and the pacing from step 2) applied in `configArgs`
-(`common/ytdlp/runYtdlp.ts:221`) so every Rumble spawn — enumeration, metadata probe, download —
-carries it; `downloadQueueKey` (`common/lib/queueKeys.ts:69`) already resolves the platform.
-Verify first by hand, ONCE, metadata only (operator's rule: fetches go through Archilyzer;
-this is the ask-first exception):
-`yt-dlp --impersonate chrome --skip-download --print title https://rumble.com/v7fxzsc-lindsay-clancy-insane-twist-on-the-view-these-people-are-nuts.html`.
-If that also 403s, Rumble is closed to this client until upstream moves and the slice waits;
-the channels then need a "source unreachable" outcome rather than a failed sync per cadence.
-
-Out of scope: tolerating exit 1 generally; changing the shrink guard; anything in the patched
-extractor (the pagination fix is in and working; the 429 is Rumble's rate limit, not a bug).
diff --git a/plans/site-exports-off.md b/plans/site-exports-off.md
@@ -1,56 +0,0 @@
-# Plan — visitor exports off on the published sites, kept as an option for the OSS release
-
-> **Superseded by [`release-5.md`](release-5.md) slice X** (shipped as "### Slice X, as shipped"
-> in its Record). Kept as written for the inventory; where the two differ, release-5.md wins —
-> notably there is no `pnpm ops site-config` (the site form is the one writer), and the hub has no
-> `site.json` of its own.
-
-**Asked 2026-09-24** (operator, mid release 4): turn off "exports" on every existing published
-site to strengthen the legal footing of the operator's own instances, while keeping the
-capability as a per-site option so anyone running the OSS release can leave it on. Scheduled as
-the release AFTER one-core Phase 3 release 4 (it needs a rebuild + deploy of the five published
-sites, and Phase 3's slices are already cut). Inventory below was taken on `4130aca1`
-(2026-09-24, one Explore pass); re-verify the path:line anchors before cutting the slice.
-
-## What a visitor can export from a published site today
-
-| Surface | Where | Switch today |
-|---|---|---|
-| Downloads page: whole-channel `.zip` of transcripts + live chat, its nav and footer links | `export/app/downloads/page.tsx`, `export/app/components/Header.tsx:39,49`, `Footer.tsx:38,44-50`; zips built by `common/bin/build-archives.ts` | `site.archives` (`common/lib/siteSchema.ts:86`, SITE.md), absent = **on** |
-| Offline / PWA whole-channel cache in the browser | `export/app/components/OfflineManager.tsx`, `export/app/offline/page.tsx` | `site.pwa`, default **off** |
-| Duplicates page (bulk cluster listing) | `export/app/duplicates/**` | `site.duplicates`, absent = on |
-| Per-video **Download** menu (txt / srt / json), **Copy MD**, **Copy download command** (a `yt-dlp --download-sections` string; the site never serves media) | `common/components/TranscriptModal.tsx:405-500`, impl `common/components/PlayerProvider.tsx:480-572` — client-side from cues already in the browser | **none** — unconditional on every build |
-| Machine contract: `/corpus.json`, `/llms.txt`, tree manifests, `page-<NNNN>.json` shards, `robots.txt`, `sitemap.xml` | written by `common/bin/compose-site.ts:158-185`; URL contract `common/lib/archive/contract.ts` | none, and must **stay unconditional**: the MCP server (`common/lib/archive/reader.ts` `RemoteSource`, `mcp/src/sourceRegistry.ts`) and `umtool/report-to-video/cues.mjs` walk it over HTTP — it is the "no local corpus" research mode `AGENTS.md` promises |
-
-None of the six `transcripts/sites/*/site.json` files sets `archives`, `pwa` or `duplicates`
-today, so every published site ships the zip Downloads page and the in-modal buttons.
-
-## The slice
-
-1. **One new `site.json` key**, `transcriptDownloads` (name to settle at planning; boolean,
- absent = **on**, so the OSS default is unchanged and the operator opts out per site), declared
- in `common/lib/siteSchema.ts` beside `archives` and regenerated into `SITE.md`
- (`file-schemas-docs.ts --check` stays green). It gates the three in-modal actions (Download
- menu, Copy MD, Copy download command) on the export site only. `TranscriptModal` is shared with
- the editor, so the gate is a prop the export site derives from `currentSite()`
- (`export/app/lib/site.ts`); the editor keeps every button.
-2. **`archives: false`** on the operator's sites — the existing switch; no code.
-3. Nothing changes for `/corpus.json`, `llms.txt`, manifests or shards. The `llms.txt` prose and
- `use-with-ai` page (`export/app/use-with-ai/page.tsx:128-136`) already hide the Downloads link
- when archives are off; check the prose does not still promise zips.
-4. **Site form + `pnpm ops`**: the two new/used keys are set through `writeSite` (the site's
- Publish tab or `pnpm ops site-config`), never by editing `site.json` by hand.
-5. **Rollout**: for each of the five published sites (jeralyzer, rekietalyzer, hasanalyzer,
- anilyzer, bonnellyzer; jasolyzer has no `siteUrl`), set `archives: false` +
- `transcriptDownloads: false`, then `build-site` + `deploy-site` — five independent runs; the
- archives volume can be pruned afterwards. Verify per site: no `/downloads` link, no Download menu
- in a transcript modal, `/corpus.json` and one `page-0001.json` still 200.
-6. **Tests**: export e2e for the gated modal (buttons present with the key absent, absent with it
- false), the existing archives-off coverage, a schema round-trip in `phase3-files-numbers.ts`
- (unknown-key check must not flag the new key on either side).
-
-Out of scope, stated: gating the machine contract (breaks the MCP and report-to-video), removing
-"Copy share link" (not an export), umtool's clip fetching (operator tooling, not visitor-facing).
-
-Open for the operator: whether the Duplicates page counts as an export (it lists, it does not
-serve data) and whether the hub (`_homepage`) needs the same key.
diff --git a/plans/siteorigin-check.md b/plans/siteorigin-check.md
@@ -1,38 +0,0 @@
-# The QR-origin check — exact (lane `lane/siteorigin-check`)
-
-Asked by the operator on 2026-10-23: "Am I good to click 'fix manifest' on the huck video in umtool? And why do I
-have to click it for everything?" → "queue it" (fix the check).
-
-## Findings
-
-- `umtool decisions` (read-only, 2026-10-23, before): 30 `manifest-invalid` rows on `provenance.siteOrigin`, every
- one "missing — every QR in this cut encodes `undefined/?v=…`". 28 are deck cuts with `qr.links: "original"` whose
- every clip's cue file names its page (`webpageUrl`); one has the deck's `qr.show: false`; one has `render.qr: false`.
- None of them draws a code built from the origin.
-- "Fix the manifest" (lib/inbox/groups.mjs `ACTION_LABEL`) is a link: the decision's `href`, the project's Overview,
- whose decision row prints the decision's sentence. It changes nothing on disk.
-
-## Rulings
-
-1. `lint.mjs` `originQrsOf(manifest, { metaOf })` is the one answer to "which codes are built from
- `provenance.siteOrigin`": it runs `qrsOf` — the build's `deckQrUrl`, `qrUrlFor`, `postQrUrl` — with the origin set to
- a probe and keeps the codes whose link starts with it. A post counts only when an origin is set (with none,
- `postQrUrl` links the post itself).
-2. `qrsOf` takes `metaOf(entry)` (the clip's record `{ webpageUrl }`) for the deck's `qr.links: "original"`, honours
- the deck's `posts.qr: false`, and tags each code with its entry/post `id` and `source`.
-3. `report.mjs` `deadOriginQrsOf(dir, m)` reads each uncited deck clip's `webpageUrl` from its cue file (the record the
- build reads; memoised, the same files `sourcesOf` reads) only when the origin is missing or dead and the deck shows
- its QR under `"original"`; otherwise `originQrsOf` alone. The summary carries `deadOriginQrs` for the decision pass.
-4. A MISSING (or blank) origin is a defect — the "dead QR origin" flag, the `dead-origin` attr, the blocking
- `manifest-invalid` — only when at least one code is built from it. With none, nothing is added (no info row).
-5. A SET origin that is dead (localhost, a LAN address — `isDeadOrigin`) blocks whatever links it, as before.
-6. The sentence names the count and up to three ids ("`a`, `b`, `c` and 2 more") and the fix: set
- `provenance.siteOrigin` (to the public archive, for a set dead one); give those clips a `citeUrl` when clips are
- among them; set `provenance.qrLink` when a rail card's or still's tile is; give those posts a `siteUrl` when posts are.
-7. The action stays "Fix the manifest", linking the Overview, where the sentence carries the fix.
-8. `originUnused` is removed; `originQrsOf` replaces it.
-
-## Counts
-
-`node umtool/bin/umtool.mjs decisions --json` over the real projects (run with every fs write refused): before 30
-siteOrigin rows (1,147 blocking of 1,360); after 0 (1,117 of 1,330). No other row changed.
diff --git a/plans/source-mirror.md b/plans/source-mirror.md
@@ -1,518 +0,0 @@
-# Release 12 — the source mirror: a read-only git clone on the project site
-
-Written 2026-09-27 in plan mode, RE-CHECKED 2026-09-28 against `main` `90c7f776` (128 commits later;
-see "What changed since the plan was written"). Self-contained for a fresh session. The design was
-verified by three Explore passes and one Plan pass; the dumb-HTTP clone, the filter-repo scrub and
-wrangler's upload filter were PROVED in scratch. Rules: `plans/tools/implementer-rules.md` (one Opus
-implementer per slice in a worktree, one read-only Opus review, the parent merges). Two slices, Q
-then R. Record file: `plans/release-12.md` (NEW, the shape of `plans/release-11.md`). Memory to read
-first: `release-11-overnight`, `fetch-clip-shipped`, and the audit at
-`~/reports/repo-mirror-audit/AUDIT.html`.
-
-## What changed since the plan was written (re-check 2026-09-28)
-
-- **"Release 11" is taken**: the overnight of 2026-09-28 merged slices O1–O6 (+ O2b, O1c, O6c) to
- `main`, NOT rolled out (owed by the operator: cut, :3001 restart, a settings save, the deploys;
- runbook `~/reports/overnight-2026-09-28/MORNING.html`). This work is **release 12**, slices Q and R.
-- `DEPLOY_CLOUDFLARE.md` is GONE, absorbed into **`PUBLISH.md`** (`## Cloudflare Pages` :70,
- `## Download archives and R2` :137). Every doc edit this plan aimed at it goes to `PUBLISH.md`.
-- **Env vars are a registry**: `common/lib/envVars.ts` declares every variable the code reads, a
- test fails on an undeclared read, `ENVIRONMENT.md` is GENERATED (`pnpm archilyzer docs env`,
- `--check` in the gates), and path overrides are read by `getPaths()` (`common/lib/paths.ts`) and
- nowhere else. Test-only variables carry an `E2E_` prefix and are declared in the playwright config.
-- **`archilyzer doctor`** exists (`common/bin/doctor.ts` + test) — slice R adds its checks there.
-- **The homepage builds from `/sites` now** (release 11 O4): `editor/app/sites/lib/
- homepageDeployActions.ts:51,95` call `buildHomepage` IN-PROCESS, and `pnpm ops build-homepage`
- reaches them. So the source step also runs inside the editor's process and its PATH.
-- Anchors that moved: `buildHomepage` is `common/publish/build.ts:973`; `WORKTREES.md:119`;
- `umtool/components/BuildChain.tsx:147-149`. The umtool path literals are where they were.
-- Baselines now: common **2,112**, editor unit 85, `test:scripts` **185 + 1 skip**, mcp 269,
- homepage unit 2, homepage e2e **31** (specs: brand, docs, downloads, instance-colours, marketing,
- no-data, stats, theme).
-- Still true: 1,985 lines with `/home/user` outside `plans/`, 20 `umtool/song/*.sh`, `/run/media/user`
- in five `common/` files AND one line of `editor/CHANGELOG.md`; `create-archives.sh` exists and
- nothing calls it; pipx and gitleaks installed, git-filter-repo not; `~/.config/archilyzer/` absent.
-
-## Working alongside the parallel session (operator's instruction, 2026-09-28)
-
-- **Nothing is edited in the primary checkout.** Each slice gets its own worktree from `pnpm wt
- add`: `r12/paths-fix` → `/home/user/Projects/r12-paths-fix`, then `r12/source-mirror` →
- `/home/user/Projects/r12-source-mirror` (branched after Q merges). Seven `r11-*` worktrees exist
- and are the operator's to remove; do not touch them.
-- **This plan enters the repo on the slice branch**, as `plans/source-mirror.md` in Q's first
- commit — never as a direct commit to `main`.
-- **Merging into `main`** happens in the primary with one command, only when `git status --short`
- is empty and no merge is in progress: `git merge --no-ff r12/<slug>`. If the tree is dirty (the
- parallel session is mid-change), wait and re-check; never stash or touch its files. Expected
- conflicts: `editor/CHANGELOG.md` `[Unreleased]` and nothing else (the record file is new).
-- Scratch: `$CLAUDE_JOB_DIR/tmp`, files prefixed `q-` / `r-`. e2e is queued machine-wide.
-
-## Context
-
-The operator wants the repo mirrored on the project site (https://archilyzer.pages.dev, the
-`homepage/` Next.js 16.2.3 static-export app on Cloudflare Pages) as static, read-only files. The
-2026-09-26 pre-publication audit found no secret and no personal identifier in the 1,648-commit
-history except the Unix username in `/home/user` paths (a first name) — plus, found during design,
-`/run/media/user` in a few `common/` tests and two backticked `user` mentions in `plans/`. Today the
-site ships only a hand-run, stale (2026-08-12) `git archive` tarball (`create-archives.sh`, whose
-header says "no public git remote, by choice" — the policy this release reverses on the operator's
-word). Outcome: `git clone https://archilyzer.pages.dev/source/archilyzer.git` works with nothing but
-static files (git's dumb-HTTP protocol), a raw browsable tree sits at `/source/tree/`, the tarball is
-regenerated per deploy, and a gate refuses to publish anything that still carries a denied literal.
-
-## Decisions (made with the operator 2026-09-27; do not re-open)
-
-- **Mirror = `main` only**, no other refs (no tags exist). **Scrub** `/home/user → /home/user` in
- file contents AND commit messages; **keep** the `Co-Authored-By` trailer. (Superseded 2026-10-09:
- the `Claude-Session` trailer and every Claude session link are removed by a built-in rule and
- refused by the audit — AGENTS.md, first section.)
- **`plans/` ships as-is.** The 20 one-off `umtool/song/*.sh` run-log scripts are **deleted**.
-- The private repo's history is never rewritten. The public mirror is generated by
- `git-filter-repo` (deterministic: two runs gave identical ids) on a fresh bare clone at every
- homepage build; its commit ids differ from the private repo's and the page says so.
-- The mirror directory is `/source/archilyzer.git/` — NEVER a path segment literally named `.git`:
- wrangler's upload `IGNORE_LIST` (`**/.git`, `**/node_modules`, …) drops it silently, while
- `archilyzer.git` passes (verified in wrangler 4.107 source). Extensionless files (`HEAD`,
- `info/refs`) upload fine.
-- Operator-private inputs live OUTSIDE the repo in `${ARCHILYZER_CONFIG_DIR ?? ~/.config/archilyzer}/`:
- `source-scrub.txt` (filter-repo `lhs==>rhs` lines; the step always prepends `${os.homedir()}==>/home/user`)
- and `source-denylist.txt` (one literal per line, `i:` prefix = case-insensitive; every scrub lhs is
- implicitly denied). Missing file → refusal naming the path. Nothing with the username is in code.
-- The step is one CLI verb, `archilyzer source publish`, and `buildHomepage` runs it between
- `composeHomepage` and `next build` (`common/publish/build.ts:973-985`), so `archilyzer build
- homepage`, the runbooks' home scripts and the `/sites` homepage jobs all produce it. It
- writes only under gitignored `homepage/public/{source,downloads}` with the link-safe writers in
- `common/bin/_publicFile.ts` (`ownDir`, `writePublicFile`, `copyPublicFile`).
-
-## Verified facts the implementer must not re-derive
-
-- `git clone --no-local --bare --single-branch --branch main` is load-bearing: a same-host
- `--mirror` copies ~52 MB of loose garbage (`.git/objects/ac/tmp_obj_*`). After filter-repo the
- pack grows 13.1 → 21.5 MB; `git repack -a -d --max-pack-size=20m` splits it (a 21-pack layout at
- 2 MB each cloned fine over `python3 -m http.server`). Pages caps: 25 MiB per file, 20,000 files
- per deployment (`src/pages/constants.ts`); the step refuses at 24 MiB / 15,000.
-- `--replace-text` rewrites blobs only; one commit MESSAGE carries the path → also
- `--replace-message` with the same file. filter-repo is not installed; `pipx run
- --spec git-filter-repo==2.47.0 git-filter-repo` works without sudo (pipx 1.15.0). `git 2.55.0`.
- gitleaks is installed and clean on the primary (1,541 commits, "no leaks found").
-- wrangler's mime map serves `.ts` as `video/mp2t`, `.mjs` as `application/javascript`, `.md` as
- `text/markdown` → `_headers` must override to `text/plain` under `/source/tree/*` (a NEW pattern
- here; today `homepage/public/_headers` only sets Cache-Control on `/downloads/*`). Only the ROOT
- `_headers` is parsed; copies inside the tree are served as text.
-- `main` today: 1,556 commits, 2,017 tracked files (25.9 MB), 333 directories, 123 paths with
- `[`/`]` (Next dynamic-route dirs + two variable fonts) → hrefs must be URL-encoded; 0 spaces,
- 0 non-ASCII, 0 symlinks, 0 tracked `.html`; largest blob 1.57 MB; largest dir 204 entries.
- Expected public file count ≈ 2,360.
-- Next static export copies `public/` into `out/` verbatim; `next dev` does NOT serve
- `public/<dir>/index.html` at `/<dir>/` (Pages does) — e2e requests `index.html` explicitly, and
- NO `public/source/index.html` may exist (it would collide with the `/source/` app route).
-- **Tailwind v4 scans every file `.gitignore` does not exclude** and pack files are binary (the
- umtool `.next-*` incident, `.gitignore:151-157`); `homepage/tsconfig.json` includes `**/*.ts`.
- So `/homepage/public/source` goes into `.gitignore` and `"public"` into the tsconfig `exclude`
- in R's FIRST commit, before any build with a mirror under `public/`.
-- `umtool/lib/paths.mjs` and `umtool/lib/projects/report.mjs` are imported by the umtool Next app
- (11 API routes), where Turbopack rewrites `import.meta.url` into `.next/server/chunks`
- (`umtool/lib/paths.ts:36-43`, the `SONG_CODE` rule): use a cwd walk to `pnpm-workspace.yaml`, not
- the `cues.mjs:55-64` `import.meta` pattern (CLI-only).
-- `umtool/song/um-manifest.json`'s 1,896 `vid` values are used only IN MEMORY by
- `umtool/song/build-um.mjs:375,624,643` for an untracked review HTML; nothing reads them back from
- the JSON (`umtool/lib/clips.ts:16` has no `vid`). `thumb-manifest.json`/`thumb-accepted.json` `out`
- IS read (`umtool/lib/thumbs.ts:165-203` via `resolveInRoots`, `umtool/lib/paths.mjs:120-128`, which
- binds a relative path to the FIRST root, `SONG_REPORTS`); `bg` is write-only and lives under
- `SONG_DATA`. The live umtool on :3050 is started with only `UMTOOL_PORT`
- (`~/reports/release-10/scripts/r10-umtool.sh:45`) and its data is at
- `/home/user/.claude/jobs/efbe67a7/tmp/song` — a changed `SONG_DATA` default needs an operator
- symlink before the next umtool restart.
-- Worktrees do NOT symlink `homepage/public` entries today (only `_headers` is tracked there);
- `ownDir` covers both cases anyway. filter-repo leaves `<bare>/filter-repo/{commit-map,ref-map}`
- with the PRIVATE shas and `config` holds `remote.origin.url` = the local path → publish from an
- ALLOWLIST of files, never the bare dir whole.
-
-## Slice Q — fix-forward the hardcoded paths (branch `r12/paths-fix`, lands first)
-
-Owns `umtool/**`, `WORKTREES.md`, `common/controller/storageLocations{,.test}.ts`,
-`common/lib/storageVolumes{,.test}.ts`, `common/views/storage.test.ts`, `common/lib/envVars.ts`
-(only the defaults of the umtool variables it changes) + the regenerated `ENVIRONMENT.md`; shared:
-`editor/CHANGELOG.md`, `plans/release-12.md` (created by Q with the release-11 shape),
-`plans/source-mirror.md` (this plan, Q's first commit).
-
-1. `umtool/lib/paths.mjs:86`: add `export const REPO_ROOT = findRepoRoot(process.cwd())` (walk up
- until `pnpm-workspace.yaml` exists; fall back to `path.resolve(cwd, "..")`; comment why cwd, not
- `import.meta.url`), and `CHANNELS_DIR = path.resolve(process.env.CHANNELS_DIR ??
- (process.env.TRANSCRIPTS_DIR ? join(TRANSCRIPTS_DIR, "channels") : join(REPO_ROOT, "transcripts",
- "channels")))`. `umtool/lib/projects/report.mjs:39-41`: `GLOBAL_CHANNELS_DIR = () => CHANNELS_DIR`
- imported from `../paths.mjs` (one definition). Leave `cues.mjs` alone.
-2. `umtool/song/spec.mjs:31`, `umtool/song/video-dir.mjs:53`: `process.env.VIDEO_ROOT ??
- path.join(os.homedir(), "reports", "quartering-uh-song", "videos")` (add `import os`).
-3. `umtool/song/paths.mjs:19`: `SONG_DATA` = `fs.realpathSync` of `process.env.SONG_DIR ??
- path.join(os.homedir(), ".local", "share", "archilyzer", "song")` (realpath so `SONG_SCRATCH =
- dirname(SONG_DATA)` keeps pointing at the real job dir through a symlink); update the header
- comment (the symlink is the supported way to keep the data where it is).
-4. `git rm` the 20 run-log scripts (`backfill-build, mk-fatal-finish{,2,3}, mk-rebuild, ms2-{bg3,
- drums,full,jerbg,play-rebuild,triangle}, pk2, pk3, pk-v12, pkmn-{rebuild,video}, rpg-remake-v5,
- rpg-short, vshort, yoshi-rebuild}.sh`). Reword `umtool/lib/jobs.ts:8-17,71-72` and the static prose
- in `umtool/components/BuildChain.tsx:144-150` to past tense ("were one-off shell run logs that
- hardcoded their paths; not in the tree, not runnable from here"). Historical mentions in
- `debox-bg.mjs:24`, `hush-head.mjs:47`, `pick-take.mjs:26`, `video-dir.mjs:5,137` stay (record as left).
-5. `um-manifest.json`: one-off strip of `vid` (record the command; indent 1 as the writer uses;
- `git diff --stat` shows only removed `"vid"` lines); `build-um.mjs:250` writes
- `items.map(({ vid: _v, ...rest }) => rest)` with a comment (the page needs the `file://` URL, the
- tracked manifest must not carry a machine path); `:224` unchanged.
-6. `thumb-manifest.json` + `thumb-accepted.json`: one-off rewrite `out` relative to
- `~/reports/quartering-uh-song` and `bg` relative to the song data dir; writer
- `umtool/song/make-thumb.mjs:258` → `out: relTo(SONG_REPORTS, OUT), bg: relTo(SONG_DATA, BG)`
- with a comment naming the two roots. Verify and record: from `umtool/`, `resolveInRoots
- ("thumbs/<x>.jpg")` prints the same absolute file as before, and `thumbs.ts:165,199` yield the
- same labels.
-7. Text: `WORKTREES.md:119` → `cwd /path/to/checkout/editor`; `umtool/song/fit-hooks.mjs:93` →
- `<user>`; the `/run/media/user/` literals in the five `common/` files → `/run/media/<user>/` in
- comments and `/run/media/operator/` in test fixtures (change both sides of each assertion); the
- one `editor/CHANGELOG.md` line → `/run/media/<user>/` (a released entry is normally left as
- written; this is a path example, not a name a reader searches for — say so in the record).
-8. If `common/lib/envVars.ts` states a default for `SONG_DIR`, `VIDEO_ROOT` or `CHANNELS_DIR`,
- update it to the new default and regenerate `ENVIRONMENT.md` (`pnpm archilyzer docs env`).
-9. Gate: `git grep -c -i 'user' HEAD -- . ':!plans/'` → empty; tsc; `node --check` on every
- changed `.mjs`; common 2,112 (edited, not added); `test:scripts` 185 + 1; editor unit 85; mcp 269;
- `pnpm archilyzer docs env --check` clean; `pnpm --filter umtool exec next build`; `cd umtool &&
- node -e 'import("./lib/paths.mjs").then(p=>console.log(p.CHANNELS_DIR,p.SONG_DATA))'` prints the
- repo's `transcripts/channels` and the XDG path; umtool e2e `faces.spec.ts deck.spec.ts
- clip-bench.spec.ts` via `node scripts/worktree.mjs run -- pnpm --filter umtool run e2e …` (the
- fixture sets `CHANNELS_DIR`/`SONG_DIR`, proving env still wins). One `[Unreleased]` bullet in
- `editor/CHANGELOG.md`.
-
-**As shipped (2026-09-28, `r12/paths-fix`; record: `release-12.md`, "Slice Q, as shipped"):**
-- **Steps 1–7 as written, with these additions:**
- - `SONG_REPORTS` moved into `song/paths.mjs` beside a new `relTo(root, p)`, and `lib/paths.mjs`
- re-exports it. The song scripts import only siblings, because the e2e fixture runs copies of
- them.
- - `accept-thumb.mjs`, the other writer of `thumb-accepted.json`, records `out` relative too.
- - `make-thumb` passes `path.resolve(OUT)` / `path.resolve(BG)` to `relTo`.
- - deck.spec pins the relative `out`.
-- **Step 3:** a missing `SONG_DIR` path is used as given, with no realpath.
-- **Step 8 was a no-op:** `envVars.ts` declares no umtool variable. The defaults are in
- `umtool/docs/cli.md` instead.
-- **Step 9's common baseline is 2,114** (O6c's +2), unchanged by Q.
-
-## Slice R — `archilyzer source publish` + `/source` (branch `r12/source-mirror`, after Q)
-
-Owns `common/publish/{source,sourceAudit,sourceTree}.ts` + tests, `common/lib/sourceManifest.ts`,
-`common/publish/build.ts` (`buildHomepage` only), `common/bin/archilyzer.ts` + `_cli.test.ts`,
-`common/bin/doctor.ts` + test, `common/lib/paths.ts` + `common/lib/envVars.ts` (the new variables)
-+ the regenerated `ENVIRONMENT.md`, `homepage/**`, `.gitignore`, `create-archives.sh` (deleted),
-`README.md`, `SETUP.md`, `PUBLISH.md`, `homepage/content/docs/install.md`; shared: both changelogs,
-`plans/release-12.md`.
-
-**New variables, declared in `common/lib/envVars.ts` and read through `getPaths()`**:
-`ARCHILYZER_CONFIG_DIR` (default `~/.config/archilyzer`), `SOURCE_SCRUB_FILE`,
-`SOURCE_DENYLIST_FILE` (defaults inside the config dir), `ARCHILYZER_SOURCE_SCRATCH` (default
-`os.tmpdir()`). None is test-only, so none carries `E2E_`.
-
-**`archilyzer doctor`** gains a "source publish" block: which filter-repo command resolves (or the
-install line), whether gitleaks is on PATH, whether the two operator files exist, and the last
-published `mirrorHead` if there is a manifest. Read-only, like the rest of doctor.
-
-**The `/sites` homepage jobs run the step too** (they call `buildHomepage` in-process). A refusal
-fails the job with the redacted audit report in its log. `--no-source` stays CLI-only.
-
-### R1. `common/publish/source.ts` — `publishSource(opts): Promise<number>` (0 ok, 1 refused)
-
-`SourcePublishOpts = PublishOpts & { force?, check?, keepScratch?, branch = "main", sourceRepo?
-(default: git -C monorepoRoot rev-parse --path-format=absolute --git-common-dir — a worktree build
-mirrors the PRIMARY's main), publicDir? (default homepage/public, HOMEPAGE_PUBLIC_DIR honoured),
-scrubFile?, denylistFile?, filterRepo?: string[]|null, gitleaks?: string|null (null = skip, tests),
-scratchRoot? (ARCHILYZER_SOURCE_SCRATCH ?? os.tmpdir()), now? }`. `class SourceRefusal extends Error`.
-Every child through the existing `runChildIntoLog` with `AbortSignal.any([signal,
-AbortSignal.timeout(ms)])`; scratch = `mkdtemp(<scratchRoot>/archilyzer-source-)`, removed in
-`finally` unless `keepScratch`. Order:
-
-1. `sourceCommit = git rev-parse refs/heads/main` in the common dir.
-2. `loadScrubRules` / `loadDenylist` (R1 files); `rulesHash = sha256(rules + denylist)`.
-3. **Skip** unless `force`/`check`: existing `public/source/manifest.json` with equal `sourceCommit`
- + `rulesHash` AND `public/source/archilyzer.git/info/refs` AND the tarball present → log
- `[source] up to date at <sha>; skipping (--force to rebuild)`, return 0.
-4. `resolveFilterRepo()`: `git filter-repo --version` → `["git","filter-repo"]`; else pipx →
- `["pipx","run","--spec","git-filter-repo==2.47.0","git-filter-repo"]`; else `SourceRefusal` with
- the install line (`pipx install git-filter-repo`). Log the choice and version.
-5. `git clone --no-local --bare --single-branch --branch main --quiet <common-dir> <scratch>/bare`
- (120 s); `git -C bare remote remove origin`.
-6. Write `replace.txt`; run `<filterRepo> --force --replace-text replace.txt --replace-message
- replace.txt` in `bare` (900 s; `--force` because origin was removed); `rm -rf bare/filter-repo`.
-7. `git repack -a -d -q --max-pack-size=20m` (300 s), `git prune-packed`, `git pack-refs --all`,
- `git update-server-info`; refuse if `git count-objects -v` `count` ≠ 0 or `objects/info/packs`
- is empty.
-8. `mirrorHead = git rev-parse refs/heads/main`, `subject = git log -1 --format=%s` (in bare).
-9. **Gate**: `auditBare` (R2). Any hit → print the redacted report, return 1, write nothing.
-10. Tree: `git archive --format=tar -o scratch/tree.tar refs/heads/main` → `tar -xf … -C
- scratch/stage/source/tree`; `writeTreeIndexes` (R3).
-11. Tarball: `git archive --format=tar.gz -9 --prefix=archilyzer/ -o
- scratch/stage/downloads/archilyzer-source.tar.gz refs/heads/main`; sha256 by stream;
- `snapshot.json` in today's shape `{generatedAt, commit: mirrorHead, subject, bytes, sha256}`
- (the `Snapshot` type in `homepage/app/lib/snapshot.ts` stays).
-12. Stage the mirror from an ALLOWLIST only: `HEAD`, `packed-refs`, `info/refs`,
- `objects/info/packs`, `objects/pack/*.pack`, `objects/pack/*.idx` → `stage/source/archilyzer.git/`
- (no `config`, `hooks/`, `description`, `logs/`, `*.rev`, `*.bitmap`).
-13. `auditFiles(stage)` — a byte sweep of every staged file except `*.pack`/`*.idx` (the object
- walk covered those). Hit → return 1.
-14. Limits: total files > 15,000 or any file > 24 MiB → refusal.
-15. `--check` stops here (prints the report + counts, returns 0, writes nothing).
-16. Install, link-safe: `ownDir(public/source)`; `rm public/source/manifest.json` FIRST (a crash
- mid-copy leaves the page in its empty state, never a stale manifest over a half tree);
- `rm -rf public/source/{archilyzer.git,tree}`; `cp -r stage/source/*`; `ownDir(public/downloads)`;
- `copyPublicFile(tarball)`; `writePublicFile(snapshot.json)`; LAST `writePublicFile(manifest.json)`.
-17. One summary line: `[source] published main <src12> as <mirror12>: N files, M MB (mirror P
- packs, tree D dirs), tarball K MB sha256 <sha12>`.
-
-`common/lib/sourceManifest.ts` (leaf): `SOURCE_MANIFEST_VERSION = 1`, `MIRROR_DIR = "archilyzer.git"`,
-`CLONE_URL = ${PROJECT_URL}/source/archilyzer.git`, `TREE_HREF = "/source/tree/"`, and
-`SourceManifest = { version: 1; generatedAt; branch: "main"; sourceCommit; mirrorHead; subject;
-files; bytes; mirror: {files, bytes, packs}; tree: {files, dirs, bytes}; tarball: {href, bytes,
-sha256}; cloneUrl; treeHref; audit: {literals, objects, commits, gitleaks: "clean"|"skipped"};
-rulesHash; tools: {git, filterRepo} }`.
-
-`buildHomepage` becomes compose → `if (!opts.skipSource) { const c = await (opts.publishSource ??
-publishSource)({paths,onLog,signal}); if (c !== 0) return c; }` → `next build`. `r10-home.sh` is
-unchanged and fails closed (a refusal = `HOME_BUILD_FAILED`, no deploy). CLI table rows: `build
-homepage [--no-source]`; `source publish [--force] [--check] [--keep-scratch]`; `source audit
-[<git dir>]` (default: the published `homepage/public/source/archilyzer.git`; the rollout runs it on
-the LIVE clone). `SOURCE_DENYLIST_FILE` / `SOURCE_SCRUB_FILE` env override the file paths (the gate
-uses it to plant a literal).
-
-### R2. `common/publish/sourceAudit.ts`
-
-`parseDenylist(text)` → `{bytes, ci}[]`; `scanBuffer(buf, literals)`; `redactHit` (±24 bytes, the
-literal → `[REDACTED]`, non-printables `.`); `auditObjects(bare, literals)` = ONE stream `git -C bare
-cat-file --batch-all-objects --unordered --batch` with a framing parser scanning EVERY object —
-blobs, commits (message + identity lines), trees (entry NAMES), tags; `auditFiles(dir, literals,
-skip=/\.(pack|idx)$/)`; `runGitleaks(bare)` = `gitleaks git --no-banner --redact --exit-code 3
---report-format json --report-path <scratch>/gitleaks.json <bare>` (300 s; 0 → "clean", 3 → parse
-`RuleID`/`File`/`Commit` into hits, other → `SourceRefusal`; ENOENT → "skipped" + a WARNING line);
-`auditBare` combines; `formatAuditReport` never prints a literal (shows `#n (x…, len L)`). Refusal
-output ends with `[source] add a rule to ~/.config/archilyzer/source-scrub.txt or drop the file from
-history, then re-run.`
-
-### R3. `common/publish/sourceTree.ts` and `_headers`
-
-`hrefFor(entry)` = `encodeURIComponent(name)` + `/` for dirs (`[slug]` → `%5Bslug%5D/`);
-`escapeHtml`; `renderTreeIndex({relDir, entries, mirrorHead, generatedAt})` — one dependency-free
-template (~40 lines inline CSS honouring `prefers-color-scheme`, `<meta name=robots content=noindex>`,
-breadcrumb with relative `../` hops, `..` row except at root, dirs before files sorted by name,
-sizes via `formatBytes` with raw bytes in `title`, footer `main @ <mirrorHead12> · generated <at> ·
-clone`); `writeTreeIndexes(treeDir, meta)` walks with `readdir({withFileTypes:true})`, REFUSES if a
-directory already has an `index.html`, returns `{files, dirs, bytes}`.
-
-Append to the tracked `homepage/public/_headers` (exact text; later rules win for the same header):
-
-```
-# The published source (`archilyzer source publish`, common/publish/source.ts).
-/source/manifest.json
- Cache-Control: public, max-age=300, must-revalidate
-/source/archilyzer.git/*
- Cache-Control: public, max-age=300, must-revalidate
-# The raw tree is PLAIN TEXT whatever the extension: wrangler's mime map would
-# send .ts as video/mp2t, .mjs as application/javascript, .md as text/markdown
-# and .html as a page on this origin.
-/source/tree/*
- Content-Type: text/plain; charset=utf-8
- X-Content-Type-Options: nosniff
- X-Robots-Tag: noindex
- Cache-Control: public, max-age=300, must-revalidate
-# ...except the generated directory indexes and the binary files.
-/source/tree/
- Content-Type: text/html; charset=utf-8
-/source/tree/*/
- Content-Type: text/html; charset=utf-8
-/source/tree/*.ttf
- Content-Type: font/ttf
-/source/tree/*.m4a
- Content-Type: audio/mp4
-/source/tree/*.zip
- Content-Type: application/zip
-/source/tree/*.onnx
- Content-Type: application/octet-stream
-/source/tree/*.svg
- Content-Type: image/svg+xml
- Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'
-```
-
-(`.md` deliberately text/plain so it renders raw. The binary list is what the tree holds today:
-3 `.ttf`, 3 `.m4a`, 1 `.zip`, 1 `.onnx`, 6 `.svg`.)
-
-### R4. Homepage
-
-- `homepage/app/lib/source.ts`: `loadSourceManifest()` — `public/source/manifest.json` with
- `version === 1`, 40-hex `mirrorHead`, 64-hex sha, AND `public/source/archilyzer.git/info/refs` and
- the tarball present (the `snapshot.ts:25-46` rule), else null.
-- `homepage/app/lib/nav.ts`: `{ href: "/source/", label: "Source" }` after Docs.
-- `homepage/app/source/page.tsx` (`PageShell`/`PageHeading`/`Fact` rows as `downloads/page.tsx`):
- title "Source"; standfirst "The canonical public copy: a read-only git mirror, its raw tree, and a
- tarball."; one paragraph in the operator's voice: "There is no GitHub, by choice. This site is where
- the code lives in public: a read-only mirror of the private main branch, regenerated with every
- deploy of this site. Commit ids differ from the private repository because paths were scrubbed on
- the way out — same history, different hashes. Nothing here takes a push or a pull request."; the
- clone command in `<pre data-testid="source-clone">`; Facts (`source-mirror-head`, reflects private
- main, subject, generated, files/size); links "Browse the tree" (`source-tree-link`) and the tarball
- with bytes + sha256 (`source-tarball-link`); sections "What is mirrored" and "License" (MIT). Empty
- state `data-testid="source-empty"`: "No source published in this build." + how it is produced.
-- `homepage/app/downloads/page.tsx`: keep every phrase `downloads.spec.ts` asserts; add one sentence
- pointing at `/source/` for history; the empty-state sentence names `archilyzer source publish`
- instead of `./create-archives.sh`.
-- `homepage/tsconfig.json` `exclude: ["node_modules", "public"]`; `.gitignore` adds
- `/homepage/public/source` with the Tailwind note — BOTH in R's first commit.
-- `homepage/e2e/marketing.spec.ts:42-47` nav list gains `["Source", "/source/"]`.
-
-### R5. Docs
-
-Delete `create-archives.sh` and every reference: `README.md:485`, `SETUP.md:162,182`,
-`homepage/app/downloads/page.tsx:102`, `homepage/app/lib/snapshot.ts:4,23`, `.gitignore:49,93`
-(grep again; lines move). `README.md`: the clone command as the canonical public copy (`main` only;
-ids differ because paths are scrubbed), the tree at `/source/tree/`, the tarball at `/downloads/`,
-regenerated by `archilyzer source publish` inside `archilyzer build homepage`. `SETUP.md` and
-`homepage/content/docs/install.md` "Get the code": clone first, tarball as the no-git alternative.
-**`PUBLISH.md`**: a new section `## The source mirror (homepage)` after `## Cloudflare Pages`, with
-the 20,000-file / 25 MiB caps (the step refuses at 15,000 / 24 MiB), the `.git` segment trap, the
-dumb-HTTP file set, the `_headers` block, the two operator files, and that only `wrangler pages dev`
-honours `_headers` locally. `ENVIRONMENT.md` regenerated. `[Unreleased]` bullets in
-`editor/CHANGELOG.md` and `homepage/CHANGELOG.md` (the homepage's keeps its own convention).
-
-### R6. Tests
-
-- `common/publish/source.test.ts` (~9): scrub-rule loading (built-in homedir rule first, comments,
- missing file → refusal naming the path); denylist (`i:`, implied lhs); skip logic; limits; the
- allowlist (a planted `config`/`hooks/`/`filter-repo/` are never copied); manifest shape; a **round
- trip** in a temp repo (`git init -b main`, identity set, the `GIT_*` env vars deleted as
- `common/controller/cutRelease.test.ts` does): three commits with a planted literal in one blob and
- one message, rule `/srv/plantedhome==>/home/user`, `gitleaks: null`, `publicDir` temp → `git clone
- file://<public>/source/archilyzer.git` succeeds, HEAD = `manifest.mirrorHead` ≠ `sourceCommit`,
- the message reads `/home/user`, `git grep -F plantedhome $(git rev-list --all)` empty, no `config`
- in the published dir, `info/refs` names `refs/heads/main`, `objects/info/packs` ≥ 1, snapshot sha
- = fresh sha256 of the tarball, `tree/index.html` and one subdir index exist, no
- `source/index.html`; a **planted-literal refusal** (denylist without a rule → 1, no manifest,
- downloads untouched, report free of the literal); `--check` writes nothing. The two filter-repo
- tests `t.skip` when `resolveFilterRepo()` throws — the gate requires they RAN.
-- `common/publish/sourceAudit.test.ts` (~6): blob / commit / tree-name hits, clean repo, redaction,
- gitleaks skipped. `common/publish/sourceTree.test.ts` (~5): encoding, escaping, ordering,
- breadcrumbs, the existing-index refusal. `_cli.test.ts` (+3 usage rows). `build.test.ts` (+1:
- `skipSource` never calls the injected fake; a fake returning 1 fails the build).
-- `homepage/e2e/source.spec.ts` (5; the suite runs against `next dev` + `homepage/public` on disk,
- two-state like `downloads.spec.ts`; the R gate runs `source publish` in the worktree BEFORE the
- suite so the manifest branch is exercised — record which): the page's fixed copy; with a manifest
- the clone command, tarball href (200 via `page.request`), and the sha on the page = `snapshot.json`
- = `manifest.json`, else the empty state; the mirror files (`/source/archilyzer.git/HEAD` = `ref:
- refs/heads/main`, `info/refs` contains `<mirrorHead>\trefs/heads/main`, `objects/info/packs` has a
- `P pack-` line); tree indexes (`/source/tree/index.html` 200, one dir href + `index.html` 200, one
- file href 200, the fonts dir index contains `%5B` and that href resolves). Content-Type cannot be
- asserted under `next dev` (`_headers` is Pages-only) — the preview deploy checks it.
-
-### R7. Gates (worktree root, after merging `main` with Q)
-
-tsc (must stay fast — proves the tsconfig exclude); common 2,112 + ~26 (doctor included);
-`test:scripts` 185 + 1; editor unit 85; mcp 269; homepage unit 2; `pnpm archilyzer docs env --check`
-clean; `pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts build
-homepage` in the worktree (the parent creates `~/.config/archilyzer/{source-scrub,source-denylist}.txt`
-BEFORE the slice starts; the implementer never reads them aloud and never commits them) → `homepage/out/source/archilyzer.git/
-info/refs`, `manifest.json`, the tarball; record `find homepage/out -type f | wc -l` and the build's
-extra wall time; `git clone file://$WT/homepage/out/source/archilyzer.git` AND, with `python3 -m
-http.server 8765` in `homepage/out`, `git clone http://127.0.0.1:8765/source/archilyzer.git` — both
-HEADs = `manifest.mirrorHead`; `git -C <clone> grep -c -i user $(git rev-list --all)` empty; `source
-audit <clone>/.git` clean; the gate EXERCISED: `SOURCE_DENYLIST_FILE` pointing at a copy with a literal
-that IS in history (e.g. `Co-Authored-By`) → `source publish --check` exits 1 with redacted hits and
-`public/source/manifest.json`'s mtime unchanged; `build homepage --no-source` → the `/source/` page's
-empty state; `PATH` without pipx → the install-line refusal; `archilyzer doctor` prints the new
-block; homepage e2e 31 → 36 with the manifest present, `downloads.spec.ts` unchanged. Record the
-resolved filter-repo command and version.
-
-**As shipped (2026-09-28, `r12/source-mirror`; record: `release-12.md`, "Slice R, as shipped" and
-its "Review"):**
-- **R1–R6 as written, with these corrections found by running them:**
- - **`_headers`:** Pages APPENDS a header a later matching rule sets again. Each override now
- detaches with `! Content-Type` first, and `homepage/app/lib/headers.test.ts` pins it.
- - **The homepage tsconfig excludes `out` as well as `public`,** and its eslint config ignores
- `public/source/**`.
- - **The mirror carries a loose `refs/heads/main`** beside `packed-refs`, because git needs a
- `refs/` directory before a `file://` clone or `source audit` will read it.
- - **filter-repo reads `#` lines as literals,** so `replace.txt` is written without them.
- - **The clone takes `--no-tags`,** and filter-repo `--replace-refs delete-no-add --quiet`.
- - **`--no-source` REMOVES the previous publish.**
- - **The header nav moves to `md`.**
-- **No `rulesHash` and no literal count in the published manifest.**
- - The skip key is `homepage/.source-publish.json` (gitignored and dockerignored):
- `{sourceCommit, mirrorHead, rulesHash, filterRepo}`.
- - `rulesHash` covers the rules, the literals and `SOURCE_STEP_VERSION`. Bump it whenever the
- scrub or the audit changes.
-- **After the review (M1): a refusal withdraws the source everywhere it could ship from.**
- - The step removes the last publish from `homepage/public` (not under `--check`).
- - `buildHomepage` removes it from `homepage/out`.
- - `deployHomepage` refuses an `out/` whose source was not audited under today's rules, of
- today's `main`, or that has no `/source` page at all.
-- **The audit report names a literal by where it was written** (`denylist line 3 (len 5)`) and a
- hit by object, field and byte offset. It prints no byte of any object.
-- **The review's other fixes:**
- - a tracked `404.html` is refused;
- - a BOM, CRLF and a trailing `/` on the home dir are handled, and an empty left side refuses;
- - a checkout with no git repository builds with the `/source` empty state (and the CLI refuses
- with the same sentence);
- - a scratch root inside the checkout or the public dir is refused, and `--keep-scratch` deletes
- `replace.txt`;
- - `E2E_EXPECT_SOURCE=1` makes the empty state fail the spec;
- - a malformed manifest is the empty state, never a crash.
-- **Left:** compressed content is opaque to the byte search (review L6; a known limit in
- PUBLISH.md).
-- **The baselines moved:** common 2,114 → **2,146**; homepage unit 2 → **7**; homepage e2e 31 →
- **36**.
-
-## Rollout (parent; nothing here edits the primary's tracked files)
-
-Release 11 is merged and NOT rolled out. A production homepage deploy of release 12 also ships
-release 11's homepage changes, so production waits for the operator's release 11 rollout (or is
-done as part of it, on the operator's word). The PREVIEW deploy below is safe at any time.
-
-0. Before slice R's gate, the parent creates `~/.config/archilyzer/` (mode 700) with
- `source-scrub.txt` (`/run/media/user==>/run/media/user`, `` `user`==>`user` ``) and
- `source-denylist.txt` (mode 600: `user`, the hostname from `hostname`, the Gmail address the
- session already knows). **The operator adds what only they know** — real name, other handles,
- anything else that must never appear — before the first production publish. `pipx install
- git-filter-repo` (so a build needs no network and the editor's jobs find it on PATH). Q's
- operator step, BEFORE any umtool restart: `mkdir -p ~/.local/share/archilyzer && ln -s
- /home/user/.claude/jobs/efbe67a7/tmp/song ~/.local/share/archilyzer/song`.
-1. `archilyzer source publish --check`, then `archilyzer build homepage` (r10-home.sh's first line);
- check `homepage/out/source/archilyzer.git/info/refs` and the file count.
-2. **Preview first**: `archilyzer deploy homepage --preview source` → `https://source.archilyzer.pages.dev`.
- Live: `git clone https://source.archilyzer.pages.dev/source/archilyzer.git` (the edge-side unknown:
- extensionless `HEAD`/`info/refs`, `.git` inside a segment past Cloudflare's managed rules, the dumb
- fallback after the `?service=` probe); clone HEAD = `manifest.mirrorHead`; `curl -sI
- …/source/tree/common/lib/paths.ts` → `text/plain; charset=utf-8` + `nosniff`; `…/source/tree/common/`
- → text/html; `…/source/tree/umtool/report-to-video/fonts/Archivo%5Bwdth,wght%5D.ttf` → 200 font/ttf;
- `…/source/tree/homepage/app/docs/%5Bslug%5D/page.tsx` → 200; the tarball's sha256 = `snapshot.json`
- = the page; `archilyzer source audit <clone>/.git` clean.
-3. Production, after release 11's rollout: `archilyzer deploy homepage` (or `pnpm ops
- build-homepage --json '{"deploy":true}'`, which also proves the step inside the editor's job),
- the same checks on `archilyzer.pages.dev`; the record's `## Rollout`, STATE ("Now"), FACTS (the
- `.git` segment trap, Tailwind/tsconfig scanning of `public/`, dumb HTTP on Pages), memory, and an
- HTML runbook at `~/reports/release-12/RUNBOOK.html` (handoffs are HTML).
-4. If the edge refuses the dumb clone: the tree and tarball still stand; the mirror needs another host
- (R2 behind a custom domain, out of scope) — record, do not improvise.
-
-## Verification summary
-
-Unit: the round trip (clone → scrub → repack → `update-server-info` → clone back), the planted-literal
-refusal, the audit's three hit kinds, the index encoding. Build: `archilyzer build homepage` in the
-worktree, then a dumb-HTTP clone from `homepage/out` over `python3 -m http.server`. Live: the preview
-deploy's clone, content types, bracket paths, tarball sha, and `source audit` on the live clone. Docs:
-`grep -rn 'create-archives' README.md SETUP.md homepage/` shows nothing.
-
-## Risks (flagged, not solved here)
-
-- Edge-side serving of `HEAD`/`info/refs`, the `.git`-inside-a-segment path and bracket paths are
- proved upload-side only; the preview deploy is the test. Cloudflare's managed "git exposure" rules
- match `/.git/`, ours is `/archilyzer.git/`.
-- `pipx run` needs network on first use and every 14 days; the editor's `/sites` homepage jobs run in
- the editor's environment where `pipx`/`gitleaks` may be off PATH → the build refuses (fail closed)
- or skips gitleaks with a warning. `pipx install git-filter-repo` once removes both.
-- filter-repo determinism holds for a fixed version; an upgrade that changes rewriting defaults
- changes `mirrorHead` (readers see a non-fast-forward; the page says ids may change); the manifest
- records the version. Object ids are stable across git versions; pack bytes are not (irrelevant).
-- The denylist `user` is exact-case; a future transcript quote "user that" trips the gate —
- intended (add a rule or reword).
-- About a minute more per homepage build (filter-repo ~20-60 s); an unchanged `main` skips it.
-- The first publish replaces the 2026-08-12 tarball and `Snapshot.commit` becomes a mirror sha; only
- the `/source` page's "reflects private main" row links the two — deliberate.
diff --git a/plans/stats-cache-key.md b/plans/stats-cache-key.md
@@ -1,280 +0,0 @@
-# The stats cache key (fix, 2026-09-28)
-
-Branch `fix/stats-cache-key` from `main` `ac438bbc`. **Merged `10cefd15` (2026-09-28). Rolled out with release 15** (the recount; the homepage at 77,547 transcripts on 2026-09-30, `release-15.md` "Rollout"). Verified in the tree 2026-10-09: the cache keys on `indexSignature` (`common/controller/buildStats.ts:119`), and `STATS_DOWNGRADE_ENV` (`:134`) guards a downgrade.
-
-## What was wrong
-
-- **The stats cache was keyed on the wrong file.** The cache (`statsByPath`, in the index LMDB)
- was keyed on `metadata.info.json`'s mtime alone. But `hasTranscript`, `cueCount`, `coverage` and
- `transcribedDate` come from the index and the transcript files.
-- **So a late transcript never reached its stat.** That covers a Whisper run days after the
- download, a Normalize run weeks later, and a stats run made before `build:index` had the video.
- The hub and homepage composers make that last kind of run.
-- **Caption videos could not be dated at all.** A caption-only video (a YouTube VTT, no
- `transcript.json`, no outcome sidecar) got no `transcribedDate` even when computed fresh.
-- **The homepage then dropped every undated transcript.** Its fold required `hasTranscript &&
- transcribedDate`. Jasolyzer served 1,889 videos and showed 0 transcripts, 0 channels, 0 hours.
- Every site's counts and "Transcribed over time" charts were low.
-
-## Numbers, before and after (ESTIMATES)
-
-**How they were measured.** The whole-pool stats pages of 2026-09-28T20:40Z (`homepage/public/stats`)
-were classified record by record against the files on disk now. This was read-only: listings,
-`stat` and small JSON reads. No LMDB was opened and nothing was rebuilt.
-
-- **Shown** is the published homepage summary.
-- **After** counts the records a rebuild with this fix would count. These are:
- - `hasTranscript` with a date source on disk;
- - stale `hasTranscript: false` records whose `transcript.cues.json` has cues;
- - caption-only records, which the new date fallback reaches.
-
-The real numbers come from the first rebuild.
-
-| Site | Records | Transcripts shown | Transcripts after (est.) |
-| --- | ---: | ---: | ---: |
-| Anilyzer | 29,836 | 8,370 | ~29,665 |
-| Jeralyzer | 32,994 | 29,983 | ~31,906 (+ up to ~290, see below) |
-| Bonnellyzer | 8,085 | 5,540 | ~7,244 |
-| Hasanalyzer | 3,432 | 3,048 | ~3,335 |
-| Rekietalyzer | 2,931 | 2,855 | ~2,923 |
-| Jasolyzer | 1,889 | 0 | ~1,751 (~3,808 h) |
-| Whole pool | 79,385 | 49,798 | ~76,990 |
-
-- **Why so many were missing:**
- - 24,710 records had `hasTranscript` with no date. Of those, 23,198 have a date source on disk
- now, and 1,512 are caption-only.
- - 2,484 carried a stale `hasTranscript: false`.
-- **About 290 more are probably stale but are not counted above.** These are records with large
- caption files and `cueCount: null` (Jeralyzer's paramount-tactical, and the pool-only
- candace-owens). The live Jeralyzer shards serve cues for the three that were checked.
-- **The whole-pool total includes pool-only channels,** so it is more than the sum of the sites.
-
-## The fix
-
-| Commit | What |
-| --- | --- |
-| `ad152529` | `common:` the key becomes the metadata mtime AND buildIndex's `mtimes.transcriptMs`. `transcribedDate` falls back through the outcome sidecar, then the transcript the index read (`transcript.json`, else the caption VTT), then `transcript.cues.json`, then `downloadedDate`, so a transcript always has one. `STATS_SCHEMA_VERSION` 5 → 6. New `buildStats.test.ts`. |
-| `b7a733ad` | `common:` test (b) asserts the heal before the new count. |
-| `9a8bded7` | `common:` the homepage fold counts a transcript with no date (totals, channels, hours, the card's total, upload-month placement). Only the transcribed series, "this month" and the recent rail need the date. |
-| `e765b168` | `mcp:` `get_video_metadata`'s stats block on a recomputed stat: the real cue count and no false "truncated". |
-| `6c7ff664` | `plans:` the first record, FACTS, changelogs. |
-| `9bc3c635` | `common:` buildIndex records `meta.scannedAt`, the time its last completed scan began. |
-| `e4c61c77` | `common:` the review's fixes (see "Review" below): the downgrade guard, the whole index record as the key with the cues read under its `indexKey`, "not indexed yet" and "not indexable" counted apart, an unmounted drive's stats kept (and a clear refused), and test hygiene. |
-| `9e61b119` | `common(test):` `source.test.ts` expands the `~` the kept-scratch log prints (release 12's test). |
-| `000273c0` | `common:` test (i) asserts the kept stats before the new result field. |
-| `22ec383e` | `plans:` the record's review, gates and rollout; FACTS; STATE; the three changelogs. |
-| `b30b52c1` | `common:` re-review R3 and R4: the "not indexable" line names an unreachable drive, and the held-channel refusal names every way out, without paths. Test (z) asserts the LMDB file is under the temp root. |
-| this commit | `plans:` re-review R1, R2, R4 (record), R5 and the nits: the rollout's commands as typed, the index's `Diff:` check, the hub's summary check, numbered preconditions, and the index follow-up in the record and STATE. |
-
-- **Caption videos are dated by when their captions arrived** (the VTT's mtime), not by a later
- Normalize run. Whisper videos resolve as before. Their "Transcribed over time" curves move: on
- Jasolyzer, 1,683 videos would otherwise all have landed on the Normalize day.
-- **The published stats page format did not change.** `STATS_MANIFEST_VERSION` stays 1, and
- `HOMEPAGE_SUMMARY_VERSION` stays 5.
-- **The compose paths warn and do not refuse.** `compose-hub` and `compose-homepage` still run
- `buildStats` against the index as it stands, and they still do not build the index.
- - A video they meet before the index has it is keyed `NOT_INDEXED`. It is recomputed on the first
- run after the next index build.
- - The log counts separately the videos downloaded since the last index build and the ones older
- than it that it did not index: no `upload_date`, a failure, or their channel's media unreachable
- during that build.
- - A refusal would stop these builds whenever the editor had downloaded since the last index build,
- which is almost always.
-- **Concurrent stats builds: an operator rule, not a lock** (review L3, brief item 5).
- - There is no cross-process lock primitive in `common/`. `scripts/queue-lock.mjs` is the e2e
- queue's flock wrapper, run as a separate holder process. Building one here would be a new
- lock, with its own stale-lock story.
- - The rule is: **one stats build at a time.** The editor's build jobs share the queue `"build"`
- by default. **The CLI is outside every queue.**
- - Two concurrent runs are harmless unless one clears the cache, which only a schema change does.
-
-## Review
-
-**Verdict: SHIP AFTER FIXES** (the review is `j-review.md` in the job's scratch). The reviewer found
-no code defect; every fix was made on this branch.
-
-| Finding | Where |
-| --- | --- |
-| L1: the record overstated which paths run old code | `22ec383e`: the rollout says only the in-process **Build stats dataset** runs old code, and step 1 is "rebuild the editor bundle, then restart"; the editor changelog says the same. |
-| L2: wrong rollout commands | `22ec383e`: every command checked against `pnpm archilyzer --help` and `pnpm ops --help`. The homepage and the hub are each built and deployed ONE way, the hub before the sites, and `build-deploy` takes `{"all":true}`. |
-| L3: concurrent runs; the removable drive | `e4c61c77`: an unmounted drive's channel is held and its stats kept, and a cache clear with one refuses. Rollout step 2 is the precondition. The lock was **left**: see "Concurrent stats builds" above. |
-| L4: test hygiene | `e4c61c77`: every `getPaths()` path is pinned under the temp root, the root is removed in `after`, and case (z) spies on node:fs and node:fs/promises (async and sync) and fails on any write outside it. |
-| L5: the "not in the index yet" line was wrong for skipped videos | `9bc3c635` + `e4c61c77`: `notIndexedYet` and `notIndexable`, logged apart, with case (h). |
-| L6: the time estimate left out the USB drive | `22ec383e`: 10–30 minutes, with the reason; interruptible and resumes. |
-| L7: no homepage changelog bullet | `22ec383e`: `homepage/CHANGELOG.md`, and the export bullet says "once the site is rebuilt". |
-| The guard (ruled: add it) | `e4c61c77`: a build refuses to clear a cache a newer schema wrote, and names both versions and `ARCHILYZER_STATS_ALLOW_DOWNGRADE`. The variable is declared in `envVars.ts`; `ENVIRONMENT.md` is regenerated and `--check` is clean. Case (j) covers older → cleared, newer → refused (also the CLI, exit non-zero, cache untouched), and the override → cleared. |
-| O1 (ruled: do it) | `e4c61c77`: the cues are read under the `mtimes` record's `indexKey` (case (f)), and the key is the whole record (case (g)). About 40 lines with comments, and no new I/O on the unchanged path: the same one LMDB get per video. |
-| O2: date from the index's mtime | **Left.** The fresh readdir happens only on the recompute path, and it keeps the Whisper rule byte-identical to before. |
-| O3: the spy saw only async fs | `e4c61c77`: the spy now covers node:fs sync and callback APIs too. |
-| O4: the reviewer's extra cases | **Partly.** Case (e) now includes an index rebuild with no churn. The removed-transcript and two-channel cases stay in the reviewer's scratch, where they pass. |
-| O5: manual captions parse to 0 cues | **Left**, noted in FACTS. |
-| `source.test.ts` under a home `TMPDIR` | `9e61b119`: 13 of 13 with `TMPDIR` unset and with it under `~`. |
-
-**The new cases fail on the pre-review code** (`6c7ff664`'s `buildStats.ts`, `buildIndex.ts` and
-`stats.ts` swapped in once):
-
-| Case | Result |
-| --- | --- |
-| (b) | `undefined` for `notIndexedYet` (the field did not exist) |
-| (e) | `NaN` counts, for the same reason |
-| (f) | `hasTranscript` false: the cues missed under the metadata's upload date |
-| (g) | changed 0, not 1: the cue-count drift |
-| (h) | the fields did not exist |
-| (i) | removed 2, not 0: the drive's stats were dropped |
-| (j) | "Missing expected rejection": the newer cache was cleared |
-
-(a), (c), (d) and (z) pass there, as they should: (a) to (d) were fixed before the review.
-
-### Re-review
-
-**Verdict: SHIP.** No code defect; five Low touch-ups and two nits, all made:
-
-| Finding | Where |
-| --- | --- |
-| R1: `archilyzer` is not on PATH | this commit: every rollout command is written as typed from the primary checkout's root, `pnpm archilyzer …`, as release 12's records spell it. Nothing else on the branch spells a bare command: the code's messages name none, and FACTS and the changelogs name scripts or pages. |
-| R2: step 3 had no post-check | this commit: the index step now reads its `Diff:` line. Thousands removed means a drive was missing; mount it and re-run the index before step 4. |
-| R3: "not indexable" blamed the video for a missing drive | `b30b52c1`: the line adds "or its channel's media was unreachable during that build (run an index build with every drive mounted)", and case (h) expects it. |
-| R4: the refusal gave one way out | `b30b52c1` (message) and this commit (record): mount its media first; else repair or re-point its location on /storage, finish or clear its move, or delete the channel or set `excludeFromBuild`. The message carries no path: a held channel is named with its location's label. Case (i) asserts both. |
-| R5: a hub build with no figures still deploys | this commit: step 6 builds the hub, checks the log for `hub-summary.json covers N official instance(s)`, and deploys only then. `hub-summary.json skipped: …` means stop. |
-| Nits | this commit numbers the preconditions; `b30b52c1` asserts `paths.lmdbPath` is under the temp root in case (z). |
-| Follow-up (recommended) | recorded under "Left" and in STATE: **the index build still treats an unmounted drive as an empty channel.** It needs its own slice before routine builds resume. Until then, R2's check is the safeguard. |
-
-## Gates (worktree, 2026-09-28, at the review fixes)
-
-- **tsc:** clean (43 s).
-- **Common tests, with `TMPDIR` unset:** **2,161, all pass**. That is 2,149 at the branch point,
- plus 11 buildStats cases and 1 homepage fold case.
-- **Other unit suites:**
- - editor unit: 85 of 85;
- - `test:scripts`: 185 pass, 1 skipped;
- - mcp: 271 of 271;
- - homepage unit: 7 of 7.
-- **Docs:** `pnpm archilyzer docs env --check` is clean.
-- **Builds:** `next build` succeeded for export (36 s), editor (55 s) and homepage (23 s).
-- **e2e:**
- - Before the review (at `6c7ff664`):
- - editor `duplicate-shorts`, `build`, `site-scope`, `sites-homepage` and `deploy-page`: 21
- passed, 0 failed, 2.3 min;
- - export `charts.spec.ts`: 8 passed, 28 s;
- - homepage, full suite: 36 passed, 1.0 min.
- - After the review fixes: the same editor list again, because `duplicate-shorts` drives Build
- index and Build stats dataset: 21 passed, 0 failed, 1.2 min.
- - Export and homepage were not rerun. The review fixes change no export or homepage code; the
- homepage fold is unchanged since `9a8bded7`.
-
-- **At the re-review touch-ups (`b30b52c1`):**
- - tsc is clean;
- - `buildStats.test.ts` and `envVars.test.ts` pass 20 of 20;
- - `pnpm archilyzer docs env --check` is clean;
- - no e2e was run, since only wording and one assertion changed.
-
-## Rollout (operator) — follow it literally, in this order
-
-Every command below is typed **from the primary checkout's root**. There is no `archilyzer` on
-PATH, so it is `pnpm archilyzer …`.
-
-**What runs which code.**
-- **The live :3001 editor runs its BUILT bundle** until it is rebuilt and restarted. The only
- stats path that runs inside that bundle is the **Build stats dataset** button (`buildStatsAction`,
- in-process). On the old code it has no guard: against the new cache it would clear it and refill
- it the old way.
-- **Everything else spawns the checkout's code from disk**, so it runs the new code the moment
- `main` has this merge:
- - a site build's data phase (`pnpm run build:data`);
- - the hub (`compose:hub`) and the homepage (`compose`);
- - every CLI command.
-- So **the first of those after the merge is the first schema-6 stats run.** It clears the cache
- and does the whole pass inside that job.
-
-**Preconditions for steps 3 and 4.**
-1. **The removable media drive is mounted.** `/storage` shows every location **Available**.
- - The stats build now refuses a cache clear while any channel's media is unreachable.
- - **The index build has no such guard.** Run with the drive absent, it drops those channels
- from the index, and the next site build publishes them as gone. Step 3's `Diff:` check is what
- catches it.
-2. **No other index, stats or site build is running.**
- - `/jobs` shows no `build-index`, `build-stats`, `build-site`, `build-deploy`, `build-hub` or
- `build-homepage` job running or queued, on any queue.
- - No CLI or spawned build is running:
- `pgrep -af 'archilyzer\.ts (index|build|compose)'` prints nothing. Every CLI build and every
- spawned data phase or compose goes through `archilyzer.ts`; the in-process editor jobs do not
- show here, and `/jobs` covers them.
-
-**The steps.**
-
-1. **Rebuild the editor bundle, then restart :3001 onto it:** `pnpm --filter editor build` in the
- primary checkout, then restart the editor the way it is normally run. Between the merge and this
- restart:
- - **never press Build stats dataset**;
- - **start no site, hub or homepage build**. It would do step 4's full pass itself, inside that
- job, unannounced.
-2. **Check preconditions 1 and 2 above.**
-3. **Index.** Use `pnpm archilyzer index`, or `/sites` → **Build index**
- (`pnpm ops build-index --wait`). It writes the same LMDB as the editor, so run it only with no
- build job running (precondition 2).
-
- **Then check its `Diff:` line**, `Diff: +A added, ~C changed, -R removed, N total.`:
- - with `pnpm archilyzer index` or `pnpm ops build-index --wait`, it is in the terminal output;
- - from the button, it is in the `build-index` job's log on `/jobs`.
-
- **R should be 0, or a handful.** Thousands removed means a drive was missing during the build,
- and those channels just left the index. Stop, mount the drive (precondition 1), and run step 3
- again before step 4.
-4. **Stats.** Use `pnpm archilyzer build stats`: the CLI, with the editor idle. The in-process
- button stalls the editor for the length of the pass.
- - The first run logs `Stats schema change (5 -> 6); clearing stats cache.` and re-extracts every
- video: **about 10–30 minutes, longer with a cold cache.** About a quarter of the video dirs
- are on the USB drive, at 4–5 random reads each.
- - It can be interrupted (Ctrl-C, or cancelling the job) and **resumes**: the schema is written at
- the clear, so the next run only finishes the rest.
- - **If it refuses because a channel cannot be read,** the message names the channel and its
- location. The ways out, in order:
- 1. mount its media and run step 4 again;
- 2. repair or re-point its location on `/storage`;
- 3. finish or clear its move, from the channel's Storage panel;
- 4. if the channel is gone for good, delete it or set `excludeFromBuild` in its config.
- - **Let it finish before step 5.**
-5. **Homepage.** Use exactly ONE of:
- - `pnpm archilyzer build homepage && pnpm archilyzer deploy homepage`;
- - `pnpm ops build-homepage --json '{"deploy":true}' --wait`.
-
- Building the homepage **also runs release 12's source publish**. So the homepage waits on
- release 12's rollout step 0: the denylist is complete and `source publish --check` is clean.
- The homepage and source in `main` at that moment must be the ones the operator has judged.
-6. **Hub, before the sites** (in basic mode the hub and the sites share `export/out`). Build it,
- check its log, and only then deploy it. Use exactly ONE pair:
- - `pnpm archilyzer build hub`, then `pnpm archilyzer deploy hub`;
- - `pnpm ops build-hub --wait`, then `pnpm ops deploy-hub --wait`.
-
- **Between the two,** the build's output (the compose line, `compose-hub: …`) must end with
- `hub-summary.json covers N official instance(s)`, where N is the number of public sites (6 today).
- **`hub-summary.json skipped: …` means the hub would deploy with no figures on its cards.** Stop
- and fix the cause it names before deploying.
-7. **The six sites:** `pnpm ops build-deploy --json '{"all":true}' --wait`.
-
-**Live check.**
-- The homepage's Jasolyzer card shows about 1,751 transcripts, 1 channel and about 3,808 hours.
-- `https://jasolyzer.pages.dev/stats/page-0000.json` has no record with `hasTranscript: true`
- and `transcribedDate: null`.
-- Step 4's log has no `Channel …: … cached stat(s) are kept` line, which would mean a held
- channel.
-
-## Left
-
-- **MCP "truncated" for no transcript at all.** A video with no transcript has coverage 0
- (`transcriptCoverage(undefined, d > 0)`), so MCP `get_video_metadata` tells it "covers only
- 0% — truncated". This is older than the cache bug and out of scope. The coverage should be null
- when there are no cues.
-- **FOLLOW-UP, its own slice: the index build still treats an unmounted drive as an empty
- channel.**
- - What it does now: it drops that channel's index records, and the next site build publishes the
- channel as gone.
- - What it needs: `buildIndex` gets the same hold the stats build now has (keep the channel's
- `mtimes`, cues and pages), or at least a refusal with an override.
- - When: schedule it before routine builds resume after this rollout.
- - Until then, the rollout's step 3 `Diff:` check is the safeguard.
- - **Closed by release 15 slice IG** ([`release-15.md`](release-15.md), "Slice IG, as shipped"):
- the hold, and a refusal with an override for a full rebuild.
-- **A cross-process lock for builds** (see "Concurrent stats builds" above). The rule stands in
- for it.
-- **O5:** a manual English caption (no inline timing tags) indexes as 0 cues (FACTS).
diff --git a/plans/umtool-redesign.md b/plans/umtool-redesign.md
@@ -1062,7 +1062,7 @@ and P2a's inbox engine; no P3 behaviour changed.
**Review drafts** → `/projects/<p>/review`. `reportSignature` (`lib/projects/report.mjs`) now signs
`drafts.review.json`, `narration.review.json` and every `<task>-draft.json` (mtime and size), so an approve —
which writes only the review file — refreshes it and the project caches keyed on it.
-- `verdict-proposed` (r28 M8) is not built: M8 waits for the operator's bench bar (`plans/release-28.md`).
+- `verdict-proposed` (r28 M8) is not built: M8 waits for the operator's bench bar (`plans/archive/releases.md` (entry `release-28.md`)).
- **The editor stub**: `GET /api/ops/jobs` (the active filter, `limit`) answers the jobs a spec sets through
`POST /__stub/ops-jobs {mode, jobs, live}` (no token, the stub's own door) plus its own live drafts unless
`live: false`; mode `editor-token` answers 503, `unreachable` drops the socket. A set job's `log` is its
diff --git a/plans/unified-operations-model.md b/plans/unified-operations-model.md
@@ -87,7 +87,7 @@ Each step is independently shippable and independently revertable. **Do not do t
change** — every one of them moves live numbers on a 78,000-video corpus.
1. **Collapse the counters.** — **DONE 2026-08-26** (`efb0cf9`, `00b1c8a`; plan
- [`unified-ops-step-1.md`](unified-ops-step-1.md)). `snapshot.backfill.digest` is the only
+ [`unified-ops-step-1.md`](archive/editor-ia.md)). `snapshot.backfill.digest` is the only
digest work list: `buckets.noDigest` is no longer written, typed, defaulted or read, and
`DigestWork.source` and the four `id === DIGEST_OPERATION_ID` fallbacks
(`buildBands.ts`, `sweepPreview.ts` ×2, `sweepRecency.ts`) went with it. It was a
diff --git a/plans/unified-ops-step-1.md b/plans/unified-ops-step-1.md
@@ -1,277 +0,0 @@
-# Unified-ops step 1 — the digest work list has one definition
-
-## Context
-
-`plans/unified-operations-model.md` step 1: "Collapse the counters. `snapshot.backfill.digest`
-replaces `noDigest`." It is the step Phase C skipped, `plans/STATE.md` "Recommended next" #2,
-the piece `plans/editor-ia-slice-3.md` named as what follows, and **the dependency IA slice 4
-(`/actionable` dissolves) is waiting on**. Slice 4 wants what a flat id list cannot carry — the
-per-state split (`blocked`, `deferred`, `partial`) and the coverage pair (`eligible`, `present`)
-— which is exactly what `snapshot.backfill.digest` holds and `buckets.noDigest` does not.
-
-**Every fact below was verified against the tree at `389ccea` (clean) and the real corpus,
-read-only, on 2026-08-26.** The verification changed the shape of the step:
-
-1. **The migration the fallback exists for is already over.** `digestWorkOf()`
- (`common/controller/channelSnapshot.ts:480-527`) reads `snapshot.backfill.digest` first and
- falls back to `buckets.noDigest` for snapshots that predate the registry entry. Its header
- (`:446-463`, "THE FALLBACK IS NOT DEFENSIVENESS, IT IS THE MIGRATION … three generations in
- play") and `buildBands.test.ts:116` ("Do NOT stop reading `buckets.noDigest` until every
- snapshot has regenerated") both describe a world that no longer exists. Measured:
- **68 of 68** `transcripts/channels/*/snapshot.json` carry `backfill.digest` (and `eligible`);
- `generatedAt` ranges 2026-08-11 → 2026-08-26. The `"bucket"` branch is dead code against
- production. STATE.md's "STEP 4 IS NOT DONE AND CANNOT BE DONE FROM HERE" (`:472-477`) is
- stale — the live editor was restarted on the new build at some point after 08-10 and the
- snapshot scheduler did the rest.
-2. **So no rendered number moves.** Every count already flows through `digestWorkOf` and gets
- the registry answer: dashboard/`NeedsWorkPanel`/`ChannelsTable` via `actionableNoDigestCount`
- (`loadActionable.ts:144-146`), the widget sync coverage (`api/widget/sync/route.ts:220-235`
- — `eligible` is already a number corpus-wide, already `eligible − blocked`), the channel
- station (`channelFlow.ts:249`), the stage card (`stageStatus.ts:416`, `[slug]/page.tsx:423`),
- the channel list column (`channelGroupSections.ts:171`), the bands (`buildBands.ts:185`).
- The "published coverage percentage will change" warning in step 1's text already happened
- silently between 08-11 and 08-26. The export site never reads `snapshot.json` at all
- (`corpus.json`'s `digestCount` comes from `channelDigestStats`, written by the build) —
- nothing published changes, `CORPUS_SPEC_VERSION` stays 3.
-3. **The bucket and the registry entry are two definitions of "digested", and they disagree by
- 11,777 videos today.** Corpus sum of `buckets.noDigest` = 59,159; sum of
- `backfill.digest.ids` = 47,382. On 65 of 68 channels the delta is exactly `deferred`
- (registry gates on a current `cues.json`; the bucket does not); the other three
- (`HasanAbiVODs3`, `chibi-reviews`, `destiny`) are videos with a fresh digest but no current
- `cues.json`, which the registry calls `deferred` and the bucket calls done. The bucket also
- has no transcript gate (it silently omits untranscribed videos — `stageStatus.ts:435-440`
- records "how a channel of untranscribed videos read as fully digested") and no `partial`.
- `digestTarget.ts:5` says the two "MUST agree"; they cannot, structurally. **Deleting the
- bucket is what makes there be one definition** — the registry's `state()`, which is also
- what the runner dispatches from.
-4. **Four "digest is special" branches exist only because of the bucket**, and all four go:
- `buildBands.ts:180-190`, `sweepPreview.ts:88` (`reachableIdsFor`) and `:114-128`
- (`countsFor`), `sweepRecency.ts:71`. Each is `if (id === DIGEST_OPERATION_ID) …
- digestWorkOf(snapshot)` guarding the case "no registry entry", which after this step is the
- same answer for digest as for diarization: no entry → no work known → coverage unknown.
-5. **No regeneration is needed**, and none should be scripted. Old snapshots keep a stray
- `noDigest` key until their next routine regen; no reader validates bucket keys
- (`normalizeBuckets` picks the ones it knows; there is no snapshot schema version). The docs
- filed the transcode band "with step 1" because both would need one regen of 66 snapshots —
- that coupling is now void, see Out of scope. Do NOT write a `common/bin/regen-snapshots.ts`:
- an offline writer would race the live editor's `snapshotScheduler` on the same files, and
- there is nothing it would need to do.
-
-**A corpus finding to surface, not to fix here:** corpus-wide `deferred` is **16,156** in the
-current snapshots (`the-quartering` 3,762, `destiny` 3,869, `chibi-reviews` 2,699 …), against
-**1** measured on 2026-08-10 after the normalize pass (FACTS "Phase D step 1", `deferred`
-1,987 → 1). Either new `handling: "youtube"` downloads have accumulated with no `cues.json`
-(nothing automatic runs `normalizeTranscript` for a subtitle-downloading channel —
-FACTS:2001) or something regressed the cues gate. It is work the Digest card's **Normalize
-transcripts** button exists for, and it is invisible to a reader of the old bucket. Record it in
-STATE.md as an open question for the operator; do not run normalize from this slice.
-
-## Step 0 — the plan on disk
-
-Write this file verbatim to `plans/unified-ops-step-1.md` and commit it alone:
-`plans: unified-ops step 1 planned`. (Tree is clean at `389ccea`; nothing else goes in.)
-
-## Order: three commits
-
-1. **The deletion** — `buckets.noDigest` stops being written, typed, defaulted or read; the
- `"bucket"` branch and `source` leave `digestWorkOf`; tests follow.
-2. **De-specialising digest** — the four `id === DIGEST_OPERATION_ID` fallbacks go; digest is a
- plain registry entry to the band builder and the sweep planner.
-3. **Docs** — FACTS, STATE, the model file, the IA doc, CHANGELOG, memory.
-
-tsc in all six packages + `pnpm -C common test` + editor units after each. e2e once after
-commit 2, **detached** (see memory `e2e-run-detached`; the queue lock is serial and a Bash
-call caps at 10 min): `setsid nohup … pnpm e2e -- backfill.spec.ts digest.spec.ts
-actionable.spec.ts channel-groups.spec.ts channel-line.spec.ts` plus whichever spec asserts the
-dashboard/LaneDeck "digested" figure or `/api/widget/sync` (grep `digested\|widget/sync` under
-`editor/e2e/` first and add what you find). Edit nothing while it runs.
-
-## Commit 1 — the deletion
-
-### `common/controller/channelSnapshot.ts` (the writer)
-
-- Delete the `noDigest: string[]` field and its 12-line comment (`:195-206`) from
- `ChannelSnapshot["buckets"]`. Fix the sibling comment at `:217` ("the sidecar is already
- loaded here for noDigest" → it is loaded for `digestEngines` and `digestWarnings`).
-- Delete the accumulator (`:807`), the write (`:1225`), and the freshness test + push
- (`:1064-1073`). **Keep** the `digestEngines` counting above it (`:1050-1062`) and the
- `digestWarnings` push below it (`:1077-1082`); reword that block's comment ("a video that
- failed outright is ALSO in noDigest" → "is also reachable work in `backfill.digest`").
-- Delete `digestTarget` (`:812-825`, the `resolveDigestTarget` call and its 12-line comment)
- and the now-unused imports `isSectionFresh` (`:28`) and `resolveDigestTarget` (`:40`).
- Confirm with tsc that nothing else in the file reads `digestTarget` — the census says only
- `:1070-1071` do; the comment at `:608` ("exactly as digestTarget is above") must be reworded.
- The property that comment was protecting — the stage's count and the batch runner's target
- cannot disagree — is preserved by construction: the registry entry is folded from
- `kind.state()` against `kind.resolveTarget(...)` (`:626-634`), the same identity the runner
- uses.
-- Rewrite `digestWorkOf` (`:446-527`): drop the `bucket` branch and the `source` field from
- `DigestWork`. Keep the shape (`ids / reachable / blocked / deferred / partial / present /
- eligible`) — nine callers consume it and it is the editor's one adapter from an
- `OperationSnapshotEntry` to the digest surfaces. Keep the no-entry return exactly
- (`present: null, eligible: null`, everything else 0/[]): "unknown, not zero coverage" is the
- test at `channelSnapshot.test.ts:131` and the property `api/widget/sync/route.ts:49-56`
- builds on. Replace the header comment: the migration is over; date and count it (68/68,
- 2026-08-26); state that a snapshot with no entry is a channel whose first snapshot has not
- been written, not an old one.
-- Comments elsewhere in the file naming the bucket (`:95`, `:449-468`) — reword or delete.
-
-### The editor's defaulting layer and comments
-
-- `editor/app/channels/[slug]/lib/stageStatus.ts:45` — delete `noDigest: raw?.noDigest ?? []`
- from `normalizeBuckets` (it enumerates every key; tsc will insist). Reword `:406`, `:459`.
-- Comment-only references to reword so they name the entry, not the bucket:
- `common/controller/digestTarget.ts:5` ("to fill the noDigest bucket … MUST agree" — now: the
- registry's `resolveTarget` is the one identity; the snapshot has no second one),
- `common/controller/digestBatch.ts:160`, `common/lib/operations.ts:1117` ("Same rule as the
- snapshot's noDigest bucket" — there is no second rule now; say that this entry IS the
- definition), `common/lib/digest-server.ts:85` (already wrong — `hasDigest` feeds
- `digestEngines`/`digestCount`, not the bucket), `editor/app/actionable/lib/loadActionable.ts:138-146`
- (drop the last sentence about the fallback), `editor/app/api/widget/actionable/route.ts:16-24`
- (keep the refusal and the 99.87% — the step's text says the refusal must survive, and it
- does: `:44` filters on `undownloaded || untranscribed` only — just drop "rather than the
- `noDigest` bucket"), `editor/app/api/widget/sync/route.ts:51-58` (keep the null rule; replace
- "when the snapshots have all been regenerated" with the real remaining case), and the
- one-liners at `channelGroupSections.ts:168`, `channelFlow.ts:246`, `videoRows.ts:44`,
- `SpeakersStage.tsx:20`, `[slug]/page.tsx:419`, `common/lib/operations.ts:35`,
- `channelSnapshot.ts:90-95` — these cite `noDigest` as the *precedent* for "four states, not
- two"; keep the precedent, name it as history ("the old `noDigest` bucket").
-- **Do NOT rename the view-model fields** `DashboardChannel.noDigest` (`dashboard/types.ts:21`),
- `WidgetActionableChannel.noDigest` (`api/widget/actionable/route.ts:24` — a wire field the
- widget reads), `actionableNoDigestCount`, or the `noDigestIds` prop on `DigestStage`. They
- name "videos with no current digest", which is still what they hold. Out of scope.
-
-### Tests (commit 1)
-
-- `common/controller/channelSnapshot.test.ts:100-113` — the "prefers the registry entry over
- the legacy bucket" test: drop the bucket from the fixture, rename to say it reads the entry.
- `:115-129` ("falls back to noDigest") — **delete**; its property is gone on purpose. `:131+`
- ("reports UNKNOWN, not zero coverage") — keep; extend its input list with
- `{ buckets: { noDigest: ["a"] } as never }` **only if** it can be typed without a cast on
- the public signature — otherwise skip; the point is a stray on-disk key is ignored, which
- tsc already guarantees by the key not existing.
-- `editor/app/channels/[slug]/lib/channelFlow.test.ts:272-283`,
- `editor/app/channels/lib/channelGroupSections.test.ts:320-334` — feed
- `backfill: { digest: { …counts, ids: ["a","b","c"], eligible: 3 } }` instead of the bucket
- (there is a `foldBackfillEntry` / `emptyOperationCounts` to build one); assertions unchanged
- (`reachable === 3`, `through === null`, `digest.total === 3`).
-- `editor/app/components/pipelines/buildBands.test.ts:114-130` — replace the fallback test
- with its successor: a snapshot with **no** `backfill.digest` contributes `reachable 0`,
- `eligible null`, `present null` (an unfilled outline, never 0 %). Keep the comment's intent —
- "a channel with no entry must not read 'all digested'" — with the new mechanism.
-- `common/lib/operations.test.ts:1137-1138` — fix the comment's cross-reference.
-- `editor/e2e/backfill.spec.ts:855-878` (the "(N) THE REGRESSION THIS STEP'S DESIGN EXISTS TO
- PREVENT" spec, which writes a fresh snapshot) — add one line:
- `expect(snapshot.buckets).not.toHaveProperty("noDigest")`. This is the only place the
- writer's output is asserted end-to-end, and without it the deletion is pinned by nothing.
-
-Commit message: `snapshot: the digest work list has one definition`. The body carries the
-68/68 measurement, the 59,159 vs 47,382 figure and why the delta is `deferred`.
-
-## Commit 2 — digest is not special to the readers
-
-- `editor/app/components/pipelines/buildBands.ts:180-190` — delete the `if (id ===
- DIGEST_OPERATION_ID && !snapshot.backfill?.[id])` detour; `addRegistryEntry` already returns
- on a missing entry and latches `eligible`/`present` to null through `sumOrNull`. Drop the
- `digestWorkOf` and (if unused) `DIGEST_OPERATION_ID` imports. Check the file header's
- purity rule (`:44-45`, `noCorpusWalkInRenderPaths.test.ts`) still holds — removing an import
- can only help it.
-- `common/controller/sweepPreview.ts:80-90` (`reachableIdsFor`) and `:110-128` (`countsFor`) —
- delete both digest branches; `countsFor` returns `null` for any operation with no entry,
- which is what the caller already handles for diarization. Drop the now-unused imports.
-- `common/controller/sweepRecency.ts:71` (and the imports at `:32-33`) — same deletion. This
- file reads as binary to `grep` (memory `grep-misses-sweeprecency`): use `grep -a` or trust
- tsc; do not conclude from a silent grep that it is untouched.
-- After this, `digestWorkOf` has **no callers in `common/`** — it is an editor adapter.
- Leave it in `channelSnapshot.ts` (moving it is churn without a deletion); say so in its
- header.
-- Tests: `common/controller/sweepPreview.test.ts` / `sweepRecency.test.ts` — find any case
- that feeds a `noDigest`-only snapshot to exercise the fallback (the census found none by
- name, but check for fixtures with `buckets:` and a digest id) and turn it into "no entry →
- null / []". `buildBands.test.ts` was already handled in commit 1.
-
-Commit message: `operations: digest is a registry entry to every reader`.
-
-## Commit 3 — docs and memory
-
-- `plans/unified-operations-model.md` — step 1 → **DONE**, three sentences: the fallback's
- migration had already completed on disk (68/68); the number the step warned would change had
- already changed; what was actually deleted (the bucket, `source`, four special-cases). Fix
- the header's "designed, not built" (STATE already calls it stale by three steps — now four).
-- `plans/FACTS.md` — new dated section "Verified 2026-08-26 — unified-ops step 1": the
- measurements (68/68 snapshots; sum bucket 59,159 vs entry 47,382; delta = `deferred` on
- 65/68; the three exceptions and why; corpus `deferred` 16,156 vs 1 on 08-10); the surfaces
- and what each reads now; `DigestWork` without `source`; the four deleted branches; "no
- snapshot schema version exists — per-field optionality is the convention, `presentOperationWork`
- is the precedent". Also strike the "44 of 66 snapshots" line (`:1988`) as superseded.
-- `plans/STATE.md` — header line; a dated entry with the decisions (no regen; no CLI; the
- view-model names kept; transcode band deliberately not taken and why); "Recommended next":
- #2 done → slice 4 is now unblocked (say so), and the **`deferred` finding** as a new
- operator question. Correct the stale "STEP 4 IS NOT DONE" paragraph in place with a dated
- note rather than deleting it.
-- `plans/editor-operations-ia.md` — slice 4's "Depends on unified-ops step 1" → satisfied
- (dated); the Transcode row (`:60`): its band no longer waits on step 1 — it waits on its own
- snapshot-shape change (below).
-- `editor/CHANGELOG.md` [Unreleased] — operator-facing: `snapshot.json` no longer carries
- `buckets.noDigest`; the digest work list is the operation registry's, the same one the sweep
- runs from; no counts on any page change.
-- Memory (`~/.claude/projects/…/memory/`): update `slice-3-chosen-next.md` → step 1 shipped,
- slice 4 unblocked; index line to match.
-
-Commit message: `plans: unified-ops step 1 shipped`.
-
-## Verification
-
-1. After each code commit: `pnpm -C <pkg> exec tsc --noEmit` for `common editor export
- homepage umtool mcp`; `pnpm -C common test` (829 → expect one fewer: the deleted fallback
- test); editor units `pnpm -C editor exec tsx --test "app/**/*.test.ts"` (85 → ±1).
-2. Grep gates after commit 2, over `common/ editor/` (source, not plans): `noDigest` → only
- the view-model identifiers listed above plus history comments; `source: "bucket"` /
- `source: "registry"` → 0; `DIGEST_OPERATION_ID` in `buildBands.ts`, `sweepPreview.ts`,
- `sweepRecency.ts` (with `-a`) → 0 unless a non-fallback use remains; `resolveDigestTarget`
- imported in `channelSnapshot.ts` → 0.
-3. e2e as above, detached, once. Known flakes from the slice-3 run (`auto-subs-replace.spec.ts:394`,
- `cadence-ui.spec.ts:212` timeouts) are not this slice's — retry individually.
-4. **Read-only corpus check, no editor boot** (AGENTS.md: never boot a second editor against
- `transcripts/`): with `node -e`/`jq` over `transcripts/channels/*/snapshot.json`, print the
- count carrying `backfill.digest` (expect 68/68) and the sum of `backfill.digest.ids`
- (expect 47,382 ± whatever the scheduler regenerated since) — this is the number every page
- was already showing, and the figure for the FACTS entry. Do not write under `transcripts/`.
-5. Manual, on the e2e fixture (`PORT=3021 pnpm dev:test`): a channel page's Digest stage
- heading `Generate digests (N)` and the dashboard `◆ N` badge still render; `/operations/digest`
- band draws with a filled coverage outline on a channel with an entry; kill the server,
- remove `editor/test-transcripts` and `editor/test-settings.json`, `git status` clean.
-
-## Out of scope
-
-- **The transcode band.** Filed "with step 1" in three docs only because both would need one
- snapshot regeneration; step 1 needs none. It is its own snapshot-shape change — the writer
- recording a transcode population (`appliesTo(config)` and the kept-media denominator beside
- `buckets.untranscoded`) so `EXTERNAL_BAND_IDS` can go to three — and its own plan. Say so in
- the IA doc's Transcode row.
-- Renaming `noDigest` view-model fields / props / the widget wire field. `digestWorkOf` →
- a generic `operationWorkOf`. Slice 4 itself. Running normalize over the 16,156 `deferred`.
- A snapshot schema version. Any regen tooling.
-
-## Handoff — the cadence from here
-
-On approval, Fable does not implement. It:
-
-1. Spawns one implementation agent — `subagent_type: "general-purpose"`, `model: "opus"` —
- with: the path of this plan (`plans/unified-ops-step-1.md` after step 0, which the agent
- itself commits), the repo conventions that matter (AGENTS.md is auto-loaded; e2e detached;
- commit messages via `git commit -F <file under $CLAUDE_JOB_DIR/tmp>` because fish mangles
- backticks; never boot against `transcripts/`; tmp files under `$CLAUDE_JOB_DIR/tmp`), and
- the report contract: **commit shas with one line each; the exact verification outputs
- (tsc per package, test pass/fail counts, e2e pass/fail per spec with any retry); every place
- the implementation diverged from the plan and why; anything it left undone; and the
- read-only corpus figures it measured.** Its final message is the review input, not the
- user's summary.
-2. Reviews on return: `git log --oneline 389ccea..`, `git show --stat` per commit, reads the
- hunks in `channelSnapshot.ts`, `digestWorkOf`, `buildBands.ts`, `sweepPreview.ts`, and the
- test rewrites; re-runs the grep gates and `pnpm -C common test` + editor units itself
- (not the e2e); checks the FACTS/STATE entries against the measurements. Anything wrong goes
- back to the same agent by `SendMessage` with its context intact, not a fresh spawn.
-3. Reports to the user in the job-report shape, and records this cadence as a `feedback`
- memory (Fable plans; an Opus general-purpose agent implements and reports; Fable reviews)
- so the next iteration starts the same way without being told.
diff --git a/plans/youtube-lane-pacing.md b/plans/youtube-lane-pacing.md
@@ -1,167 +0,0 @@
-> **Corrected again 2026-10-01 by `plans/release-17.md` "## Slice RL — the ruling" (shipped as
-> "### Slice RL, as shipped" there).** A subtitle 429 — every YouTube 429 this file measured, and
-> all 78 of 2026-10-01's — no longer backs the platform off or defers the video: it is its own
-> class, `subs_rate_limit`, the download goes on to the media, and only the video's subtitles are
-> deferred. The "next lever" named below, honouring `sleepBetweenDownloadsSeconds` in the lane, is
-> built (plus an adaptive per-platform `--sleep-requests`), and a rate limit that outlasts the
-> cooldown cap now holds the platform to one probe at a time. The finding "pacing between videos
-> could not have prevented" a timedtext 429 stands.
-
-# Plan: one YouTube video must not keep the whole platform in a 429 cooldown
-
-> **Corrected by `plans/release-7.md` "## Slice Y" and shipped as "### Slice Y, as shipped"
-> there (2026-09-25).** The deferral is PERSISTED as `videoDeferrals` beside `platformBackoff`
-> in `.auto-queue/state.json`, not in memory (a rollout restart would otherwise re-hit the video
-> at `fails+1`). The outcome logic moved to a pure seam, `common/jobs/unitOutcome.ts`, because
-> `runLoop` is not exported. An all-deferred lane idles with its own reason, `deferred`, not
-> `cooldown`. The page lists deferred videos. The identical-scan-error `at` refresh is also in
-> the slice. `sleepBetweenDownloadsSeconds` stays out. The steps and tests below are the
-> original plan; read the release-7 record for what shipped.
-
-**Found 2026-09-25**, from STATE.md: "YouTube held a 429 cooldown across three attempts (18:43,
-19:13, 19:41)", and the owed md5-sweep sync was refused all three times. Verified read-only on
-`main` `93dcb532`, the live `settings.json` and the retained `transcripts/.jobs/*` (meta
-`startedAt` in UTC). **The STATE times are EDT.** They are the unit attempts at 22:42, 23:10 and
-23:39 UTC.
-
-## Findings (measured, not guessed)
-
-- **It was one video, not a burst.** All three cooldowns were the auto-download lane re-trying
- `quarteringvlogs/ncdPaDSqt-c`, a 178 s Short. It got 12 consecutive `rate_limit` failures from
- 20:28 to 23:39 UTC, and the runner logs `01M3A5034Y…` and `01M3ASBJHW…` show attempts 1→12
- (attempt 9 was the manual `download-missing` `01M3AQJ5…`, which shares the state). It succeeded
- at 00:09 UTC. Attempt spacing matches `nextBackoff` exactly: +93 s, +145, +252, +477, +920,
- then about 28-31 min at the cap (`platformBackoff.ts:22,24`: 60 s base, doubling, 30 min cap,
- ±10 %). The cap was reached at about 21:30 UTC.
-- **Why the same video every time.** On `rate_limit`/`network` the runner deliberately does NOT
- `markCompleted` the video (`autoRunner.ts:1936-1962`), and `order: "listed"` puts it back at
- the head of the pick. So each lapse of the cooldown (3 s idle poll, `autoRunner.ts:158`) re-picks
- the same video, gets another 429, and re-arms a platform-wide cooldown with `fails+1`. The
- `fails` count survives a restart: the new runner continued at attempt 10. A manual Sync reads the
- same cooldown and refuses (`editor/app/channels/[slug]/pipelineActions.ts:133-140`). The one
- video therefore blocked every YouTube channel for about 3.7 h, and the lane ran no other YouTube
- unit in that window.
-- **What 429s is YouTube's subtitle (timedtext) endpoint, per video.** All 20 retained YouTube
- 429s are `Unable to download video subtitles for 'en': HTTP Error 429`. The webpage, player API
- and m3u8 requests in the same spawn succeed. There are **0** `Sign in to confirm` lines in any
- retained log, and the only 2 `webpage … 429`s are Rumble syncs (`01M3AVGZ…`, `01M3AH7G…`).
- **It is not IP-wide.** `the-quartering/UCirTfhUP3s` got the 429 at 16:41:37 UTC, and
- `HasanAbiVODs3/1FibhXko_Kw` wrote both `en` and `en-orig` subtitles 27 s later (16:42:04), as did
- `nuxanor` at 16:44. `CAi9jNrHetw` 429'd 3× then succeeded. `q_UPNCELU8I` 429'd 2× then
- succeeded. Every affected video is on a Quartering channel.
-- **Volume before each 429 was tiny.** In the hour before 22:42, 23:10 and 23:39 UTC, the only
- YouTube work was one or two attempts on the same video (2 yt-dlp spawns each). The sync at
- 20:20 UTC 429'd after about 3.5 h with no YouTube spawns from this editor. Pacing between videos
- could not have prevented any of the 16 unit 429s, because they were already ≥ 93 s apart.
-- **Per unit, a `handling: youtube` download is 2 spawns** (`downloadOneManaged.ts`):
- - the metadata prefetch at `:646-661`, with no `-t sleep`: webpage, player, m3u8;
- - the primary with `-t sleep` (`:168`): 2 timedtext requests (`en`, `en-orig` from
- `en.*,live_chat`) 5 s apart.
- On a subtitle 429, yt-dlp re-extracts from the URL, so one attempt is about 8 requests.
-- **Steady state when the lane has backlog: back-to-back, no gap.**
- - The unit calls `downloadOneManaged` directly (`autoRunner.ts:2194`). `sleepBetweenDownloadsSeconds`
- (live: 30) is read only by `runManagedDownloads` (`runYtdlp.ts:932-934,1061-1067`), which is
- the sync path. FACTS.md:2733 records the same blindness for the backfill sweep.
- - `runPool` wakes on every settle (`concurrentRunner.ts:118-126`), and `PER_PLATFORM_CAP = 1`
- (`autoRunner.ts:1231`).
- - Measured: units started 00:09:32, 00:09:55, 00:18:49 and 00:19:28 UTC. A success is followed
- by the next start about 23-39 s later, which is ≈ 2 units/min ≈ 4 spawns ≈ 10 requests/min
- at most.
- - After a cooldown the lane resumes at full speed. A single success calls `clearBackoff`
- (`:1957`), so the next 429 starts again at 60 s: 00:09:32 ok, then 00:09:55 429 → 55 s.
-- **Lanes sharing one YouTube key.**
- - Auto-download units, syncs and metadata scans all queue on `platform:youtube` (concurrency 1,
- `queueKeys.ts:69-73`), so they never overlap. The 41 syncs the scheduler queued at 16:05 UTC
- ran serially (and were dropped at the 16:46 restart, which left 41 stale `queued` metas).
- - Backfill re-acquire calls `downloadOneManaged` in-process (`backfillReacquire.ts:226`), with
- no platform queue and no cooldown check. That lane is `enabled: false` today, so it is latent.
- - No availability check ran in the window.
-- **No YouTube pacing args.** `PLATFORM_ARGS` has only Rumble (`channelArgs.ts:30`). YouTube
- gets `-t sleep` only on the youtube-handling primary. The prefetch and transcribe-handling
- downloads have no `--sleep-requests`.
-- **A second, real burst: the 142 members-only legal-mindset re-scan.**
- - It rescans on every runner start: 16:03, 16:46, 00:19 and 03:39 UTC, each "0 scanned, 142
- error(s)", with `--cookies-from-browser firefox` at 1 req/s.
- - The 24 h suppression (`metadataScanStore.ts:334-349`) expired for good. The upsert keeps an
- identical re-error untouched (`:249-252`: it rewrites only when class or message changed), so
- `errors[id].at` is still 2026-09-20 and `metadataScanWanted` has said "yes" ever since.
- - It was not the trigger tonight, because timing does not line up with the 429s. It is a real
- cookie-authenticated burst.
-
-## The one change: defer a rate-limited video, not only its platform
-
-A `rate_limit` failure keeps the platform cooldown exactly as today, but **also takes that video
-off the lane for `VIDEO_RATE_LIMIT_DEFER_MS` (6 h)**. After the platform cooldown lapses, the lane
-offers the *next* video. On 09-24 ncdPaDSqt-c recovered about 3.7 h after its first 429, and the
-other two recovered within 9 min. Now `fails` escalates only while *different* videos keep
-getting 429s, which is a true platform signal. A single success clears it, as today.
-
-Why this and not the alternatives:
-- **Honouring the per-video gap (`sleepBetweenDownloadsSeconds`)** is correct and wanted, but on
- this evidence it changes nothing: the failing attempts were already 93 s-30 min apart.
-- **A YouTube `--sleep-requests` entry** paces requests *within* a spawn. The 429 is on the first
- timedtext GET after 5 s of `--sleep-subtitles`.
-- **A cooldown that also slows the resume** would stretch the same loop further. It would still
- re-arm on the same video every 30 min.
-- **A cross-lane cap** is not needed: every YouTube path except the disabled backfill already
- serializes on `platform:youtube`.
-
-Only the head-of-line retry explains three cooldowns in an evening at ≈ 2 spawns per 30 min.
-
-## Steps
-
-1. `common/jobs/platformBackoff.ts` (pure): export `VIDEO_RATE_LIMIT_DEFER_MS = 6 * 60 * 60_000`
- and `isVideoDeferred(deferred: Map<string, number>, id, now)`, plus a prune of lapsed entries.
- Do not change `nextBackoff`.
-2. `common/controller/autoRunner.ts`:
- - Beside `platformInFlight` (about `:1230`), add `videoDeferredUntil = new Map<string, number>()`.
- - In the download branch of `next()` (`:1617-1650`), also filter ids with
- `isVideoDeferred(...)`. When everything left is deferred, set `anyCooling = true` so the idle
- reason reads `cooldown`, not `capped`.
- - In the `backoffHit` branch (`:1945-1955`), add
- `videoDeferredUntil.set(pick.videoId, Date.now() + VIDEO_RATE_LIMIT_DEFER_MS)` only when
- `failureClass === "rate_limit"`. Network failures keep today's retry-same-video behaviour.
- - Extend the log line: `… ${pick.videoId} deferred 6h; next video after cooldown.`
- - Keep it in-memory. A runner restart re-offers the video once, which costs at most one extra
- attempt per restart and needs no state-file migration.
-3. `plans/FACTS.md`: record that the lane defers a rate-limited video and that the platform
- cooldown now escalates across distinct videos. Note that YouTube 429s are timedtext and
- per-video (evidence above).
-
-## Tests
-
-- Unit tests (`common/jobs/platformBackoff.test.ts`): `isVideoDeferred` before and after the
- window, and prune.
-- `common/controller/autoRunner.test.ts`:
- - A fake unit returns `rate_limit` for video A and success for B. After A's 429 and the
- platform cooldown, the next pick is B, not A. B's success clears the platform cooldown. A is
- not offered again until the deferral lapses (injected clock).
- - `network` still re-picks the same video.
- - With all pending videos deferred, the idle reason is `cooldown`.
-- No e2e change is needed. `auto-queue.spec.ts` should stay green, and should be run in the next
- release's gate, not by this plan.
-
-## Rollout
-
-Ride the next release. Watch the auto-download runner log for one evening:
-- expect at most one 429 line per video per 6 h;
-- expect `attempt N` to climb only across different ids;
-- expect the owed md5-sweep sync not to be refused by a single-video cooldown.
-
-If the lane then shows 429s on *several distinct* videos within minutes, the limit is platform-wide
-after all and the cooldown is doing its job. The next lever is then the pacing gap below.
-
-## Found, deliberately not in this change (ranked)
-
-1. **Scan error `at` never refreshes** (`metadataScanStore.ts:249-252`): 142 cookie-authenticated
- YouTube requests on every runner start. The fix is one line: rewrite an identical error when
- `prev.at` is older than `METADATA_SCAN_ERROR_COOLDOWN_MS`. It is its own slice with its own test.
-2. **The lane ignores `sleepBetweenDownloadsSeconds`**. The fix is a per-platform `nextStartAt` set
- on unit settle. This is the "slow" half of the operator's rule, for when backlog is large.
-3. **Backfill re-acquire bypasses the platform queue and cooldown** (`backfillReacquire.ts:226`).
- It is latent while the lane is disabled.
-4. **`en.*` fetches both `en` and `en-orig`**, which is 2 timedtext GETs per video. That is a
- `subLangs` question for the operator, not a pacing one.
-
-Out of scope: changing `nextBackoff` constants; any yt-dlp client or PO-token work on the
-timedtext 429 itself; adding YouTube to `PLATFORM_ARGS`; the stale `queued` metas left by restarts.