Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 7f1f6f9a64573152b52aadc2c68e4056e41c984f
parent 4284704e5d3a1803564fbdf4c102052e4fd9b5fb
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 20 Oct 2026 15:47:36 -0400

wayback pages: tests for the shown capture (compose, moment page, card, PageCaptureFacts, MCP), CITATIONS.md, a page hit's title in search output

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
MCITATIONS.md | 10++++++++++
Acommon/components/PageCaptureFacts.test.ts | 40++++++++++++++++++++++++++++++++++++++++
Mcommon/components/citations/citations.test.ts | 19+++++++++++++++++++
Acommon/components/report/MomentArticle.page.test.ts | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcommon/lib/waybackPages/view.test.ts | 13+------------
Acommon/publish/composeReportsPages.test.ts | 164+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmcp/src/search.test.ts | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmcp/src/server.ts | 2++
Aplans/release-37/cite.md | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 files changed, 471 insertions(+), 12 deletions(-)

diff --git a/CITATIONS.md b/CITATIONS.md @@ -78,6 +78,16 @@ Regenerate this file with `pnpm --filter yt-dlp-transcript-common exec tsx bin/f | `channel` | yes | The post's channel slug. A path segment of the moment page. The citing site must name it in `channels` or `citedChannels` (see [SITE.md](SITE.md)), and may carry the post (the post visibility rule). | | `id` | yes | The post's id. A path segment of the moment page. | | `thread` | no | True to show the post with the thread it belongs to. Absent = the post alone. | +| `fallback` | no | The `page` citation this one replaced (`{kind: "page", url, title?, archiveUrl?}`): a page citation whose Wayback copy was imported as a page record (umtool's **Import this capture**) becomes a `post` citation of that record, its page facts kept here so the page can still be shown where the post is not resolved. Absent = the citation was always a post. | + +#### `fallback` (post) + +| Key | Required | Description | +|---|---|---| +| `kind` | yes | `"page"`. | +| `url` | yes | The page's address, as the page citation named it. | +| `title` | no | The page's title, as the page citation named it. | +| `archiveUrl` | no | The archived copy the page citation named (the capture imported). | #### `"source"` diff --git a/common/components/PageCaptureFacts.test.ts b/common/components/PageCaptureFacts.test.ts @@ -0,0 +1,40 @@ +// PageCaptureFacts (release 37 S4): a page record's capture in plain words. +// +// Run with: node_modules/.bin/tsx --test components/PageCaptureFacts.test.ts + +import { test } from "node:test"; +import assert from "node:assert/strict"; +import * as React from "react"; +import { renderToStaticMarkup } from "react-dom/server"; +import { PageCaptureFacts } from "./PageCaptureFacts"; +import { pageCaptureView, PAGE_NO_CONTENT_LINE } from "../lib/waybackPages/view"; + +(globalThis as { React?: typeof React }).React = React; + +test("a shell capture: the kind, no content, the fallback note, both links", () => { + const url = "https://x.example/someone"; + const v = pageCaptureView({ + id: "20220101000000-0123456789ab", + text: "", + page: { + originalUrl: url, + captureTs: "20220101000000", + waybackUrl: `https://web.archive.org/web/20220101000000/${url}`, + rawUrl: `https://web.archive.org/web/20220101000000id_/${url}`, + kind: "x-profile", + noContent: true, + extractor: "generic", + extractorVersion: 1, + extractorFallback: { from: "x", fromVersion: 1, error: "boom" }, + }, + })!; + const html = renderToStaticMarkup(React.createElement(PageCaptureFacts, { view: v })); + assert.match(html, /data-page-capture="x-profile"/); + assert.match(html, /X\/Twitter profile · captured 2022-01-01/); + assert.ok(html.includes(PAGE_NO_CONTENT_LINE)); + assert.match(html, /data-page-fallback/); + assert.match(html, /Original \(may be gone\)/); + assert.match(html, /Wayback Machine copy, 2022-01-01/); + const bare = renderToStaticMarkup(React.createElement(PageCaptureFacts, { view: v, links: false })); + assert.doesNotMatch(bare, /may be gone/); +}); diff --git a/common/components/citations/citations.test.ts b/common/components/citations/citations.test.ts @@ -220,3 +220,22 @@ test("the reference list: number order as given, anchors c-<id>, none when asked assert.ok(!render(h(ReferenceList, { citations: all, anchors: false })).includes('id="c-')); assert.equal(render(h(ReferenceList, { citations: [] })), ""); }); + +test("a page record's card (release 37 S4): the original named as possibly gone, and the Wayback copy", () => { + const pageRecord: PostCitationView = { + ...post, + record: { + ...post.record, + originalUrl: "https://blog.example/a.html", + originalLabel: "Original (may be gone)", + downloads: [{ label: "Wayback Machine copy, 2014-03-05", url: "https://web.archive.org/web/20140305120000/https://blog.example/a.html" }], + }, + }; + const html = render(h(CitationCard, { citation: pageRecord })); + assert.match(html, /Original \(may be gone\)/); + assert.match(html, /href="https:\/\/web\.archive\.org\/web\/20140305120000\/https:\/\/blog\.example\/a\.html"/); + assert.match(html, /Wayback Machine copy, 2014-03-05/); + // An ordinary post keeps its "Original". + const plain = render(h(CitationCard, { citation: post })); + assert.doesNotMatch(plain, /may be gone|Wayback/); +}); diff --git a/common/components/report/MomentArticle.page.test.ts b/common/components/report/MomentArticle.page.test.ts @@ -0,0 +1,68 @@ +// A page record's moment page (release 37 S4): the shot named as the Wayback +// copy, the capture's kind and date, the version list, the two links. +// +// Run with: node_modules/.bin/tsx --test components/report/MomentArticle.page.test.ts + +import { test } from "node:test"; +import assert from "node:assert/strict"; +import * as React from "react"; +import { renderToStaticMarkup } from "react-dom/server"; +import MomentArticle from "./MomentArticle"; +import { MOMENT_PAGE_FORMAT, REPORT_VIEWS_VERSION, type MomentPageView } from "../../lib/report/views"; +import { pageCaptureView } from "../../lib/waybackPages/view"; +import type { Post } from "../../lib/posts"; + +(globalThis as { React?: typeof React }).React = React; + +const URL_A = "https://blog.example/a.html"; +const rec = (id: string, ts: string, text: string): Post => ({ + id, + slug: `pages/${id}`, + channelSlug: "pages", + author: "blog.example", + createdAt: "2014-03-04T18:30:00.000Z", + uploadDate: "20140304", + text, + url: URL_A, + platform: "webpage", + isReply: false, + isRepost: false, + links: [], + page: { + originalUrl: URL_A, + captureTs: ts, + waybackUrl: `https://web.archive.org/web/${ts}/${URL_A}`, + rawUrl: `https://web.archive.org/web/${ts}id_/${URL_A}`, + kind: "generic", + extractor: "generic", + extractorVersion: 1, + }, +}); + +test("a page record's moment page: the capture, its versions, the original and the Wayback copy", () => { + const a = rec("20140305120000-0123456789ab", "20140305120000", "First."); + const b = rec("20150611090000-0123456789ab", "20150611090000", "Second."); + const view: MomentPageView = { + format: MOMENT_PAGE_FORMAT, + version: REPORT_VIEWS_VERSION, + key: `pages/${b.id}`, + kind: "post", + record: { + channel: "pages", + id: b.id, + title: "A Post", + originalUrl: URL_A, + originalLabel: "Original (may be gone)", + downloads: [{ label: "Wayback Machine copy, 2015-06-11", url: b.page!.waybackUrl }], + }, + quote: "Second.", + post: { author: "blog.example", text: "Second.", shot: "/media/posts/pages/x/shot.png", page: pageCaptureView(b, [a]) }, + citedIn: [], + }; + const html = renderToStaticMarkup(React.createElement(MomentArticle, { view })); + assert.match(html, /alt="Screenshot of the Wayback Machine copy, 2015-06-11"/); + assert.match(html, /Web page · captured 2015-06-11/); + assert.match(html, /2 captures of this page; text changed on 2015-06-11\./); + assert.match(html, />Original \(may be gone\)</); + assert.match(html, /Wayback Machine copy, 2015-06-11/); +}); diff --git a/common/lib/waybackPages/view.test.ts b/common/lib/waybackPages/view.test.ts @@ -5,14 +5,9 @@ import { test } from "node:test"; import assert from "node:assert/strict"; -import { renderToStaticMarkup } from "react-dom/server"; -import * as React from "react"; -// The components compile to `React.createElement` on a free `React`. -(globalThis as { React?: typeof React }).React = React; import type { Post } from "../posts"; import { pageRecordId } from "./types"; -import { isWholePageId, pageCaptureLine, pageCaptureView, pageKindLabel, pageVersionsLine, PAGE_NO_CONTENT_LINE } from "./view"; -import { PageCaptureFacts } from "../../components/PageCaptureFacts"; +import { isWholePageId, pageCaptureLine, pageCaptureView, pageKindLabel, pageVersionsLine } from "./view"; const URL_A = "https://blog.example/a.html"; @@ -78,10 +73,4 @@ test("no content, the fallback note, an item seen first in an earlier capture", assert.equal(pageCaptureLine(iv), "Tumblr post · captured 2014-03-05 (first seen 2012-06-01)"); assert.equal(pageKindLabel("newkind"), "Web page (newkind)"); - const html = renderToStaticMarkup(React.createElement(PageCaptureFacts, { view: v })); - assert.match(html, /data-page-capture="x-profile"/); - assert.ok(html.includes(PAGE_NO_CONTENT_LINE)); - assert.match(html, /data-page-fallback/); - assert.match(html, /Original \(may be gone\)/); - assert.match(html, /Wayback Machine copy, 2022-01-01/); }); diff --git a/common/publish/composeReportsPages.test.ts b/common/publish/composeReportsPages.test.ts @@ -0,0 +1,164 @@ +// Integration: a cited PAGE RECORD (release 37 S4) through the REAL site +// compose (bin/compose-site.ts main) over a temp corpus: a Wayback pages +// channel holding two captures of one page, a report citing the later one as +// a post, and the prepared shot. The moment page carries the capture — its +// kind, both links, the version list — and the record's links are the +// original named as possibly gone and the Wayback copy. Every id is invented. +// +// Run with: node_modules/.bin/tsx --test publish/composeReportsPages.test.ts + +import { after, test } from "node:test"; +import assert from "node:assert/strict"; +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +const ROOT = mkdtempSync(path.join(tmpdir(), "compose-pages-")); +const PINNED: Record<string, string> = { + TRANSCRIPTS_DIR: path.join(ROOT, "transcripts"), + SAVED_VIDEOS_DIR: path.join(ROOT, "saved-videos"), + SITES_DIR: path.join(ROOT, "transcripts", "sites"), + SETTINGS_FILE: path.join(ROOT, "settings.json"), + EXPORT_PUBLIC_DIR: path.join(ROOT, "public"), + EXPORT_INDEX_DIR: path.join(ROOT, ".export-index"), + EXPORT_BUILDS_DIR: path.join(ROOT, ".export-builds"), + EDITOR_CHANGELOG_FILE: path.join(ROOT, "editor-CHANGELOG.md"), + EXPORT_CHANGELOG_FILE: path.join(ROOT, "export-CHANGELOG.md"), + CHARTS_CONFIG_FILE: path.join(ROOT, "chart-templates.json"), + SEARCH_ALIASES_FILE: path.join(ROOT, "transcripts", "search-aliases.json"), + CURATED_TAGS_FILE: path.join(ROOT, "transcripts", "tags.json"), + ARCHILYZER_CONFIG_DIR: path.join(ROOT, "config"), + ARCHILYZER_SOURCE_SCRATCH: path.join(ROOT, "source-scratch"), +}; +Object.assign(process.env, PINNED); +delete process.env.REPORTS_ALLOW_MISSING_MEDIA; +after(() => rmSync(ROOT, { recursive: true, force: true })); + +const { getPaths } = await import("../lib/paths"); +const { buildIndex } = await import("../controller/buildIndex"); +const { writePosts } = await import("../lib/posts-server"); +const { main: composeSite } = await import("../bin/compose-site"); +const { REPORT_MEDIA_FORMAT, REPORT_MEDIA_VERSION, reportMediaDir, reportMediaIndexFile } = await import("./reportMedia"); +const { pageRecordId } = await import("../lib/waybackPages/types"); + +const paths = getPaths(); +const PAGES = "demo-pages"; +const REPORT = "page-report"; +const URL_A = "https://blog.example/2014/03/a-post.html"; +const TS1 = "20140305120000"; +const TS2 = "20150611090000"; +const ID1 = pageRecordId(TS1, URL_A); +const ID2 = pageRecordId(TS2, URL_A); + +const writeJson = (file: string, value: unknown) => { + mkdirSync(path.dirname(file), { recursive: true }); + writeFileSync(file, JSON.stringify(value, null, 2)); +}; +const readJson = <T = Record<string, unknown>>(file: string): T => JSON.parse(readFileSync(file, "utf8")) as T; +const pub = (...p: string[]) => path.join(paths.exportPublicDir, ...p); + +const record = (id: string, ts: string, text: string) => ({ + id, + slug: `${PAGES}/${id}`, + channelSlug: PAGES, + author: "Pat Example", + createdAt: "2014-03-04T18:30:00.000Z", + uploadDate: "20140304", + text, + url: URL_A, + platform: "webpage" as const, + isReply: false, + isRepost: false, + links: [], + threadId: "page-0123456789ab", + page: { + originalUrl: URL_A, + captureTs: ts, + waybackUrl: `https://web.archive.org/web/${ts}/${URL_A}`, + rawUrl: `https://web.archive.org/web/${ts}id_/${URL_A}`, + kind: "generic" as const, + title: "A Post About Bread", + extractor: "generic", + extractorVersion: 1, + }, +}); + +test("a cited page record: its moment page carries the capture, the versions and both links", async () => { + writeJson(paths.settingsFile, {}); + writeJson(path.join(paths.channelsDir, PAGES, "config.json"), { + handling: "transcribe", + name: "Demo Pages", + url: "https://web.archive.org/web/*/blog.example/*", + sourceKind: "social", + platform: "webpage", + socialHandle: "blog.example", + wayback: { targets: [{ url: "blog.example/", match: "prefix" }] }, + }); + await writePosts(path.join(paths.channelsDir, PAGES), [ + record(ID1, TS1, "The first loaf came out flat."), + record(ID2, TS2, "The first loaf came out flat. Update: the fourth loaf rose."), + ]); + writeJson(path.join(paths.sitesDir, "cited", "site.json"), { + siteId: "cited", + siteTitle: "Site cited", + siteDescription: "fixture", + headerTitle: "cited", + homeTagline: "", + socialLinks: [], + groups: [{ id: "default", name: "All channels", selectedByDefault: true }], + defaultGroupId: "default", + channels: [{ slug: PAGES, groupId: "default" }], + siteUrl: "https://cited.example.test", + archives: false, + search: false, + pages: [REPORT], + }); + writeJson(path.join(paths.sitesDir, "cited", "reports", REPORT, "report.json"), { + format: "archilyzer-report", + version: 1, + id: REPORT, + kind: "sweep", + title: "The bread blog", + citations: { p1: { kind: "post", channel: PAGES, id: ID2, quote: "the fourth loaf rose" } }, + sections: [{ id: "s1", title: "The blog", claims: [{ id: "c1", text: "The blog said the fourth loaf rose.", citations: ["p1"] }] }], + }); + const dir = reportMediaDir(paths, "cited"); + mkdirSync(path.join(dir, "posts", PAGES, ID2), { recursive: true }); + writeFileSync(path.join(dir, "posts", PAGES, ID2, "shot.png"), "shot"); + writeJson(reportMediaIndexFile(paths, "cited"), { + format: REPORT_MEDIA_FORMAT, + version: REPORT_MEDIA_VERSION, + siteId: "cited", + preparedAt: "2026-10-20T00:00:00.000Z", + moments: { + [`${PAGES}/${ID2}`]: { kind: "post", file: `posts/${PAGES}/${ID2}/shot.png`, bytes: 4, sha256: "e".repeat(64), width: null, height: null, durationSec: null, media: [] }, + }, + problems: [], + }); + await buildIndex({ paths, onLog: () => {} }); + const log = console.log; + console.log = () => {}; + try { + await composeSite({ siteId: "cited", paths }); + } finally { + console.log = log; + } + + const m = readJson<{ + kind: string; + record: { title?: string; originalUrl?: string; originalLabel?: string; downloads?: { label: string; url: string }[] }; + post: { shot?: string; page?: { kindLabel: string; captureDate: string; versions?: { count: number; changedOn: string[] } } }; + }>(pub("m", PAGES, ID2, "moment.json")); + assert.equal(m.kind, "post"); + assert.equal(m.record.title, "A Post About Bread"); + assert.equal(m.record.originalUrl, URL_A); + assert.equal(m.record.originalLabel, "Original (may be gone)"); + assert.deepEqual(m.record.downloads, [{ label: "Wayback Machine copy, 2015-06-11", url: `https://web.archive.org/web/${TS2}/${URL_A}` }]); + assert.equal(m.post.shot, `/media/posts/${PAGES}/${ID2}/shot.png`); + assert.equal(m.post.page?.kindLabel, "Web page"); + assert.equal(m.post.page?.captureDate, "2015-06-11"); + assert.deepEqual(m.post.page?.versions && { count: m.post.page.versions.count, changedOn: m.post.page.versions.changedOn }, { + count: 2, + changedOn: ["2015-06-11"], + }); +}); diff --git a/mcp/src/search.test.ts b/mcp/src/search.test.ts @@ -1800,3 +1800,67 @@ test("server: a salvage transcript is marked partial by get_transcript and get_v assert.match(windowed, /PARTIAL TRANSCRIPT — made from a damaged recording/); await client.close(); }); + +// ─── Release 37 S4: page records ─── + +const PAGE_POST: Post = { + id: "20140305120000-0123456789ab", + slug: "chan-b/20140305120000-0123456789ab", + channelSlug: "chan-b", + author: "blog.example", + createdAt: "2014-03-04T18:30:00.000Z", + uploadDate: "20140304", + text: "A zephyrpost of a page, captured.", + url: "https://blog.example/a.html", + platform: "webpage", + isReply: false, + isRepost: false, + links: [], + page: { + originalUrl: "https://blog.example/a.html", + captureTs: "20140305120000", + waybackUrl: "https://web.archive.org/web/20140305120000/https://blog.example/a.html", + rawUrl: "https://web.archive.org/web/20140305120000id_/https://blog.example/a.html", + kind: "generic", + title: "A Page About Zephyrs", + extractor: "generic", + extractorVersion: 1, + }, +}; + +class PageSource extends StubSource { + async postsManifest(ch: ChannelRef): Promise<ChannelPostsManifest | null> { + const m = await super.postsManifest(ch); + return m ? { ...m, slugToPage: { ...m.slugToPage, [PAGE_POST.id]: 0 } } : null; + } + async postsPage(ch: ChannelRef, page: number): Promise<Post[]> { + const posts = await super.postsPage(ch, page); + return posts.length ? [...posts, PAGE_POST] : posts; + } +} + +test("server: get_post prints a page record's capture — the original and the Wayback copy", async () => { + const client = await connectClient(new PageSource()); + const out = firstText(await client.callTool({ name: "get_post", arguments: { post_id: PAGE_POST.id } })); + assert.match(out, /- page: Web page \(kind generic\), captured 2014-03-05 \(timestamp 20140305120000\)/); + assert.match(out, /- page title: A Page About Zephyrs/); + assert.match(out, /- original: https:\/\/blog\.example\/a\.html — Original \(may be gone\)/); + assert.match(out, /- wayback: https:\/\/web\.archive\.org\/web\/20140305120000\/https:\/\/blog\.example\/a\.html — Wayback Machine copy, 2014-03-05/); + await client.close(); +}); + +test("search: platforms keeps only post hits on those platforms; a page record's hit has its page's title", async () => { + const src = new PageSource(); + const all = await searchTranscripts(src, { query: "zephyrpost", contentTypes: ["post"] }); + assert.ok(all.hits.length >= 2, "the stub's post and the page record"); + const pages = await searchTranscripts(src, { query: "zephyrpost", contentTypes: ["post"], postPlatforms: ["webpage"] }); + assert.deepEqual(pages.hits.map((h) => h.videoId), [PAGE_POST.id]); + assert.equal(pages.hits[0]!.title, "A Page About Zephyrs"); + const client = await connectClient(src); + const out = firstText( + await client.callTool({ name: "search_transcripts", arguments: { query: "zephyrpost", content_types: ["post"], platforms: ["webpage"] } }), + ); + assert.match(out, /A Page About Zephyrs/); + assert.doesNotMatch(out, /a zephyrpost mentioning something/); + await client.close(); +}); diff --git a/mcp/src/server.ts b/mcp/src/server.ts @@ -1699,6 +1699,8 @@ async function handleSearch( `- post_id: ${h.videoId} | channel: ${h.channelName}` + (h.siteTitle ? ` | site: ${h.siteTitle}` : "") + ` | posted: ${formatDate(h.uploadDate)} | platform: ${h.platform ?? "post"}` + + // A page record (a Wayback capture): its page's title. + (h.platform === "webpage" && h.title ? `\n- page: ${h.title}` : "") + (includeSnippets && h.webpageUrl ? `\n- source: ${h.webpageUrl}` : ""); const body = h.snippets.map((sn) => ` - ${sn.text}`).join("\n"); return body ? `${head}\n${body}` : head; diff --git a/plans/release-37/cite.md b/plans/release-37/cite.md @@ -0,0 +1,103 @@ +# 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 + +(filled in below, in the report and after the gates) + +## Gates + +(filled in after the gates) + +## 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.