Archilyzer · Source

archilyzer

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

commit 5657fa7c52c8c6e4db10eb101a0570ab285b24e5
parent 9e36f024d3da55716a15cb39b23c5db02e0f6398
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sat, 17 Oct 2026 13:36:05 -0400

Merge r32/e2e-fixes: rsync 3.5.1's progress lines parse again (every media move showed no progress since the 2026-10-16 upgrade); umtool's review-player and stored-url specs own their fixture data

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

Diffstat:
Mcommon/jobs/progressParsers.test.ts | 41+++++++++++++++++++++++++++++++++++++++++
Mcommon/jobs/progressParsers.ts | 31+++++++++++++++++++++++++++++--
Meditor/CHANGELOG.md | 1+
Mplans/FACTS.md | 8++++++++
Aplans/release-32/e2e-fixes.md | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/e2e/fixtures/make-fixture.mjs | 30++++++++++++++++++++++++++++++
Mumtool/e2e/fixtures/review-player-fixture.mjs | 30++++++++++++++++++++++++------
Mumtool/e2e/review-player.spec.ts | 2+-
Mumtool/e2e/stored-url.spec.ts | 7++++---
9 files changed, 220 insertions(+), 12 deletions(-)

diff --git a/common/jobs/progressParsers.test.ts b/common/jobs/progressParsers.test.ts @@ -181,6 +181,47 @@ test("rsync progress: a whole \\r buffer splits into frames", () => { ); }); +// rsync 3.5.1 as Arch packages it since 2026-10-16 (3.5.1-3): a `B` on the +// count and a raw, digit-grouped rate — captured off a real copy (three files, +// 30 MB). Every frame of it failed to parse before, so a media move logged no +// decile line and fed no task bar. +const RSYNC_351_CHUNK = + "\r 2,048B 99% 0B/s 0:00:00 (xfr#1, to-chk=1/4)" + + "\r 30,000,000B 99% 1,248,634,666B/s 0:00:00 (xfr#1, to-chk=0/5)" + + "\r 30,002,050B 100% 1,248,720,083B/s 0:00:00 (xfr#3, to-chk=0/5)\n"; + +test("rsync progress: rsync 3.5.1's B suffix and raw rate parse", () => { + const frames = RSYNC_351_CHUNK.split(/[\r\n]+/) + .filter((l) => l.trim() !== "") + .map(parseRsyncProgress); + assert.equal(frames.length, 3); + assert.deepEqual( + frames.map((f) => f?.bytes), + [2_048, 30_000_000, 30_002_050], + ); + assert.deepEqual( + frames.map((f) => f?.percent), + [99, 99, 100], + ); + // The raw rate is scaled to the older rsync's wording (units of 1024). + assert.deepEqual( + frames.map((f) => f?.rate), + ["0.00kB/s", "1.16GB/s", "1.16GB/s"], + ); + // --no-human-readable drops the grouping and keeps the B. + assert.deepEqual( + parseRsyncProgress(" 30002048B 99% 1362240000B/s 0:00:07"), + { bytes: 30_002_048, percent: 99, rate: "1.27GB/s", etaSeconds: 7 }, + ); + // A space before the unit is accepted too. + assert.equal(parseRsyncProgress(" 2,048 B 99% 0.00kB/s 0:00:00")?.bytes, 2_048); + // The sent/received summary is still not a frame. + assert.equal( + parseRsyncProgress("sent 30,005,123 bytes received 103 bytes 60,010,452.00 bytes/sec"), + null, + ); +}); + test("rsync progress: an hours-long ETA is seconds, not a string", () => { assert.equal( parseRsyncProgress(" 1,000 10% 1.00MB/s 2:03:04")?.etaSeconds, diff --git a/common/jobs/progressParsers.ts b/common/jobs/progressParsers.ts @@ -492,8 +492,35 @@ export type RsyncProgress = { etaSeconds: number; }; +// THE BYTE COUNT MAY CARRY A `B`, AND THE RATE MAY BE RAW BYTES. rsync 3.5.1 as +// Arch packages it since 2026-10-16 (3.5.1-3) writes the same frame as +// +// 30,000,000B 99% 1,248,634,666B/s 0:00:00 (xfr#1, to-chk=0/5) +// +// — a unit on the count and an unscaled, digit-grouped rate. The regex took +// "digits, whitespace, percent" literally, so every frame of that rsync failed +// to parse: no decile line, no task bar, and the thousands of redraws went into +// the job log verbatim. Both shapes are accepted; a raw rate is scaled back to +// the wording the older rsync used, so the detail line reads the same. const RSYNC_PROGRESS_RE = - /^\s*([\d,._ ]*\d)\s+(\d{1,3})%\s+(\S+)\s+(\d+):([0-5]?\d):([0-5]?\d)/; + /^\s*([\d,._ ]*\d) ?B?\s+(\d{1,3})%\s+(\S+)\s+(\d+):([0-5]?\d):([0-5]?\d)/; + +// "1,248,634,666B/s" (digits and grouping only, then B/s) → "1.16GB/s". Anything +// else — "1.03GB/s", "0.00kB/s" — is already scaled and is returned verbatim. +function normaliseRsyncRate(rate: string): string { + const m = rate.match(/^([\d,._]+)B\/s$/); + if (!m) return rate; + const n = Number.parseInt(m[1].replace(/\D/g, ""), 10); + if (!Number.isFinite(n)) return rate; + const units = ["kB", "MB", "GB", "TB"]; + let v = n / 1024; + let i = 0; + while (v >= 1024 && i < units.length - 1) { + v /= 1024; + i++; + } + return `${v.toFixed(2)}${units[i]}/s`; +} export function parseRsyncProgress(line: string): RsyncProgress | null { const m = line.match(RSYNC_PROGRESS_RE); @@ -507,7 +534,7 @@ export function parseRsyncProgress(line: string): RsyncProgress | null { Number.parseInt(m[4], 10) * 3600 + Number.parseInt(m[5], 10) * 60 + Number.parseInt(m[6], 10); - return { bytes, percent, rate: m[3], etaSeconds }; + return { bytes, percent, rate: normaliseRsyncRate(m[3]), etaSeconds }; } // Is this line ONLY a progress redraw? Used by the relocate controller to keep diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **A media move says how far its copy got again with the newer rsync.** rsync 3.5.1 as packaged since mid-October writes its progress with a unit on the byte count and an unscaled rate, which the move did not read: the job showed no progress bar and no "Copying… · N % ·" lines, and the log filled with rsync's raw redraws. Both forms are read now, and the rate reads as before (for example 1.16GB/s). Needs a restart of the editor. - **A full download from Odysee's stored media URL survives a dropped connection.** When the connection to the file's server drops mid-file (`fetch failed`, a reset, a timeout, a body cut short), the same download now checks what came down, pauses 45 seconds, opens the video's page again and goes on from the last clean byte — it no longer ends the job. Each one is in the job log as "Connection dropped at <bytes> — reopening the page and resuming (k of 6)". After six drops in a row with no progress the download stops and keeps what it has for the next run, as before. A refusal that follows bytes the server served is handled the same way; a refusal straight after the page was opened still stops at once. A continuation is not a new file: it does not wait the 20-minute rest between files, and the whole run is still one attempt on the video's record (one of the two full-audio attempts before a salvage). The attempt records how many continuations it took. Needs a restart of the editor. - **Partial transcripts wait for the full audio first.** A video whose download completed with malformed audio (a corrupt full source) used to get a salvage transcript, with gaps, as soon as anyone pressed Transcribe. When the video's record stores an Odysee media URL, Transcribe and the corrupt full sources' Retry now download from that URL first, up to two times and 20 minutes apart. The salvage transcript is made only if neither download comes back clean. A clean download is transcribed in full. **Salvage** (`transcribe-one {"salvage": true}`) still makes the partial transcript at once. The channel's line shows **awaiting full audio** for the videos still waiting, and the salvaged transcripts read **salvaged — full audio attempts: n**. The video page's salvaged notice gives the same count, the video list marks a salvaged transcript amber, and the MCP's `get_transcripts` marks it partial as `get_transcript` already did. - **find-copy no longer reports a Wayback copy that has no video.** The Wayback Machine's video index can list a video whose file it does not hold, and such a copy then failed to fetch (404). A copy now counts as found only when one of its video files answers a request for its first bytes. Otherwise the lookup says **page captured, no video**, archive.org is tried next, and the video is recorded as none found, not as a copy that failed. Looking up copies for an article's cited windows now records none found too, as the channel and site lookup already did. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -4951,6 +4951,14 @@ Six things, in the order they were built. Trust these over re-deriving them. reads one frame — `30,000,000 85% 1.03GB/s 0:00:03 (xfr#1, to-chk=1/3)` — into `{bytes, percent, rate, etaSeconds}`. Grouping separators are stripped with `\D`, not assumed to be commas. +- **rsync 3.5.1-3 (Arch, installed here 2026-10-16) writes a `B` on the count and + an UNSCALED rate**: `30,000,000B 99% 1,248,634,666B/s 0:00:00 (xfr#1, …)` + (`--no-human-readable`: `30002048B 99% 1362240000B/s`). The parser accepts + an optional ` ?B` after the count, and a rate of digits-and-grouping then + `B/s` is scaled back to the older wording (units of 1024: `1.16GB/s`, + `0.00kB/s`); a rate already scaled is verbatim. Before release 32 R11 every + frame of that rsync failed to parse — no decile line, no task bar, the + redraws in the log verbatim (channel-storage.spec's `Copying…` assertion). - **The fraction divides by the MEASURED tree, not by rsync's percentage.** Under incremental recursion (the default) rsync's percentage is of what it has enumerated so far and walks BACKWARDS. The controller already measured the diff --git a/plans/release-32/e2e-fixes.md b/plans/release-32/e2e-fixes.md @@ -0,0 +1,82 @@ +# 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/umtool/e2e/fixtures/make-fixture.mjs b/umtool/e2e/fixtures/make-fixture.mjs @@ -1077,6 +1077,36 @@ writeProject( { type: "clip", id: "s01", video: "odv1", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "its file address is on record" }, ]), ); +// ITS PLAIN TWIN: one unfetched clip on a source whose record stores no media +// URL, for "a project whose records store none offers nothing". Its own project +// and its own source (vid10), nobody else's: the spec used to borrow +// editor-fetch-many-fixture, whose clips report-fetch-via-editor fetches first, +// so the "Fetch N unfetched clips" button it looks beside was already gone. +// Nothing ever fetches this one. +{ + const dir = path.join(CHANNELS, "testchan", "data", "vid10"); + mkdirSync(dir, { recursive: true }); + writeFileSync( + path.join(dir, "transcript.cues.json"), + JSON.stringify({ + title: "Fixture source vid10", + uploadDate: "20250101", + channel: "Fixture Channel", + webpageUrl: "https://example.invalid/watch?v=vid10", + duration: 6, + cues: [ + { start: 0, end: 3, text: "The plain fixture stores no file address." }, + { start: 3, end: 6, text: "So no stored URL is offered." }, + ], + }) + "\n", + ); +} +writeProject( + "stored-url-plain-fixture", + manifest("stored-url-plain-fixture", "The Stored URL Plain Fixture", { siteOrigin: "https://archive.example" }, [ + { type: "clip", id: "n01", video: "vid10", start: 0.0, end: 3.0, cite: 0, section: 0, lock: true, quote: "the plain fixture stores no file address" }, + ]), +); // -- THE TAG FIXTURE ---------------------------------------------------------- // diff --git a/umtool/e2e/fixtures/review-player-fixture.mjs b/umtool/e2e/fixtures/review-player-fixture.mjs @@ -1,11 +1,14 @@ // What review-player.spec.ts walks (release 32 R1): the drafts review's // audition deck over a cut whose first cited window is on disk and whose -// second is not. Its own project and its own source (vid8), so a fetch here -// never makes another spec's window "already cached". +// second is not. Its own project and its own TWO sources (vid9, vid8): a +// window in the corpus is keyed by video and shared by every project, so a +// card on vid1 played whichever wider window another spec had fetched there +// first (clip-bench's after-only fetch leaves vid1's 0.00-14.00), and a fetch +// here must never make another spec's window "already cached". // // reports/review-player-fixture/ -// p01 on-screen text DRAFTED over vid1 3-6 s: the project's cached window -// (out/clips-raw/vid1_0.00-9.00.mp4) plays it +// p01 on-screen text DRAFTED over vid9 3-6 s: the project's cached window +// (out/clips-raw/vid9_0.00-9.00.mp4, a copy of vid1's) plays it // p02 on-screen text DRAFTED over vid8 3-6 s: nothing on disk until Fetch // clip asks the editor stub, which writes the window into the corpus // k01 a chapter card whose narration was DRAFTED: no clip, edited on the card @@ -26,6 +29,21 @@ const write = (dir, name, doc) => { * @param {{ reports: string, channels: string, manifest: Function, cachedWindow: string }} o */ export function makeReviewPlayerFixture({ reports, channels, manifest, cachedWindow }) { + // vid9: the first card's source, nobody else's. Its cues are vid1's first + // three, so the run-on quote at 3-6 s is the same seven words. + write(path.join(channels, "testchan", "data", "vid9"), "transcript.cues.json", { + title: "Fixture source vid9", + uploadDate: "20250101", + channel: "Fixture Channel", + webpageUrl: "https://example.invalid/watch?v=vid9", + duration: 9, + cues: [ + { start: 0, end: 3, text: "This is a complete sentence." }, + { start: 3, end: 6, text: "And this one runs on and because" }, + { start: 6, end: 9, text: "of that it finishes here." }, + ], + }); + const rows = [ [0, 3, "The review fixture opens."], [3, 6, "This is the sentence the second card cites."], @@ -46,7 +64,7 @@ export function makeReviewPlayerFixture({ reports, channels, manifest, cachedWin "video.manifest.json", manifest("review-player-fixture", "The Review Player Fixture", { siteOrigin: "https://archive.example" }, [ { - type: "clip", id: "p01", video: "vid1", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "And this one runs on and because", + type: "clip", id: "p01", video: "vid9", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "And this one runs on and because", onscreen: { title: "On disk title" }, drafted: { onscreen: P("onscreen") }, }, { @@ -60,6 +78,6 @@ export function makeReviewPlayerFixture({ reports, channels, manifest, cachedWin ]), ); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); - copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", path.basename(cachedWindow))); + copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "vid9_0.00-9.00.mp4")); return { dir }; } diff --git a/umtool/e2e/review-player.spec.ts b/umtool/e2e/review-player.spec.ts @@ -47,7 +47,7 @@ test("the audition deck: play the span, keep, fetch a missing clip, cut, undo, e // Video first: the project's cached window, served with ranges. await expect(card.locator("[data-play]")).toHaveAttribute("data-play", "window", { timeout: 15_000 }); const video = card.locator("video[data-player]"); - await expect(video).toHaveAttribute("src", /\/api\/report\/raw\?.*file=vid1_0\.00-9\.00\.mp4/); + await expect(video).toHaveAttribute("src", /\/api\/report\/raw\?.*file=vid9_0\.00-9\.00\.mp4/); const res = await request.get((await video.getAttribute("src"))!, { headers: { range: "bytes=0-99" } }); expect(res.status()).toBe(206); // The lit line: the quote, word by word. diff --git a/umtool/e2e/stored-url.spec.ts b/umtool/e2e/stored-url.spec.ts @@ -10,13 +10,14 @@ import * as urls from "./urls"; // cut from (an Odysee record's CDN file: e2e/fixtures/make-fixture.mjs, // stored-url-fixture on testchan-odysee/odv1), off by default, and ticked it // rides to the editor as `storedUrl: "fallback"` (the editor stub records it). -// A project whose records store none offers nothing. +// A project whose records store none offers nothing (stored-url-plain-fixture +// on vid10: its own project and source, which nothing fetches). // --------------------------------------------------------------------------- const HERE = path.dirname(fileURLToPath(import.meta.url)); const FIXTURE = path.join(HERE, "..", ".e2e-song"); const STORED = "reports/stored-url-fixture"; -const PLAIN = "reports/editor-fetch-many-fixture"; +const PLAIN = "reports/stored-url-plain-fixture"; const STUB_LOG = path.join(FIXTURE, "editor-stub.requests.json"); const asked = (): Record<string, unknown>[] => { try { @@ -31,7 +32,7 @@ test("the stored-URL answer: a record that stores its CDN file, one that does no expect(await yes.json()).toEqual({ stored: true, host: "player.odycdn.com", platform: "odysee" }); const clip = await request.get(`${baseURL}/api/cited/stored?project=${encodeURIComponent(STORED)}&clip=s01`); expect((await clip.json()).stored).toBe(true); - const no = await request.get(`${baseURL}/api/cited/stored?channel=testchan&video=vid4`); + const no = await request.get(`${baseURL}/api/cited/stored?channel=testchan&video=vid10`); expect(await no.json()).toEqual({ stored: false }); });