commit 6ee1ec016fef415e2f10a53fb35351972489bda2
parent f16629a8309f0a7a94f67ff34aa1daeb67ce6c4d
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 15 Oct 2026 07:52:14 -0400
plans: release 29 — the E2 record (the deleted-video fallback, as shipped), FACTS (the gone reading, sourceGone, a copy's provenance, the Wayback client), CHANGELOG
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 91 insertions(+), 0 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,10 @@
# Changelog
## [Unreleased]
+- **A cited video that was deleted no longer stops a report from publishing.** When a report cites a moment of a recording that its platform has since deleted or made private, and no copy of it is on disk, the report's page now shows that moment's words only, marked **Source deleted** (or **Source made private**), on its card and its moment page — instead of `reports prepare` and the build refusing the whole report. A deleted post that was never captured is shown the same way. `reports prepare` and `reports check` list each one as a warning. A moment of a recording that is still up and has no clip is still refused, as before. Needs a restart of the editor; the sites show it after their next build.
+- **`pnpm ops find-copy` looks for a copy of a deleted video and fetches the cited seconds from it.** For one article (`{"article": "<id>"}`), every published article (`{"articles": true}`) or a site's reports (`{"siteId": "<id>"}`), it takes each cited recording that is deleted or private, looks for a Wayback Machine capture of its page, then for an archive.org mirror that names its YouTube id, and fetches the cited windows from the copy it finds as one paced job. The clips land with the recording's other clips, and each one's record says which copy it came from. With `"dryRun": true` it only says what it found. A recording with no copy anywhere is left to show its words only. Needs a restart of the editor.
+- **`pnpm ops wayback-lookup` lists the Wayback Machine's captures of a page** — a URL, or a recording's own page (`{"slug", "id"}`), with `"okOnly": true` for the captures that loaded. **`pnpm ops archive-search --json '{"youtubeId": "<id>"}'`** finds archive.org mirrors of one YouTube video and gives each one's direct video file link. Both are read only and paced as archive.org asks.
+- **Fetch windows refuses a window of a deleted or private video** unless the item names another page to fetch it from (what `find-copy` does), instead of asking the dead page.
- **Capture posts works for Bluesky channels, with no login.** `pnpm ops capture-posts --json '{"slug": "<channel>", "ids": [...]}'` on a Bluesky channel now reads which posts are still up from Bluesky's public API, opens each live post's bsky.app page in a headless browser with no account, and saves a screenshot cropped to the post (`shot.png`) and the post's images beside it, in the channel's `posts-media/<id>/` — what a report's moment page shows. A post Bluesky no longer has is recorded as deleted in the channel's post availability, and nothing is opened for it. One page at a time, a few seconds apart; a "slow down" from Bluesky is waited out, and one that persists stops the run with the rest left for later. Needs a restart of the editor.
- **The research board keeps a key pressed just after a save, too.** A key that arrived after a save's answer, or after its redraw but before the moved line took the focus back, could still lose `e`'s field (the claim then went nowhere). The board now waits until the redraw is fully done before acting on any key. Needs a restart of umtool.
- **A recurring report's tick no longer calls a capped scan "nothing new".** Triage used to take the scope from one `enumerate_matches(".")`, which stops at 2,000 recordings — the co-host pilot's five channels hold 23,284, the newest read last, so its first tick found "0 new" and ended quiet. Tier 0 now lists the scope from the build's own per-channel manifests (every recording, uncapped, dated by the build's index) and reads the terms only over the new recordings (and, on a first run, from the start date). A scan that still hits a cap or misses a channel is **partial**: the tick says "partial — not reached: …" as a **Your call** card in umtool (never quiet, no quiet edition recorded), the triage run says so on its page, and its set of seen recordings is not kept, so the next run counts new from the last complete run (or from its start date). The same rule holds for a Refresh's search again (a capped search with nothing new ends **partial**, not "no change"), a series' window check, and the Inbox's daily refresh check (a partial check still raises its card, naming what it did not reach; `umtool refresh --check` prints PARTIAL). Needs a restart of the editor and umtool.
diff --git a/plans/FACTS.md b/plans/FACTS.md
@@ -9473,4 +9473,19 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri
stopped.
- **Bluesky's hosts are one module** (`common/social/blueskyEndpoints.ts`): the AppView, bsky.app and the CDN.
`E2E_BLUESKY_ORIGIN_FILE` (test-only) names a file whose loopback origin all three become, read per call.
+- **"Is this source gone?" has one reading** (`common/lib/sourceGone.ts`, `sourceGone-server.ts`): a recording's
+ effective availability as a viewer state is `deleted` or `private` (members-only, `error`, unlisted and never
+ checked are NOT gone); a post is gone when `posts-availability.json` says `deleted`. Refresh's delta, compose,
+ `missingEvidenceWindows` (its `gone` field), fetch-windows' door and find-copy all read it.
+- **`sourceGone` on the composed views** (`lib/report/views.ts`): a span or post citation view and its moment page
+ carry `sourceGone: "deleted" | "private"` when compose accepted the moment with no media because its source is
+ gone; the page shows `SOURCE_GONE_LABELS` ("Source deleted"). The report-media index's `warnings` (kind
+ `source-gone`) say the same at prepare and never fail it; a live source with no media is still `missing-media`.
+- **A window fetched from a copy names the copy** (`ClipProvenance.copy = {from: "wayback" | "archive.org", url}`,
+ `lib/clipWindow.ts`; written by `fetchWindowManaged` from `FetchWindowsItem.copy`). find-copy
+ (`publish/findCopy.ts`) puts every copy's windows in one fetch-windows job on `clips:archiveorg`, the copy's URL
+ as each item's `webpageUrl`; the clips land in the recording's own `data/<id>/clips/`. fetch-windows' door refuses a
+ gone recording's window whose item names no `webpageUrl`.
+- **The Wayback CDX client** (`lib/waybackClient.ts`) is an `ArchiveOrgClient` instance of its own (gap, UA,
+ back-off); `parseCdxJson` reads the header row's columns, and `[]`, an empty body or a header alone are none.
diff --git a/plans/release-29.md b/plans/release-29.md
@@ -223,6 +223,78 @@ Gates (from the worktree root):
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.
+
## Not in this release
Auto-posting to X/Bluesky/YouTube (text only); any umtool restructuring; the "en track → 0 cues" bug (closed in r20).