Archilyzer · Source

archilyzer

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

commit bcd36d02e9f51c64e9e7e9ef8ec61beac8f41a49
parent 2efa307a6cd3becf9f0892eda8556c19aba73758
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 27 Oct 2026 17:58:47 -0400

Docs: a take's work files and pruning them; umtool prune; the changelog

report-video.md says what is work and what is final, how hard links are
counted, what is kept and why, the settings, and where the prune runs (the
CLI, the Takes page, after a take is made, the disk guard before a render).
cli.md has the command and the UMTOOL_PRUNE_* / UMTOOL_DISK_GUARD* rows.

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

Diffstat:
Meditor/CHANGELOG.md | 1+
Mumtool/docs/cli.md | 4++++
Mumtool/docs/report-video.md | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 87 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **Report-video takes no longer keep their build work forever.** On 2026-10-27 /home reached 100 % (5.4 GB free of 1.5 TB), and 131 GB of it was takes' build work: each full take's chrome frames (about 12 GB for the 34-minute Huck cut, kept with `--keep-frames` so a `--from` twin can reuse them), its crossfade batches and its clip segments, swept by hand. `umtool prune <project>` (or `--all`) now lists each take's work files — segments, chrome frames, crossfade batches, encode chunks, raw clip copies, `work-from-*` — and what freeing them gives back, or why the take keeps them: a build running in it or from it (never freed), the picked take, the take the project's manifest is, a pin in `takes/prune.json`, the newest 2 of its group, anything modified in the last 3 days, and the `--from` bases of those. It is a dry run unless `--yes`. Files hard-linked between takes are counted once, and freed only when every take holding them lets them go, so the numbers are what the disk gets back, not a sum of `du`s. The renders, previews, take.json and manifests are never touched, and nothing is followed out of a take through a link. The Takes page says each take's work and why it is kept, with **Free work files** per take and for the project (the plan first, then **Free them**). A take that finishes building now prunes its project by the same rules and says what it freed in its log, and a render that starts with under 30 GB free does the same across every project, and refuses to start under 10 GB with a sentence saying so. `--keep`, `--older-than`, `takes/prune.json` and `UMTOOL_PRUNE_*` / `UMTOOL_DISK_GUARD*` change the rules or turn them off. A dry run over ~/reports on 2026-10-27, after the hand sweep: 27 GiB of work in 32 projects' takes, 4.0 GiB of it free to go (2.4 GiB in the Huck project, whose last three days of takes are all kept). Needs a restart of umtool for the Takes page and for takes made from it; the CLI has it at once. - **An X post's screenshot is of the post, not of a page in the middle of laying itself out.** On 2026-10-27 a forced capture of TheQuartering's post 2114859155022389342 came out shifted about 100 px: its left edge cut off, X's menu laid over its words and the gap beside the column showing; another post once came out as a strip of the post above it. The shot was a full-page capture, which resizes the page for the moment of the capture — in the X session profile the page saw its window go to 1×1 — and X laid itself out again for that size while it was being captured, so the shot was cut from a different layout than the one measured. A post is now shot from the window as it stands: scrolled into it, the window made taller first when the post is taller than it, so nothing is resized under the shot; and the post is measured again after the shot and shot again if it moved. An X Article's shot is taken the same way. Posts taller than the tallest window (16,384 px) are still shot from a full-page capture. Needs a restart of the editor. - **Use with AI is the homepage's.** A published site's header and slide-out menu no longer carry it (nor the hub's header); a site still reaches the homepage's AI and MCP doc from its footer and from Ask AI, and its corpus.json and llms.txt still name it. Rebuild a site to see it. - **The site-swap intro no longer shifts vertically on the chime.** With the URLs under MEDIA the drawing used to rise to stay centred; the lockup is now centred as the plain intro centres it and the URLs hang below it, so on the chime it only moves sideways. Intros without a site swap are unchanged. diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md @@ -51,6 +51,7 @@ Inbox cannot disagree about what is wrong with one. | `rulings <project> [--json]` · `rulings <project> import [--dry-run] [--json]` · `rulings <project> set <clip\|key> keep\|cut\|not-him\|read-aloud [--reason R] [--match M]` · `rulings <project> clear <clip\|key>` | a montage's **clip rulings** (`montage-rulings.json`, the clip deck's): each clip and its ruling and the next render's kept clips; the earlier rulings in the seed's `edits.json`, once; one ruling set or cleared. A render leaves out every clip ruled cut, not-him or read-aloud ([report-video.md](report-video.md#ruling-the-clips)) | | `fetch <project> --body` · `fetch <project> --dry-run [--json]` · `fetch <project> [--wait] [--json]` · `fetch <project> --status [--json]` · `… [--reason R]` | **Fetch windows** (the Cut tab's and the clip deck's button): every clip's window asked of the editor as ONE fetch-windows batch — `--body` prints the body and asks nobody; `--dry-run` the editor's plan (groups per platform, cached, in flight, unresolved); no flag starts it (one paced job per platform queue), `--wait` follows the jobs to their end and names each window a job failed; `--status` follows the last run's jobs once. Clips the montage rulings leave out are not asked for. Every run is recorded in `<project>/fetch-runs.json`. Needs WORKER_TOKEN (else the editor's env files) and the editor at ARCHILYZER_EDITOR_URL. **Exit 1** when a job failed or the editor refused ([report-video.md](report-video.md#fetching-the-windows-and-stand-ins)) | | `prep <project> [--clips a,b] [--json]` · `prep <project> [--clips a,b] --wait` · `prep <project> --status [--json]` | **Prepare clips for the walk** (the Cut tab's): what the clip bench makes on a clip's first open — a long recording's excerpt, the waveform — made ahead ([clip-bench.md](clip-bench.md#prepared-before-you-open-it)). No flag queues it and returns (a runner starts in the background, its log `out/bench-excerpts/prep.log`); `--wait` runs it here to the end; `--status` prints ready / to prepare / failed / not fetched and the runner. One clip at a time, each in the heavy slot (estimate 400 MB), under `nice -n 19` and `ionice -c3`; a prepared clip is skipped. A fetch that lands and a write that moves or adds a clip queue it too (`UMTOOL_BENCH_PREP=0` turns that off). **Exit 1** when a clip failed (`--wait`) | +| `prune <project> [--take X[,Y]] [--anyway] [--keep N] [--older-than 3d] [--yes] [--json]` · `prune --all [--keep N] [--older-than 3d] [--yes] [--json]` | **the takes' work files** (the Takes page's **Free work files**): per take its work — segments, chrome frames, crossfade batches, encode chunks, raw clip copies, `work-from-*` — counted by inode (a file hard-linked into two takes is counted once and freed only when both let it go), what freeing it gives back, or why it is kept: a running build or the take one builds from (never freed), the picked or current take, a pin in `takes/prune.json`, the newest `--keep` (2) of its group, anything modified within `--older-than` (3d), the `--from` bases of those. A dry run unless `--yes`; `--take X --anyway` frees a take the policy keeps. Renders, previews, take.json and manifests are never touched. **Exit 1** when a path could not be removed ([report-video.md](report-video.md#a-takes-work-files-and-pruning-them)) | | `fallback <project> --dry-run [--json]` · `fallback <project> [--clip <id> …] [--json]` · `fallback <project> --restore <clipId>` | **stand-ins** (the clip deck's **Use stand-in** / **Restore**): a montage clip whose window a fetch run says the editor refused, and is not on disk, switched to its phrase-scan instance's first public alternate (YouTube, then Odysee / cornbreadman, then the rest) — recorded on the clip as `fallbackFrom`, its ruling and voice-match row moved with it; `--restore` puts it back. An older `phrase-scan.json` with no `alternates` is scanned again. **Exit 1** when a named clip has no stand-in | | `phrases "<phrase>" ["<phrase>" …] --channels a,b [--prefer c] [--exclude RE] [--words \| --regex] [--samples N] [--no-cache] [--json \| --full]` | the phrase finder's search ([tools.md](tools.md#the-phrase-finder-toolsphrases)): every phrase in one pass, each with its count once folded, by year, the preferred channel's share or Rumble's, speaker changes, sample contexts. Plain words become a tolerant pattern unless the phrase holds a regular expression's characters. `--json` the numbers, `--full` every instance; `--spec FILE --out FILE --progress` is the page's job form. **Exit 1** on a bad phrase | | `voice-match <project> [--reference auto\|rulings\|recordings] [--reference-video <channel>/<id> …] [--reference-channel <slug> …] [--instances FILE] [--span phrase\|cut] [--pad S] [--likely X --unlikely Y] [--out FILE] [--dry] [--json] [--progress ndjson]` | who is speaking, per montage clip: a local speaker-similarity score (TitaNet-small) against the host's voice → `<project>/voice-match.json` (the Cut tab's **Score the voices**); `--instances` also scores a phrase scan's instances not in the manifest; `--dry` prints the plan ([report-video.md](report-video.md#who-is-speaking-the-voice-match)) | @@ -88,6 +89,9 @@ whatever directory it is run from — `umtool notes --all` from a report workspa from its cwd to `pnpm-workspace.yaml`. | `VIDEO_ROOT` (`song/spec.mjs`, `song/video-dir.mjs`) | `~/reports/quartering-uh-song/videos` | | `UMTOOL_BENCH_PREP` | unset = a fetch that lands and a write that moves or adds a clip queue the bench's prep (`prep`); `0` queues nothing (the triggers, `umtool prep` and the Cut tab's button; `prep --wait` still runs) | +| `UMTOOL_PRUNE_KEEP`, `UMTOOL_PRUNE_DAYS` | the prune policy's newest-per-group (2) and age (`3d`) when neither `takes/prune.json` nor the command line says (`prune`) | +| `UMTOOL_PRUNE_AFTER_BUILD` | unset = a take that is made prunes its project's takes by the policy after; `0` does not | +| `UMTOOL_DISK_GUARD`, `UMTOOL_DISK_GUARD_GB`, `UMTOOL_DISK_FLOOR_GB` | before a render: under 30 GiB free it prunes every project's takes by policy, under 10 GiB it refuses the render; `UMTOOL_DISK_GUARD=0` turns it off | ## `check` is the one to run before every build diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -934,6 +934,88 @@ the one the take was made from (its `baseHash`), the card says **The project cha take was made** and the pick waits for **Use anyway**. A take that does not record its base asks the same. +### A take's work files, and pruning them + +A take's build leaves behind what makes the NEXT build fast: its clip segments, the chrome +layers' frames (kept with `--keep-frames` so a `--from` twin reuses them; ~12 GB for a 34-minute +cut), the crossfade batches, the final encode's chunks. Kept forever they filled /home on +2026-10-27 (131 GB of it was takes' work). `lib/report/takePrune.mjs` names them, measures them +and removes them where no take is likely to need them; `umtool prune`, the Takes page, a take's +build and a render's disk guard all call it. + +**WORK** is exactly these, under `takes/<id>/out/` — everything else in a take is **FINAL** and +never touched (the renders `out/<slug>.mp4` with its ladder rungs and trailer, `preview.mp4`, +`take.json`, the manifests, `schedule.json`, `sync.json`, the chapters, the cards and QRs, the +chrome compositions, every small record, and any name not on the list): + +| Path | What | +|---|---| +| `<variant>/segments/` | each clip's encoded segment and its records | +| `<variant>/chrome/<layer>-frames/`, `<variant>/chrome/work-*/` | each layer's PNG sequence; a render's leftovers and `--from`'s `work-from-*` | +| `<variant>/xfade-batches/` | the crossfade batches | +| `<variant>/chunks/`, `<variant>/.content-hashes.json` | the chunked final encode and its content-hash memo | +| `<variant>/<slug>.prerail*.mp4` (and `.segments`) | the rail's cached base (`--rail-only`) | +| `.keep-frames/` | layers kept aside for a `--from` | +| `clips-raw/` (a real directory) | raw clip copies — the usual `clips-raw` is a link to the project's, which is not work | + +**Hard links are counted by inode.** `--from` links the other take's segments and frames in, so a +`du` of each take counts them twice. A take's **work** is its unique inodes' allocated bytes; what +it **frees** is the bytes whose every link is among the paths removed (st_nlink against the links +in the set); a plan over several takes counts the union, so two prunable twins free their shared +segments together. Freeing a take whose files another take also holds frees only what is its own, +and the other take's files are whole. + +**What is kept** — a take keeps its work while it is: + +- **being built**: a live build lock — `takes/<id>/.building.json` (the take maker writes it for + the whole make, naming the `--from` take) or `<out>/.building.json` (build-video writes it in + its `--out` for a render) — or a pipeline process naming a path in it (`lib/report/busy.mjs`). + A lock whose process is gone is ignored and said; +- **the base of a take being built** (a live lock's `from`); +- **picked** in its group (verdicts.json), or **current** (the project's `video.manifest.json` is + this take's); +- **pinned** in the project's `takes/prune.json`; +- one of the **newest K** of its group, by `builtAt` (default 2); +- **modified within D days** — take.json, the preview or `builtAt` (default 3); +- the **`--from` base of a kept take** (take.json's `from`, which the take maker now records, or + `xfade-batches/.from.json`), transitively. + +Everything else's work is prunable. The first two are never overridden; the rest are policy, and +naming one take with `--anyway` (the page's **free anyway**) frees it all the same. + +**The settings**, later winning: the defaults; `UMTOOL_PRUNE_KEEP`, `UMTOOL_PRUNE_DAYS` (`3d`, +`12h`, a number of days); the project's `takes/prune.json`; `--keep` / `--older-than` on the +command line. `takes/prune.json` is `{ "keep": 2, "olderThanDays": 3, "pin": ["<take>"], +"afterBuild": true }`, every key optional; one that does not parse, or is not that shape, refuses +the prune rather than guess. + +**Where it runs.** + +- `umtool prune <project>` / `umtool prune --all`: the plan, per take — work and what it frees, + or `kept because …` — and the totals. A dry run unless `--yes` ([cli.md](cli.md)). +- **The Takes page**: the head says the takes' work in all and what the policy would free, with + **Free work files** for the project; each card says its work and why it is kept or that it is + prunable, with its own **Free work files**. Both show the plan (each take, its work paths and + sizes, what is kept and why) and free only on **Free them** (`POST /api/report/takes/prune`, a + dry run first, as every delete on the page). +- **After a take is made** (`umtool take`, the page's New take and Rebuild, `takes make`): the + project's takes by its policy, the new take kept, one `prune: freed … / nothing to free` line in + the take's log. Off with `UMTOOL_PRUNE_AFTER_BUILD=0` or `"afterBuild": false`. +- **Before a render** (build-video, once it has the heavy slot): when the least free of the render's + `--out` filesystem and the reports root is under `UMTOOL_DISK_GUARD_GB` (default 30, in GiB) it + prunes every project's takes by their policies and says what that freed; still under + `UMTOOL_DISK_FLOOR_GB` (default 10) the render is refused with a sentence and nothing is + rendered. `UMTOOL_DISK_GUARD=0` turns it off (the e2e suite does). + +**Deleting never leaves the take.** Each work path is lstat'ed (a link is not work: never followed, +never removed) and its real path must be inside the take's real directory — or, when the take's +`out` is the media root's link (`UMTOOL_MEDIA_DIR`), inside that link's mirror. Under it, files +and links are unlinked and only real directories are descended into: a clip copy that links into +the corpus loses the link, never the corpus file. Each pruned chrome layer's frame count and key +go into its `chrome/pruned.json` first, so `verify-build` still checks the cut; what went is +appended to `takes/<id>/pruned-work.json`. The project's own `out/` is not a take and is not +touched. A pruned take rebuilt, or used as a `--from` base, renders its work again. + ### Trailer from the master `umtool trailer <project> --take <t> (--beats FILE | --beats-json JSON) [--intro] [--finale S]