Archilyzer · Source

archilyzer

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

commit c4e81993f1962e16b61ca4f05f7671e261c4fc77
parent ef2ea5d10d2a3ec0a342627ac3a771b784ee994e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sat, 17 Oct 2026 03:33:25 -0400

plans: release 32 R10 as shipped — a stored-URL download survives a dropped connection (tsc clean; common 4602, editor 346; docs clean); FACTS, CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 1+
Mplans/FACTS.md | 32++++++++++++++++++++++++++++++++
Aplans/release-32/ranged-resume.md | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 144 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **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. - **The verdict bench shows the model what you read, and rules each part of a claim.** A claim's cited posts and pages now go to the model beside the transcript, quoted with who posted them and when. A section heading that names a verdict is no longer shown to the model. A claim that repeats an earlier one (the same words over the same clips, as in a re-cut report) is still asked each time; `--dedupe` (the body's `"dedupe": true`) asks it once instead. The model no longer picks a verdict. It lists the claim's parts and says of each whether the evidence shows it, shows it wrong, or does not show it, and the verdict follows from those answers: every part shown is CORROBORATED, some shown and some not is PARTLY, nothing shown but a part shown wrong is CONTRADICTED, nothing shown is NOT_FOUND. What each verdict means (REPORT.md, the bench page) now says this. A part the evidence does not show makes a claim PARTLY again, as your rulings do. Proposed verdicts use the same rule. umtool's `/tools/bench` shows under each claim what the model saw (its transcript lines, its posts and pages), and under each answer its parts. This is prompt version 3. Needs a restart of the editor and umtool. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -10347,3 +10347,35 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri - Test kit: `testing/web/fakeOdyseePage.mjs` — `syntheticChannel`, `syntheticClaim`, `pageUrlOf`, `channelUrlOf`, `cdnUrlOf` (`/v6/streams/<claim>/<sd_hash[:6]>.mp4`), `resolveAnswer`, `claimSearchAnswer`, `getAnswer`, `refusedAnswer`, `videoPageRead`, `channelPageRead`, `fakePageReader` (`.calls`). + +## Release 32 lane R10: a stored-URL download survives a dropped connection (verified 2026-10-17, branch `r32/ranged-resume`) + +- Observed live (2026-10-17, one 3.3 GB Odysee file): the ranged 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 and dropped the same way at 377 MB. Before R10 a drop ended the run (`network`). +- **A continuation** (`ytdlp/storedUrlDownload.ts` `continueSameFile`): within ONE `storedUrlDownload` call, a mid-file + network failure — the fetch throwing (`fetch failed`, ECONNRESET, socket hang up, ETIMEDOUT), the body read throwing + (`terminated`), a 2xx with no bytes — and a 429/403 that follows bytes served since the last page open (R7/R9's rule) + go on with the same file: the next probe is brought forward (audio check on: `checkpoint()` at the drop point — + clean → the drop point is the last clean byte; malformed → the usual roll-back, counted against `maxRollbacks`; + under the size gate or not yet readable → the bytes stay unjudged as between any two checkpoints), the resume state + saved, `STORED_URL_DROP_PAUSE_MS` (45 s) waited (abortable), the page reopened (the injected `PageOpener`; none when + null), and the read goes on from `offset`. Log: `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)].` (`— resuming` with no + opener); a refusal: `HTTP Error 429 at <b> bytes after <n> served since the page was opened — opening it again and + resuming (k of N): …`. +- **Progress** = the resume point passing the run's furthest resume point (starts at `resumedFrom`); progress resets + k to 1. `STORED_URL_MAX_DROPS` (6) continuations since the last progress; the next drop gives up with the partial + and its state kept — kind `network` (or `rate-limited` for a refusal), the last error. A 429/403 straight after an + open (no bytes since) still gives up at once (`rate-limited`, no second open). A failed WRITE of the partial is not + a drop (no retry; kind `network`, "writing … failed"). +- Result `continuations` (count); the attempt's `storedUrl.continuations?` (> 0 only). Test seams on + `StoredUrlDownloadDeps` (and so `storedUrlDeps`): `dropPauseMs`, `sleep(ms, signal?)` (the managed download's `sleep` + is the same function for its gap and the pause), `maxDrops`. `abortableWait` is exported from `storedUrlPageOpen.ts`. +- **Not a new file:** the 20-minute `stored-url:<platform>` rest is waited before the call and noted at its start and + end, never between continuations. **One attempt:** however many continuations, a run is one `stored-url-ranged` + attempt — R8's `fullAudioAttemptsOf` counts a run exhausted by drops (after progress) as one of `FULL_AUDIO_ATTEMPTS`. +- Test kit: `testing/web/fakeRangedCdn.mjs` `dropAfterBytes` / `drops` (default 1, `Infinity` allowed) / + `dropGapBytes` (default `dropAfterBytes`; 0 = every later request cut before its first byte): the cut is mid-body + (headers + part of the body, then the socket destroyed) or, on a request's first byte, before any response; a cut + request is `dropped: true` with the bytes it sent. `cdn.lock()` takes an unlock back. diff --git a/plans/release-32/ranged-resume.md b/plans/release-32/ranged-resume.md @@ -0,0 +1,111 @@ +# 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.