commit 0f431d3c8e5beb62142fe7d264f2c83100c95c20
parent 35527e2f3fd6bc76527bbfccb100148b5f3e9eb0
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 13 Oct 2026 17:07:23 -0400
plans: release 27 follow-up — delete, as shipped; FACTS: the registry deletes; CHANGELOG
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 126 insertions(+), 1 deletion(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,8 @@
# Changelog
## [Unreleased]
+- **Articles, iterations, report-video projects and takes can be deleted, and every delete shows its plan first.** `archilyzer reports delete <id>` prints what would go — each path with its size, what is kept and why, and anything that stops it — and deletes nothing until `--apply`; `--iteration <n>` deletes one iteration. Deleting an article removes its directory (report, video, history, notes, iterations), each iteration's video project under `settings.generation.projectsRoot` and its staged exports. A published article is refused unless `--force`, which unpublishes it first; an article with a running iteration is always refused. An iteration is refused while it is the current article or video, the one the article's report came from, running, or the parent or original of another iteration, and its number is never given out again. The usage ledger, the shared prepared-media cache and the corpus's git history are kept. The same deletes run over HTTP as `pnpm ops delete-article {id, force?, dryRun?}` and `pnpm ops delete-iteration {id, n, dryRun?}`, which answer a refusal as a 409 with the plan.
+- **umtool: Delete article, `Delete i<n>`, Delete project and `Delete take <id>`.** Each button reads the plan, shows it (what goes with sizes, what is kept, what refuses) and deletes only on **Confirm delete**; **Keep it** closes it. **Delete article** is on an article's page (one in the making too) and returns to `/articles`, which says what went; `Delete i<n>` is on each iteration of the Iterations tab. **Delete project** on a report-video project removes its directory, and its `out/` or deliverables on the media drive when they are its own copy; it is refused while a job works in the project, for an article's current video, and — unless you tick **delete anyway** — for a project whose manifest names an article with a video attached. `Delete take <id>` removes `takes/<id>/`; the take whose manifest is the project's own needs **delete anyway**, and its verdict and notes are kept.
- **Reports and their revisions can be generated by the editor: `pnpm ops report-draft`.** `{"task": "sweep", "article", "question", "channels"}` drafts a new report of an article as its next iteration; `{"task": "revise-report" | "revise-video", "article", "iteration", "feedback"}` revises one; `{"task": "narrate", "article", "iteration"}` drafts the narration of an iteration's video cut; `"copyOf": N` runs iteration N again on another `"model"`. Each is a **Report draft** job on /jobs, on the Claude API (`draft:api`) or the local model (`draft:local`) by the model, and `pnpm ops job cancel` stops one. Every quote a model writes must be the transcript's words within 90 seconds of its link, or the finding is dropped; links cite the archive, never the platform. The answer names the job and the iteration; the job's log ends with the outcome. Needs a restart of the editor.
- **umtool makes and iterates articles: `/articles/new` and an article's Iterations tab.** `/articles/new` takes a question, channels picked from the editor's list, dates, the sweep (the agent on a Claude model or the pipeline on the local model), the model and a cap (the policy's default, which can only go down); **Start** has the editor run it as a report draft and opens the article's iterations. Each iteration shows its kind, model, parent, copy, status, cost per model, minutes, ops applied and refused, and checks, and which one is the article and which the video. On an iteration: **Use this iteration** (the article's report becomes its report), **New iteration** (a revision of the report or the video from your feedback, on a model), **Copy with model**, **Narrate**, **Cancel** (with the running job's log), and **Make the video** (the pipeline chain as a umtool job, step by step, resumable). An article whose only content is iterations is listed on `/articles` as in the making. umtool's `/drafts` page is gone; it opens `/articles/new`. Needs a restart of umtool.
- **umtool shows a research run's queue, and /articles/new can start with research.** On an article's Iterations tab, a research iteration lists each acquisition it proposed: what it fetches, why, its evidence links, its estimate, and why it waits or was refused. Each one that waits has Yes and No (with an optional reason). An approved one shows its editor job's state as it runs. Once nothing is pending, **Continue into a sweep** starts the sweep over the run's channels and every channel it acquired into. On /articles/new, "start with research" takes an autonomy (propose, limits or auto; default the settings') and needs no channel.
diff --git a/plans/FACTS.md b/plans/FACTS.md
@@ -9156,7 +9156,10 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri
(`writeArticleHoldingLock`, audience and video kept).
- **An article in the making** is a directory with `iterations/` and no `report.json` (`isPendingArticleDir`,
`registry.ts`). `listArticleDirs` and `readArticleState` leave it out; `listPendingArticles` lists it. The
- registry has no delete: an article directory is removed by hand only after the operator's OK.
+ registry deletes through `common/lib/report/delete.ts` (`planArticleDelete` / `deleteArticle`, `planIterationDelete`
+ / `deleteIteration`; `archilyzer reports delete`, `pnpm ops delete-article|delete-iteration`, umtool's Delete
+ buttons): a plan first, then the store's writes and one rename (`.deleting-…`) under the lock, the bulk after it.
+ An iteration's number is never reused (`current.json` `highest`).
- **An article may not be called `new`** (`RESERVED_ARTICLE_IDS`, `assertArticleId`): umtool's `/articles/new` is a
page.
- **Generation jobs** are job kind `report-draft` on the queues `draft:api` and `draft:local` (`DRAFT_API_QUEUE`,
diff --git a/plans/release-27.md b/plans/release-27.md
@@ -796,6 +796,126 @@ policy.
Owed to the operator: read `$T/r27h-import-dry.txt`, then `archilyzer reports import-local-runs --apply`; then the
OK for the 15 test leftovers (307 MB; three registry drafts by hand); `runs/api-shondo-fishing` undecided.
+### Follow-up: delete, as shipped (2026-10-13, lane I, `r27/delete`)
+
+The operator (2026-10-13): "add a delete path for all currently used paths for similar features." Nothing could remove
+an article, an iteration, its video project, a umtool report-video project or a take; test drafts could only go by
+hand under `transcripts/`.
+
+**The survey** (each thing, every place it lives or is named):
+- **An article:** `reports/<id>/` holds `report.json`, `video.mp4` and `poster.jpg` (real files: articles have no
+ media tier; `attach-video` writes them in place), `stills/`, `history-git/`, `notes.json` and `iterations/`.
+ `reports/index.json` lists the published ones. Its staged exports are `.export-index/articles/report-exports/<id>/`.
+ Its prepared clips are in the shared `report-media/` cache, keyed by moment, not by article (the next prepare
+ prunes what no published article cites). Its iterations' projects are `<projectsRoot>/<id>/i<n>/`. A umtool
+ project whose manifest says `"article": "articles/<id>"` links to it.
+ - A site's `pages` name the SITE's reports (`sites/<s>/reports/<r>/`): a different store and a different
+ document. The release 26 move dropped each moved id from its site. On this machine, no site's pages name an
+ article id (one site page, the site's own report).
+- **An iteration:** `iterations/<n>/` plus `current.json` (report, reportFrom, video). Its project is `projectOf(…)`,
+ or the recorded `projectDir`. Other iterations name it as `parent` or `copyOf`. A running job, or a running step
+ (narration, `chain:*`), is recorded in `iteration.json`. The usage ledger names it by number.
+- **A umtool project:** its directory under `REPORTS_ROOT`. A tiered project's `out/`, `clips/` and `share-*` may be
+ absolute links to `<MEDIA_ROOT>/<project-relative>/<name>` (`storage.mjs`). Its `notes.json`, `revisions/` and
+ `takes/` are inside it. The project index (`CACHE_DIR/index`) and the links cache are derived. A project is a leaf
+ of the walk, and may be reached through a link.
+- **A take:** `takes/<id>/` (`take.json`, `preview.mp4`, `video.manifest.json`, `out/`). Its verdict is a row of
+ `takes/verdicts.json`. Notes on it are in the project's `notes.json`. **Nothing records which take a deliverable
+ was built from**, so "in use" is decided as: the take whose `video.manifest.json` is byte for byte the project's.
+
+| Commit | What |
+| --- | --- |
+| `528b08f8` | common `lib/report/delete.ts`: `planArticleDelete`, `deleteArticle`, `planIterationDelete`, `deleteIteration`, `formatDeletePlan`. Registry additions: `unpublishHoldingLock`, `parkArticleDirHoldingLock`. Iteration additions: `current.json` `highest`, `retireIterationHoldingLock`, `iterationDirNumbers` (+ tests) |
+| `304a8cd3` | `archilyzer reports delete <id> [--iteration n] [--apply] [--force] [--json]` (`bin/reports-delete.ts`, its row, COMMANDS.md) |
+| `051d92fb` | editor `POST /api/ops/delete-article {id, force?, dryRun?}` and `delete-iteration {id, n, dryRun?}` (`_articleDelete.ts`); ACTIONS rows and help; COMMANDS.md |
+| `19e62dcc` | umtool `lib/report/delete.mjs` (projects and takes, + tests); routes `/api/articles/delete`, `/api/projects/delete`, `/api/report/takes/delete`; `components/DeletePlan.tsx` and the four controls; `/articles` and `/browse` say what went |
+| `c7620bc9`, `28565971` | umtool e2e `article-delete.spec.ts` and its fixture (`delete-fixture.mjs`; the spec writes its draft itself) |
+| `4b848a5d`, `ea1bc1cc` | REPORT.md (generated), OPERATING.md "Delete …", `umtool/docs/{projects,report-video,sites,e2e}.md`; ENVIRONMENT.md: `UMTOOL_MEDIA_DIR`, `REPORTS_DIR`, `SONG_REPORTS_DIR` (common reads them now) |
+| `c6efc792` | the delete removes what the plan made under the lock lists, plus the first plan's media copies |
+| (this commit) | this record; FACTS; CHANGELOG |
+
+**The design:**
+- **Plan, then apply.** A plan reads only. It lists every path that would go (with bytes, files and its biggest
+ parts), what is kept and why, refusals (each `forceable` or not), and the store writes `force` makes first. Every
+ surface shows the plan before it acts: the CLI is dry unless `--apply`, ops take `dryRun`, and umtool has
+ **Confirm delete**.
+- **Under the lock:** the plan is made again; with `force`, the site pages are dropped (`patchSite`) and the article
+ unpublished (`unpublishHoldingLock`). Then ONE rename parks the directory as `.deleting-<id>-<stamp>`
+ (`iterations/.deleting-<n>-<stamp>` for an iteration; not an id, so no reader sees it). The bulk is removed after
+ the lock is let go, so a delete of gigabytes never makes the lock look stale. A cut delete's park is listed and
+ removed by the next plan.
+- **Refusals.**
+ - **An article:** published, or a site page naming its id with no report of its own (forceable: force unpublishes
+ and drops the page). Any iteration queued or running, or with a running step (never forceable). Its directory
+ being a link.
+ - **An iteration (no override):** the current article; the iteration the article's report came from
+ (`reportFrom`); the current video; busy; a parent or original of another (named).
+ - **A project:** a link, or reached through one; a umtool job in it; an article's current-video iteration
+ project; a running iteration's project. A manifest naming an article with a video attached is forceable.
+ - **A take:** a job in the project. The take the project's manifest is, is forceable.
+ - **umtool's article route** also refuses while a `chain <id> …` job runs here, and names (and keeps) each
+ project whose manifest links the article.
+- **Roots.** Every removal is strictly inside the articles directory, the projects root, the export staging, or
+ (for a link that is exactly its umtool media mirror, `<mediaRoot>/<relative to reportsRoot>`) the media root.
+ Each is re-checked against its root's real path before it is removed. Any other link is removed as a link, and
+ its target kept and named.
+ - The media root is umtool's `MEDIA_ROOT` in umtool, and `UMTOOL_MEDIA_DIR` (+ `REPORTS_DIR`) in the CLI and
+ the editor. Unset, a mirror is kept and named.
+ - A recorded `projectDir` outside the projects root is kept and named.
+- **Numbers are never reused.** `current.json` keeps `highest`, and `createIteration` allocates above it. The
+ ledger and job logs name iterations by number.
+- **Kept, always:** the usage ledger, the shared `report-media/` cache, the git history of `transcripts/`, a deployed
+ site until rebuilt. A take's verdict row and notes are kept too: the agent reads them, and a missing take shows
+ as missing.
+- **Labels (contracts):** buttons `Delete article`, `Delete i<n>`, `Delete project`, `Delete take <id>`, `Confirm
+ delete`, `Keep it`. Region `delete <subject>` (`delete i3`, `delete the article <id>`, `delete the project <id>`,
+ `delete take <id>`). Lists `what goes`, `what is kept`, `refused`. Checkbox `delete anyway`. Attributes
+ `data-delete-blocked`, `data-delete-path`, `data-delete-bytes`, `data-deleted`.
+
+Gates:
+- tsc clean (all packages), at every commit.
+- Unit suites:
+ - common 4017/4017 (14 new: `lib/report/delete.test.ts` 11, `bin/reports-delete.test.ts` 3; the env test
+ caught the three umtool variables);
+ - editor unit 288/288 (`_articleDelete.test.ts` 3 new);
+ - mcp 343/343;
+ - `test:scripts` 858 pass + 2 skipped of 860 (`umtool/lib/report/delete.test.mjs` 5 new).
+- `docs cli|files|env --check`, `settings example --check`: clean.
+- Builds (heavy slot, 5 GB cap):
+ - editor 54 s (`/api/ops/delete-article`, `/api/ops/delete-iteration`);
+ - umtool 30 s, the corpus linked for the build only and removed (`/api/articles/delete`, `/api/projects/delete`,
+ `/api/report/takes/delete`).
+- e2e (umtool, foreground, two specs a run):
+ - `article-delete` + `article-iterations`: 7/7, 39.3 s at `19e62dcc`; 7/7, 39.3 s at `c6efc792`.
+ - `projects` + `articles`: 24 passed, 1 failed (`articles.spec` counts the store's rows, and the fixture's draft
+ `omega` was a third). The spec now writes and removes `omega` itself (`28565971`); `article-delete` +
+ `articles` then went 5/5.
+ - `takes` + `sites`: 9/9.
+ - The editor's `ops-api.spec.ts` covers no route of this lane and was not run; the two routes have unit tests
+ instead.
+- **The dry run for the six test articles** (read-only, against the live corpus; `$T/r27i-delete-dry.txt`): none
+ refused.
+
+ | Article | Paths | Size |
+ | --- | --- | --- |
+ | `local-test-shondo-baking` | 1 | 18.6 MiB |
+ | `local-test-shondo-fishing` | 2 (+ staged exports) | 25.8 MiB |
+ | `ui-test-shondo-cats` | 1 | 23.4 MiB |
+ | `r27-smoke-shondo` | 4 (+ `~/reports/articles/…/i5`, `i8`, exports) | 196 MiB |
+ | `r27-smoke-cancel` | 1, in the making | 38 KiB |
+ | `r27-smoke-research` | 1, in the making | 332 KiB |
+
+ - About 264 MiB in all. No umtool project's manifest names any of the six.
+ - The lock file and every directory were checked unchanged after the run.
+
+Left:
+- `busy.mjs`'s `/proc` scan (pipeline processes started outside umtool's job registry) is the CLI's, not a route's.
+ The project route sees umtool's own jobs only, as the storage movers' routes do.
+- A take that fails validation (listed under **skipped**) has no delete button. `planTakeDelete` takes it by
+ directory name.
+- The registry's per-article `.deleting-…` park is listed and removed by the next plan of the same article. Nothing
+ sweeps a park whose article id is never deleted again.
+
## Not in this release
- Release 28: the remaining media tasks (clip selection and order, on-screen titles, teaser, flips, threads, YouTube